Creating a GDS Foreign Table

Procedure

  1. Set the location parameter for the foreign table based on the path planned in Planning Data Export.

    • Remote mode
      Set the location parameter to the URL of the directory that stores the data files.
      • You do not need to specify a file name in the URL.
      • When the number of data sources exported is fewer than the available paths, files are created for the surplus paths without writing any data.

      For example:

      The IP address of the GDS data server is 192.168.0.90. The listening port number set during GDS startup is 5000. The directory for storing data files is /output_data.

      In this case, set the location parameter to gsfs://192.168.0.90:5000/.

      • By setting location to a subdirectory, for example, gsfs://192.168.0.90:5000/2019/11/, you can export the same table to different directories based on the date.
      • In the current version, the system checks if the /output_data/2019/11 directory exists when an export task is executed. If it does not exist, the system creates it. During the export, files are written to this directory. In this way, you do not need to manually run the mkdir -p /output_data/2019/11 command after creating or modifying a foreign table.

  2. Set data format parameters in the foreign table based on the planned data file formats.
  3. Create a GDS foreign table based on the parameter settings in the preceding steps.

Example