Skip to main content
Question

S3EXPORT

  • April 7, 2023
  • 2 replies
  • 6 views

thala

Hi Team,

Now that s3export/s3export_partition are deprecated in vertica 12. How do we export a file to s3?

I've gone through the link which didn't help me understand
https://docs.vertica.com/12.0.x/en/sql-reference/file-systems-and-object-stores/s3-object-store/

I've set the awsauth at the session level

Query is like below
SELECT s3export(a,b,c,d USING PARAMETERS url='s3:XXXX'||TO_CHAR(CURRENT_DATE,'YYYYMMDD')||'.txt', delimiter='|') OVER (ORDER BY record_no) FROM (select * from (   (sub-selects));

2 replies

s_crossman
Forum|alt.badge.img
  • Participating Frequently
  • April 7, 2023

Hi,

Export ORC, Parquet, and s3export were all consolidated into "export to file". Based on your example you are exporting to delimited so you'd use the export to delimited documented here https://docs.vertica.com/12.0.x/en/sql-reference/statements/export-to-delimited/.

I have an s3 bucket exp2delim which exists, and I export a select from a table to a non-existent subfolder "mysubfolder".
VMart=> export to delimited(directory='s3://exp2delim/mysubfolder') as select * from s3tester.parser;

Rows Exported

       486

(1 row)

Note my syntax has parans around parameters and single quotes around the s3 path. The example in the docs needs some touchup.

I hope it helps.


thala
  • Author
  • New Participant
  • April 10, 2023

Thanks @s_crossman . Will try that