【详述】StarRocks 3.3.2 版本JDBC Catalog SQLServer2012外表查询报错
【业务影响】
【是否存算分离】 是
【StarRocks版本】例如: 3.3.2
【附件】
-
创建Catalog 语句
CREATE EXTERNAL CATALOG jdbc0
PROPERTIES
(
“type”=“jdbc”,
“user”="",
“password”="",
“jdbc_uri”=“jdbc:sqlserver://10.96.7.186:1433;databaseName=IMES_Rep;trustServerCertificate=true;userSSL=false”,
“driver_url”=“file:///opt/module/StarRocks-3.3.0/jdbc-driver/mssql-jdbc-12.4.2.jre11.jar”,
“driver_class”=“com.microsoft.sqlserver.jdbc.SQLServerDriver”
); -
查询语句
SHOW DATABASES FROM jdbc0 —执行成功
USE jdbc0.dbo —执行成功
select * from PCBRepair; – 异常 -
fe.warn.log 异常信息
2024-08-14 09:06:09.636+08:00 WARN (starrocks-mysql-nio-pool-171|6732) [DefaultCoordinator.getNext():787] get next fail, need cancel. status errorCode INTERNAL_ERROR open JDBCScanner failed, error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ‘501’.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1695)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:648)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:567)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4137)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:272)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:246)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:485)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
at com.starrocks.jdbcbridge.JDBCScanner.open(JDBCScanner.java:95)
, query id: 64211647-59d9-11ef-b75a-5cba2c293c74
2024-08-14 09:06:09.636+08:00 WARN (starrocks-mysql-nio-pool-171|6732) [DefaultCoordinator.updateStatus():762] one instance report fail throw updateStatus(), need cancel. job id: -1, query id: 64211647-59d9-11ef-b75a-5cba2c293c74, instance id: NaN
2024-08-14 09:06:09.636+08:00 WARN (starrocks-mysql-nio-pool-171|6732) [DefaultCoordinator.getNext():813] query failed: open JDBCScanner failed, error: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ‘501’.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:259)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1695)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:648)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:567)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7675)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:4137)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:272)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:246)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:485)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
at com.starrocks.jdbcbridge.JDBCScanner.open(JDBCScanner.java:95)
2024-08-14 09:06:09.636+08:00 WARN (starrocks-mysql-nio-pool-171|6732) [StmtExecutor.execute():646] Query 64211647-59d9-11ef-b75a-5cba2c293c74 failed. Planner profile : Planner:
- – Parser[1] 0
Reason: