-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[BUG] Presto方言下SQL格式化错误 #6631
Copy link
Copy link
Open
Description
Database Type
Presto
Database Version
0.283
Druid Version
1.2.28
JDK Version
OpenJDK 21.0.7
Error SQL
select ext['c1'] from test.test_table
Testcase Code
import com.alibaba.druid.DbType;
import com.alibaba.druid.sql.SQLUtils;
public class DruidPrestoFormatBug {
@Test
void testDruidPrestoFormatBug() {
String sql = "select ext['c1'] from test.test_table";
String formatSQL = SQLUtils.format(sql, DbType.presto);
System.out.println(formatSQL);
}
}
Stacktrace Info
No response
Error Info
Expected behavior
格式化后的 SQL 应该保持原始语义:
SELECT ext['c1'] FROM test.test_table
Actual behavior
底层表达式名丢失,变成了 ARRAY 关键字:
SELECT ARRAY['c1'] FROM test.test_table
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels