SQL1822N error when you run a query in Watson Query
When you try to run a query, you get an error with code
SQL1822N
.
Symptoms
When you run a query, you receive an error message with code SQL1822N
and the following content.
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
Causes
You get this message when the query contains an error in at least one of the data sources involved in the query execution.
Resolving the problem
To try to resolve the problem, follow these steps.
- Retrieve the full error message by querying the
LISTREMOTEWARNINGS
catalog view.- Option 1 To retrieve all warnings in the last hour, use the following
query.
SELECT NODE_NAME, TSTAMP, CAST(WARNING AS VARCHAR(250)) FROM DVSYS.LISTREMOTEWARNINGS WHERE TIMESTAMPDIFF(8, CURRENT TIMESTAMP - TSTAMP) <= 1 ORDER BY TSTAMP
- Option 2 To retrieve all warnings, use the following
query.
SELECT * FROM DVSYS.LISTREMOTEWARNINGS;
- Option 1 To retrieve all warnings in the last hour, use the following
query.
-
Identify the root cause of the problem. The full remote error message is in the "WARNING" column. Use this column to identify and correct the root cause. If you used option 1 to review all warnings in the last hour, the warning might be truncated due to the CAST specification. Increase the size of the
varchar()
or remove thecast
to see the full message.- Example 1: The message indicates that you are unable to connect to the remote data source.
-
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
- Example 2: The message indicates that some queries with row_number() over() or rownumber() over() fail.
-
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
- Example 3: The message indicates that some queries fail in a Data Virtualization Manager data source.
-
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.
- Example 4: The message indicates that the query is against a table that has columns with the type PERIOD on a Teradata data source.
- Example 5: The message indicates that a remote data source has been removed from Watson Query, but the existing tables are kept when you attempt to create a view or access the remote tables.
-
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