Exporting Search Results
Function
This statement is used to directly write query results to a specified directory. The query results can be stored in CSV, Parquet, ORC, CARBON, JSON, or Avro format.
Syntax
1 2 3 4 | INSERT OVERWRITE DIRECTORY path
USING file_format
[OPTIONS(key1=value1)]
select_statement;
|
Keyword
- USING: Specifies the storage format.
- OPTIONS: Specifies the list of attributes to be exported. This parameter is optional.
Parameter
| Parameter | Description |
|---|---|
| path | The OBS path to which the query result is to be written. |
| file_format | Format of the file to be written. The value can be CSV, Parquet, ORC, CARBON, JSON, or Avro. |
Precautions
None
Example
1 2 3 4 | INSERT OVERWRITE DIRECTORY 'obs://bucket/dir'
USING csv
OPTIONS(key1=value1)
select * from db1.tb1;
|
Last Article: Clearing Data
Next Article: Creating a Datasource Connection with an HBase Table

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.