Details
-
Documentation
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
ghx-label-6
Description
COPY TESTCASE statements are used to dump metadata of tables/views used by a query into a file. Users can share the file and developers replay the metadata in their local cluster.
Statement to dump the metadata to a file:
COPY TESTCASE TO <hdfs/s3 dirpath> <query stmt>
Example:
COPY TESTCASE TO '/tmp' SELECT * FROM functional_parquet.alltypes; +--------------------------------------------------------------------------------------+ | Test case data output path | +--------------------------------------------------------------------------------------+ | hdfs://localhost:20500/tmp/impala-testcase-data-f41f7b14-dfc8-408b-ac3b-ef49fc3e0a83 | +--------------------------------------------------------------------------------------+
Statement to load the metadata in a target cluster:
COPY TESTCASE FROM <hdfs/s3 testcase file path>
Example:
COPY TESTCASE FROM '/tmp/impala-testcase-data-f41f7b14-dfc8-408b-ac3b-ef49fc3e0a83'; +----------------------------------------------------------------------------------------------------------------+ | summary | +----------------------------------------------------------------------------------------------------------------+ | Testcase generated using Impala version 4.5.0-SNAPSHOT. 1 db(s), 1 table(s) and 0 view(s) imported for query: | | | | SELECT * FROM functional_parquet.alltypes | +----------------------------------------------------------------------------------------------------------------+
To use the metadata, set query option PLANNER_TESTCASE_MODE to true:
SET PLANNER_TESTCASE_MODE=true; SHOW COLUMN STATS functional_parquet.alltypes;
Attachments
Issue Links
- relates to
-
IMPALA-11901 COPY TESTCASE is broken in LocalCatalog mode
- Resolved
-
IMPALA-11885 Support COPY TESTCASE statement for kudu tables
- Open
-
IMPALA-5872 Implement a SQL test case builder for gathering query diagnostics
- Resolved