Go back to the English version of the documentation在Data Virtualization中运行查询时出现SQL1822N错误
在Data Virtualization中运行查询时出现SQL1822N错误
Last updated: 2024年11月26日
尝试运行查询时,迂到代码为 SQL1822N
的错误。
症状
运行查询时,您会收到一条错误消息,其中包含代码 SQL1822N
和以下内容。
SQL1822N Unexpected error code "GDB_ERROR" received from data source
"DV-FMP". Associated text and tokens are "Query failed at some sources.
Check remote warnings". SQLSTATE=560BD
原因
当查询包含查询执行中所涉及的至少一个数据源中的错误时,您将收到此消息。
解决问题
要尝试解决此问题,请执行以下步骤。
- 通过查询
LISTREMOTEWARNINGS
目录视图来检索完整错误消息。- 选项 1 要检索最近一小时内的所有警告,请使用以下查询。
SELECT NODE_NAME, TSTAMP, CAST(WARNING AS VARCHAR(250)) FROM DVSYS.LISTREMOTEWARNINGS WHERE TIMESTAMPDIFF(8, CURRENT TIMESTAMP - TSTAMP) <= 1 ORDER BY TSTAMP
- 选项 2 要检索所有警告,请使用以下查询。
SELECT * FROM DVSYS.LISTREMOTEWARNINGS;
- 选项 1 要检索最近一小时内的所有警告,请使用以下查询。
确定问题的根本原因。 完整的远程错误消息位于 "警告" 列中。 使用此列可识别并更正根本原因。 如果使用选项 1 来查看过去一小时内的所有警告,那么由于 CAST 规范,可能会截断该警告。 增大
varchar()
的大小,或者除去cast
以查看完整消息。- 示例 1: 消息指示您无法连接到远程数据源。
qpendpoint_1:6415 2021-04-27-08.43.59.428000000 RESULT_DS_EXEC_QUERY_ERROR: Query exec failure against Data Source GDB_GTW_TPCDS_CATALOG_RETURNS_DB210001: java.lang.Exception: Unreachable RDBMS in Data Source: GDB_GTW_TPCDS_CATALOG_RETURNS_DB210001
- 示例 2: 此消息指示具有 row_number () over () 或 rownumber () over () 的某些查询失败。
fmp_1 2022-06-17-02.49.56.313000000 2022-06-17-02.49.56.313000000 1 RESULT_DS_EXEC_QUERY_ERROR: Origin: 3 node(s), 0/1 sources (0 successful, 0 excluded, 1 failed, 0 missing) Warnings (1) >"GDB_NODE yanlixu_yanlixuiptt8x86_Endpoint1:60009 QUERYING SOURCE Netezza VIA GDB_SUBQ_NETEZ10000: Unable to get physical meta data for table: (SELECT ROW_NUMBER() OVER( ) C0 FROM ""TEST"".""TESTNUMBER"" A0) SUBQ : org.netezza.error.NzSQLException: ERROR: ROW_NUMBER must include ORDER BY specification "-1822: Remote Exception: Origin: 3 node(s), 0/1 sources (0 successful, 0 excluded, 1 failed, 0 missing) Warnings (1) >"GDB_NODE yanlixu_yanlixuiptt8x86_Endpoint1:60009 QUERYING SOURCE Netezza VIA GDB_SUBQ_NETEZ10000: Unable to get physical meta data for table: (SELECT ROW_NUMBER() OVER( ) C0 FROM ""TEST"".""TESTNUMBER"" A0) SUBQ : org.netezza.error.NzSQLException: ERROR: ROW_NUMBER must include ORDER BY specification yanlixu_yanlixuiptt8x86_Endpoint1:60009 2022-06-17-02.49.56.298000000 2022-06-17-02.49.56.298000000 1 RESULT_DS_EXEC_QUERY_ERROR: Query exec failure against Data Source GDB_SUBQ_NETEZ10000: java.lang.Exception: Unable to get physical meta data for table: (SELECT ROW_NUMBER() OVER( ) C0 FROM "TEST"."TESTNUMBER" A0) SUBQ : org.netezza.error.NzSQLException: ERROR: ROW_NUMBER must include ORDER BY specification
- 示例 3: 消息指示某些查询在 Data Virtualization Manager 数据源中失败。
qpendpoint_3:6417 2022-08-31-08.31.55.624000000 2022-08-31-08.31.55.624000000 1 ENGINE_STATEMENT_PREPARE_ERROR_SQL: GDB_SUBQ_DVM10000 Unable to PREPARE statement - (empty result for this data source): Unable to get physical meta data for table: (SELECT A0.C1 C0, A0.C8 C1 FROM DVSQL.CB1A_TSDCV_TESTNUMBER A0) SUBQ : java.sql.SQLException: [DV][JDBC Driver][3.1.202201120442] [DV][JDBC Driver][3.1.202201120442] Unexpected end of input stream java.net.SocketInputStream@30edda80 (read 0 out of an expected 4 bytes), while executing userSql=select * from (SELECT A0.C1 C0, A0.C8 C1 FROM DVSQL.CB1A_TSDCV_TESTNUMBER A0) SUBQ where 0=1 - 'call listrdbc()' to identify the data source.
- 示例 4: 此消息指示查询针对的表在 Teradata 数据源上具有类型为 PERIOD 的列。
- 例 5:该消息表示远程数据源已从Data Virtualization中删除,但当您尝试创建视图或访问远程表时,现有表仍被保留。
Failed to get join result.: Unexpected error code "GDB_ERROR" received from data source "DV-FMP". Associated text and tokens are "Query failed at some sources. Check remote warnings".. SQLCODE=-1822, SQLSTATE=560BD, DRIVER=4.32.28