Quanlong Huang created IMPALA-13339:
---------------------------------------

             Summary: Introduce the COPY TESTCASE statements
                 Key: IMPALA-13339
                 URL: https://issues.apache.org/jira/browse/IMPALA-13339
             Project: IMPALA
          Issue Type: Documentation
          Components: Docs
            Reporter: Quanlong Huang
            Assignee: Sanjana Malhotra


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:
{noformat}
COPY TESTCASE TO <hdfs/s3 dirpath> <query stmt>{noformat}
Example:
{noformat}
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
 |
+--------------------------------------------------------------------------------------+{noformat}
Statement to load the metadata in a target cluster:
{noformat}
COPY TESTCASE FROM <hdfs/s3 testcase file path>{noformat}
Example:
{noformat}
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                                     
                                 |
+----------------------------------------------------------------------------------------------------------------+{noformat}
To use the metadata, set query option PLANNER_TESTCASE_MODE to true:
{noformat}
SET PLANNER_TESTCASE_MODE=true;
SHOW COLUMN STATS functional_parquet.alltypes;{noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to