Alberto de Vega
12/10/2025, 4:30 PMCREATE EXTERNAL *CATALOG* mib_sql_server
PROPERTIES (
*"type"*=*"jdbc"*,
*"user"*=*"xxxxx"*,
*"password"*=*"xxxxx"*, *"jdbc_uri"*=*"jdbc:sqlserver://;serverName=xxxx;databaseName=xxx;encrypt=true;trustServerCertificate=true;"*,
*"driver_url"*=*"<https://github.com/microsoft/mssql-jdbc/releases/download/v13.2.1/mssql-jdbc-13.2.1.jre11.jar>"*,
*"driver_class"*=*"com.microsoft.sqlserver.jdbc.SQLServerDriver"*,
*"sessionVariables"*=*"SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"*
);
The table GVP_CONTENTS_LABELS has a column called "ORDER", reserved. I'm supposed to escape ORDER by using backticks.
`*SELECT* ID, *`ORDER`*` *FROM* mib_sql_server.dbo.GVP_CONTENTS_LABELS;
But this fails with the following error
SQL Error [1064] [42000]: open JDBCScanner failed, error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near the keyword 'ORDER'.
Surprisingly, this command works fine:
`EXPLAIN SELECT ID, *`ORDER`*` FROM mib_sql_server.dbo.GVP_CONTENTS_LABELS;
Explain String |
-------------------------------------------------------------+
PLAN FRAGMENT 0 |
OUTPUT EXPRS:ID | ORDER |
PARTITION: UNPARTITIONED |
|
RESULT SINK |
|
0:SCAN JDBC |
TABLE: [dbo].[GVP_CONTENTS_LABELS] |
QUERY: SELECT ID, ORDER FROM [dbo].[GVP_CONTENTS_LABELS]|
Is this a bug, related to the mapping from StarRocks to SQL Server? Is there a way to make it work without "touching" the SQL Server?Alberto de Vega
12/11/2025, 7:09 AM