How to create CSV file instead of .PART file in SELECT INTO OUTFILE S3

92 Views Asked by At

I'm using SELECT INTO OUTFILE S3 command to move output of queries to an S3 bucket via a Stored Procedure. The front-end application has to read these files and show them on the screen. But, the output files produced by this command is of type .part_0000, which the front-end application is unable to read. Is there a way to force .csv or .text extension on these files produced by the command or is there a way for a react application to read .part files ?

The command that I'm using -

select * from My_table
 INTO OUTFILE S3 's3://my_bcuket/folder/filename'
    FIELDS TERMINATED BY ','
    LINES TERMINATED BY '\n'
    FORMAT CSV HEADER
    OVERWRITE ON

FORMAT, the optional keyword allows for CSV and TEXT but it's more about the data format than about file type and extension I guess ? Adding it or removing it didn't make any difference. Any help is appreciated.

0

There are 0 best solutions below