Export data from table into multiple files as per table partition

I would like to export table data into multiple files containing data from each partition

Comments

  • Hi Naveen, You can do the following: //get a list of all partitions for that table select distinct partition_key from partitions where projection_name in (select projection_name from projections where anchor_table_name='' //Move each partition for the table to a transient table select move_partitions_to_table('table_name','partition_key','partition_key','new_table_for_partition'); //Copy data from transient data to flat file vsql -U username -w password -F',' -c "select * from new_table_for_partition" | gzip -f > export_file.gz //move data back to source table or delete table based on requirement Sajan
  • Thanks Sajan

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file