Help Center > > Developer Guide> Data Export> Using GDS to Export Data to a Remote Server> Exporting Data

Exporting Data

Updated at: Sep 17, 2021 GMT+08:00


Ensure that the IP addresses and ports of servers where CNs and DNs are deployed can connect to those of the GDS server.


  1. Export data.

    INSERT INTO  [Foreign table name] SELECT * FROM [Source table name];
    • Create batch processing scripts to export data in parallel. The degree of parallelism depends on the server resource usage. You can test several tables and monitor resource usage to determine whether to increase or reduce the amount. Common resource monitoring commands include top for memory and CPU usage, iostat for I/O usage, and sar for networks. For details about application cases, see Exporting Data Using Multiple Threads.
    • Only a single internal table can be exported at a time. Multiple tables cannot be joined during export. Results of the aggregation, sort, subquery, and limit operations on a single table also cannot be exported.


  • Example 1: Export data from the reasons table to data files through the foreign_tpcds_reasons foreign table.
    INSERT INTO foreign_tpcds_reasons SELECT * FROM reasons;
  • Example 2: Export part of the data to data files by specifying the filter condition r_reason_sk =1.
    INSERT INTO foreign_tpcds_reasons SELECT * FROM reasons WHERE r_reason_sk=1;
  • Example 3: Data of a special type, such as RAW, is exported as a binary file, which cannot be recognized by the import tool. You need to use the RAWTOHEX() function to convert it to hexadecimal the format before export.
    INSERT INTO foreign_blob_type_tab SELECT RAWTOHEX(c) FROM blob_type_tab; 

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?

Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel