Files
impala/testdata/workloads/functional-query/queries/QueryTest/acid-insert-fail.test
Xuebin Su ad868b9947 IMPALA-13115: Add query id to error messages
This patch adds the query id to the error messages in both

- the result of the `get_log()` RPC, and
- the error message in an RPC response

before they are returned to the client, so that the users can easily
figure out the errored queries on the client side.

To achieve this, the query id of the thread debug info is set in the
RPC handler method, and is retrieved from the thread debug info each
time the error reporting function or `get_log()` gets called.

Due to the change of the error message format, some checks in the
impala-shell.py are adapted to keep them valid.

Testing:
- Added helper function `error_msg_expected()` to check whether an
  error message is expected. It is stricter than only using the `in`
  operator.
- Added helper function `error_msg_equal()` to check if two error
  messages are equal regardless of the query ids.
- Various test cases are adapted to match the new error message format.
- `ImpalaBeeswaxException`, which is used in tests only, is simplified
  so that it has the same error message format as the exceptions for
  HS2.
- Added an assertion to the case of killing and restarting a worker
  in the custom cluster test to ensure that the query id is in
  the error message in the client log retrieved with `get_log()`.

Change-Id: I67e659681e36162cad1d9684189106f8eedbf092
Reviewed-on: http://gerrit.cloudera.org:8080/21587
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
2024-08-08 14:11:04 +00:00

86 lines
1.8 KiB
Plaintext

====
---- QUERY
create table insertonly_acid (i int)
tblproperties('transactional'='true', 'transactional_properties'='insert_only');
insert into insertonly_acid values (1), (2);
select * from insertonly_acid;
---- RESULTS
1
2
---- TYPES
INT
====
---- QUERY
set DEBUG_ACTION="FIS_FAIL_HDFS_TABLE_SINK_FLUSH_FINAL:FAIL@1.0";
insert into insertonly_acid values (42);
---- CATCH
Debug Action: FIS_FAIL_HDFS_TABLE_SINK_FLUSH_FINAL:FAIL@1.0
====
---- QUERY
select * from insertonly_acid;
---- RESULTS
1
2
---- TYPES
INT
====
---- QUERY
set DEBUG_ACTION="CLIENT_REQUEST_UPDATE_CATALOG:FAIL@1.0";
insert into insertonly_acid values (42);
---- CATCH
Debug Action: CLIENT_REQUEST_UPDATE_CATALOG:FAIL@1.0
====
---- QUERY
select * from insertonly_acid;
---- RESULTS
1
2
---- TYPES
INT
====
---- QUERY
create table part (n int)
partitioned by (p int) tblproperties (
'transactional'='true',
'transactional_properties'='insert_only');
insert into table part (p, n) select 1, 10;
insert into table part (p, n) select 2, 20;
select p, n from part;
---- RESULTS
1,10
2,20
----
---- TYPES
INT,INT
====
---- QUERY
# Dynamic partition insert into existing and non-existing partitions.
set DEBUG_ACTION="FIS_FAIL_HDFS_TABLE_SINK_FLUSH_FINAL:FAIL@1.0";
insert into part (p, n) select cast(i + 1 as INT), 11 from insertonly_acid;
---- CATCH
Debug Action: FIS_FAIL_HDFS_TABLE_SINK_FLUSH_FINAL:FAIL@1.0
====
---- QUERY
select p, n from part;
---- RESULTS
1,10
2,20
---- TYPES
INT,INT
====
---- QUERY
# Dynamic partition insert into existing and non-existing partitions.
set DEBUG_ACTION="CLIENT_REQUEST_UPDATE_CATALOG:FAIL@1.0";
insert into part (p, n) select cast(i + 1 as INT), 11 from insertonly_acid;
---- CATCH
Debug Action: CLIENT_REQUEST_UPDATE_CATALOG:FAIL@1.0
====
---- QUERY
select p, n from part;
---- RESULTS
1,10
2,20
---- TYPES
INT,INT
====