doc-exports/docs/dws/dev/dws_06_0159.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

385 lines
102 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0000001188589008"></a><a name="EN-US_TOPIC_0000001188589008"></a>
<h1 class="topictitle1">CREATE FOREIGN TABLE (for GDS Import and Export)</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188589008__af891cd45f68c4aa3ad512f2bf5b875e4"><strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b84235270610560">CREATE FOREIGN TABLE</strong> creates a GDS foreign table.</p>
<div class="section" id="EN-US_TOPIC_0000001188589008__s228271ee6c4e445cb9013ce964ce106b"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001188589008__aae32dd6e030f4b81abcf4d92195088af"><strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b979423817101421">CREATE FOREIGN TABLE</strong> creates a GDS foreign table in the current database for concurrent data import and export. The GDS foreign table can be read-only or write-only, used for concurrent data import and export, respectively. The OBS foreign table is read-only by default.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188589008__sc5a62bac2f874f549e4f075732fe375a"><h4 class="sectiontitle">Precautions</h4><ul id="EN-US_TOPIC_0000001188589008__uebe61199469c415ba128136ccf29de79"><li id="EN-US_TOPIC_0000001188589008__l16448c8c94bc4c1caf428de4ab94cc2c">The foreign table is owned by the user who runs the command.</li><li id="EN-US_TOPIC_0000001188589008__l9ed0187193674e428a91ece1be7e12b9">The distribution mode of a GDS foreign table does not need to be explicitly specified. The default is <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b842352706171917">ROUNDROBIN</strong>.</li><li id="EN-US_TOPIC_0000001188589008__lc76f5fcdc2764e98a663649ba20b4ff3">All constraints (including column and row constraints) are invalid to the GDS foreign table.</li><li id="EN-US_TOPIC_0000001188589008__li1869305963219">GDS supports the following file formats: TEXT, CSV, and FIXED.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188589008__s67f31f99f36f48cd8a33392fce536ccd"><h4 class="sectiontitle">Syntax</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188589008__s583430213cd1442a998ac387106ed25d"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span>
<span class="normal">9</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">IF</span><span class="w"> </span><span class="k">NOT</span><span class="w"> </span><span class="k">EXISTS</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="k">table_name</span><span class="w"> </span>
<span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">column_name</span><span class="w"> </span><span class="n">type_name</span><span class="w"> </span><span class="k">POSITION</span><span class="p">(</span><span class="k">offset</span><span class="p">,</span><span class="k">length</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">LIKE</span><span class="w"> </span><span class="n">source_table</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span>
<span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">gsmpp_server</span><span class="w"> </span>
<span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="n">option_name</span><span class="w"> </span><span class="s1">' value '</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">WRITE</span><span class="w"> </span><span class="k">ONLY</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="k">READ</span><span class="w"> </span><span class="k">ONLY</span><span class="w"> </span><span class="err">}</span><span class="p">]</span><span class="w"> </span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">error_table_name</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">LOG</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">error_table_name</span><span class="p">]</span><span class="w"> </span>
<span class="w"> </span><span class="p">[</span><span class="n">REMOTE</span><span class="w"> </span><span class="n">LOG</span><span class="w"> </span><span class="s1">'name'</span><span class="p">]</span><span class="w"> </span>
<span class="w"> </span><span class="p">[</span><span class="n">PER</span><span class="w"> </span><span class="n">NODE</span><span class="w"> </span><span class="n">REJECT</span><span class="w"> </span><span class="k">LIMIT</span><span class="w"> </span><span class="s1">'value'</span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="k">TO</span><span class="w"> </span><span class="err">{</span><span class="w"> </span><span class="k">GROUP</span><span class="w"> </span><span class="n">groupname</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">NODE</span><span class="w"> </span><span class="p">(</span><span class="w"> </span><span class="n">nodename</span><span class="w"> </span><span class="p">[,</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">]</span><span class="w"> </span><span class="p">)</span><span class="w"> </span><span class="err">}</span><span class="w"> </span><span class="p">];</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188589008__section3616948910390"><h4 class="sectiontitle">Parameter Overview</h4><p id="EN-US_TOPIC_0000001188589008__p61667761111954"><strong id="EN-US_TOPIC_0000001188589008__b16711658382">CREATE FOREIGN TABLE</strong> provides multiple parameters, which are classified as follows:</p>
<ul id="EN-US_TOPIC_0000001188589008__ul60077539105357"><li id="EN-US_TOPIC_0000001188589008__li15445101019312">Mandatory parameters<ul id="EN-US_TOPIC_0000001188589008__ul168110337317"><li id="EN-US_TOPIC_0000001188589008__li56520455111453"><a href="#EN-US_TOPIC_0000001188589008__l20903b2b22b741bb839421d382d07c32">table_name</a></li><li id="EN-US_TOPIC_0000001188589008__li4843017311155"><a href="#EN-US_TOPIC_0000001188589008__l06b8baaf06ba44589e22b8c4f701c016">column_name</a></li><li id="EN-US_TOPIC_0000001188589008__li5082573611159"><a href="#EN-US_TOPIC_0000001188589008__l6722985a800f446c8860743139d762e4">type_name</a></li><li id="EN-US_TOPIC_0000001188589008__li26030103111512"><a href="#EN-US_TOPIC_0000001188589008__l56e9c7be738d42448d9ea638e32fe05e">SERVER gsmpp_server</a></li><li id="EN-US_TOPIC_0000001188589008__li39529502112345"><a href="#EN-US_TOPIC_0000001188589008__l2631a88728a14f43857bb4c04b2d9104">OPTIONS</a><ul id="EN-US_TOPIC_0000001188589008__ul1613755433216"><li id="EN-US_TOPIC_0000001188589008__li172681855123215">Data source location parameter for foreign tables: <a href="#EN-US_TOPIC_0000001188589008__l6a4cdf99a0364e289119f03b114b8b62">location</a></li><li id="EN-US_TOPIC_0000001188589008__li1226985512329">Data format parameters<ul id="EN-US_TOPIC_0000001188589008__ul326975593212"><li id="EN-US_TOPIC_0000001188589008__li17269125519328"><a href="#EN-US_TOPIC_0000001188589008__l251896c64542407a912f06640ef49f5a">format</a></li><li id="EN-US_TOPIC_0000001188589008__li1526915543211"><a href="#EN-US_TOPIC_0000001188589008__l4509784974094c3a8e2e196463bba140">header</a> (only for CSV and FIXED source data files)</li><li id="EN-US_TOPIC_0000001188589008__li112691556323"><a href="#EN-US_TOPIC_0000001188589008__l233844e8314043318e05730e92485ab7">fileheader</a> (only for CSV and FIXED source data files)</li><li id="EN-US_TOPIC_0000001188589008__li1127035511326"><a href="#EN-US_TOPIC_0000001188589008__li02461414114117">out_filename_prefix</a></li><li id="EN-US_TOPIC_0000001188589008__li1327025512325"><a href="#EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li99825131592">delimiter</a></li><li id="EN-US_TOPIC_0000001188589008__li12270165514323"><a href="#EN-US_TOPIC_0000001188589008__l97b17ee10c314710a461ba967e9d0b8c">quote</a> (only for CSV source data files)</li><li id="EN-US_TOPIC_0000001188589008__li9270165503214"><a href="#EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li74427391592">escape</a> (only for CSV source data files)</li><li id="EN-US_TOPIC_0000001188589008__li1627065513325"><a href="#EN-US_TOPIC_0000001188589008__l23f5b49658fe4a77b126c30aee563507">null</a></li><li id="EN-US_TOPIC_0000001188589008__li20270145513321"><a href="#EN-US_TOPIC_0000001188589008__ldb9cda16bf2849678b91826adb3b4c96">noescaping</a> (only for TEXT source data files)</li><li id="EN-US_TOPIC_0000001188589008__li1227012556321"><a href="#EN-US_TOPIC_0000001188589008__l88460d19d60945e99eccf5f6429762b7">encoding</a></li><li id="EN-US_TOPIC_0000001188589008__li13271255183216"><a href="#EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li62201592">eol</a></li><li id="EN-US_TOPIC_0000001188589008__li122711255123212"><a href="#EN-US_TOPIC_0000001188589008__li718215784217">conflict_delimiter</a></li><li id="EN-US_TOPIC_0000001188589008__li152718558327"><a href="#EN-US_TOPIC_0000001188589008__li148341029172620">file_type</a></li><li id="EN-US_TOPIC_0000001188589008__li3271105514327"><a href="#EN-US_TOPIC_0000001188589008__li4151040112612">auto_create_pipe</a></li><li id="EN-US_TOPIC_0000001188589008__li82711055113212"><a href="#EN-US_TOPIC_0000001188589008__li20789241193611">del_pipe</a></li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__li4271145516327">Error-tolerance parameters<ul id="EN-US_TOPIC_0000001188589008__ul162711655113216"><li id="EN-US_TOPIC_0000001188589008__li3271125512324"><a href="#EN-US_TOPIC_0000001188589008__l4217c10dcb944cc3a68346ad11014331">fill_missing_fields</a></li><li id="EN-US_TOPIC_0000001188589008__li11271255173214"><a href="#EN-US_TOPIC_0000001188589008__l6a63450436114055b9ea51a0174a1886">ignore_extra_data</a></li><li id="EN-US_TOPIC_0000001188589008__li15272655183219"><a href="#EN-US_TOPIC_0000001188589008__lff1a3b7e86664932b1bb2f44bb740455">reject_limit</a></li><li id="EN-US_TOPIC_0000001188589008__li1272125510322"><a href="#EN-US_TOPIC_0000001188589008__l1355aef8984145488d8b1e213302bf55">compatible_illegal_chars</a></li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__li927214558324">Performance parameter<ul id="EN-US_TOPIC_0000001188589008__ul827310553324"><li id="EN-US_TOPIC_0000001188589008__li18273185543210"><a href="#EN-US_TOPIC_0000001188589008__li1155623884317">file_sequence</a></li></ul>
</li></ul>
</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__li227971643114">Optional parameters<ul id="EN-US_TOPIC_0000001188589008__ul1425243134114"><li id="EN-US_TOPIC_0000001188589008__li427285516327"><a href="#EN-US_TOPIC_0000001188589008__l38d1f5d8d31946d1ac878003337961a6">WITH error_table_name</a></li><li id="EN-US_TOPIC_0000001188589008__li1527295543211"><a href="#EN-US_TOPIC_0000001188589008__l0197538463034921bffa55634fa035d2">LOG INTO error_table_name</a></li><li id="EN-US_TOPIC_0000001188589008__li027245518323"><a href="#EN-US_TOPIC_0000001188589008__leffe0ccd2877448f88dab7b30cea8b7d">REMOTE LOG 'name'</a></li><li id="EN-US_TOPIC_0000001188589008__li118421534417"><a href="#EN-US_TOPIC_0000001188589008__l858bbb2e7da849a8a52f3e80dd08ff74">PER NODE REJECT LIMIT 'value'</a></li></ul>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188589008__s949bbfb7d67e4891ac3744b6ecf3bb2a"><a name="EN-US_TOPIC_0000001188589008__s949bbfb7d67e4891ac3744b6ecf3bb2a"></a><a name="s949bbfb7d67e4891ac3744b6ecf3bb2a"></a><h4 class="sectiontitle">Parameter Description</h4><ul id="EN-US_TOPIC_0000001188589008__u96acedce77284047ae132641ec600a60"><li id="EN-US_TOPIC_0000001188589008__l6265bc2c4f9744d58bb06d03f4fe9d30"><strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_b63514415045">IF NOT EXISTS</strong><p id="EN-US_TOPIC_0000001188589008__a0c49b02eb99b4abca79677aa7eef5eec">Does not throw an error if a table with the same name already exists. A notice is issued in this case.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l20903b2b22b741bb839421d382d07c32"><a name="EN-US_TOPIC_0000001188589008__l20903b2b22b741bb839421d382d07c32"></a><a name="l20903b2b22b741bb839421d382d07c32"></a><strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_b571630315045">table_name</strong><p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p426590401511">Specifies the name of the foreign table to be created.</p>
<p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p23216071517">Value range: a string. It must comply with the naming convention.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l06b8baaf06ba44589e22b8c4f701c016"><a name="EN-US_TOPIC_0000001188589008__l06b8baaf06ba44589e22b8c4f701c016"></a><a name="l06b8baaf06ba44589e22b8c4f701c016"></a><strong id="EN-US_TOPIC_0000001188589008__afafcd2f1e1e343e7a46216b346a6f168">column_name</strong><p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p259828231535">Specifies the name of a column in the foreign table.</p>
<p id="EN-US_TOPIC_0000001188589008__a8b2a1555649743419080d03c67407c92">Value range: a string. It must comply with the naming convention.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l6722985a800f446c8860743139d762e4"><a name="EN-US_TOPIC_0000001188589008__l6722985a800f446c8860743139d762e4"></a><a name="l6722985a800f446c8860743139d762e4"></a><strong id="EN-US_TOPIC_0000001188589008__a1300bb29eab44e91938f77f09ec8b554">type_name</strong><p id="EN-US_TOPIC_0000001188589008__a347cb99cfbf048fe86b2c2e030aa1c61">Specifies the data type of the column.</p>
</li><li id="EN-US_TOPIC_0000001188589008__lff1cafcbc06f4ee885e5c9e7434353be"><strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_b643576415045">POSITION(offset,length)</strong><p id="EN-US_TOPIC_0000001188589008__af4f369eee4394654b963912910a2a5ca">Defining the location of each column in the data file in fixed length mode.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__n837d39216c014fce8aa01462424f5901"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__a3fadff08b7f640f9ae3a8662c4cd2dfe"><strong id="EN-US_TOPIC_0000001188589008__b842352706161436">offset</strong> is the start of the column in the source file, and <strong id="EN-US_TOPIC_0000001188589008__b842352706161448">length</strong> is the length of the column.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__aaf739ddace8a4106a9935750c62b88a9">Value range: <strong id="EN-US_TOPIC_0000001188589008__b84235270619197">offset</strong> must be greater than 0 bytes, and its unit is byte.</p>
<p id="EN-US_TOPIC_0000001188589008__a6542784f957642279a244ffa53399a65">The length of each record must be less than or equal to 1 GB. By default, columns not in the file are replaced with null.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l56e9c7be738d42448d9ea638e32fe05e"><a name="EN-US_TOPIC_0000001188589008__l56e9c7be738d42448d9ea638e32fe05e"></a><a name="l56e9c7be738d42448d9ea638e32fe05e"></a><strong id="EN-US_TOPIC_0000001188589008__a9a708756e8734a9c95a6520c8443ef2c">SERVER gsmpp_server</strong><p id="EN-US_TOPIC_0000001188589008__aae6c8af1c9ca44a2af12b83b3e3e167d">Specifies the server name of the foreign table. For the GDS foreign table, its server is created by initial database, which is <strong id="EN-US_TOPIC_0000001188589008__b84235270617221">gsmpp_server</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l2631a88728a14f43857bb4c04b2d9104"><a name="EN-US_TOPIC_0000001188589008__l2631a88728a14f43857bb4c04b2d9104"></a><a name="l2631a88728a14f43857bb4c04b2d9104"></a><strong id="EN-US_TOPIC_0000001188589008__a5585e94374a9445e8b7f2c3131d93f94">OPTIONS ( { option_name ' value ' } [, ...] )</strong><p id="EN-US_TOPIC_0000001188589008__a31d932e146cd483e8e0061eda6cc7459">Specifies all types of parameters of foreign table data.</p>
<ul id="EN-US_TOPIC_0000001188589008__u913b7c9dfc80421c8d900fbd5946c251"><li id="EN-US_TOPIC_0000001188589008__l6a4cdf99a0364e289119f03b114b8b62"><a name="EN-US_TOPIC_0000001188589008__l6a4cdf99a0364e289119f03b114b8b62"></a><a name="l6a4cdf99a0364e289119f03b114b8b62"></a>location<p id="EN-US_TOPIC_0000001188589008__acc1f2364866c48e4b4087fecdca67de0"><a name="EN-US_TOPIC_0000001188589008__l6a4cdf99a0364e289119f03b114b8b62"></a><a name="l6a4cdf99a0364e289119f03b114b8b62"></a>Specifies the data source location of the foreign table, which can be expressed through URLs. Separate URLs with vertical bars (|).</p>
<p id="EN-US_TOPIC_0000001188589008__p17890747135719">Currently, GDS can automatically create a directory defined by a foreign table during data export. For example, when the foreign table <strong id="EN-US_TOPIC_0000001188589008__b21702371344">location</strong> defines that <strong id="EN-US_TOPIC_0000001188589008__b6783104616344">gsfs:// 192.168.0.91:5000/2019/09</strong> executes an export task, if the <strong id="EN-US_TOPIC_0000001188589008__b2984125843411">2019/09</strong> subdirectory in the GDS data directory does not exist, the subdirectory is automatically created. You do not need to manually create the directory specified in the foreign table.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__nb65fdc83912e498d90c5847f15c2c817"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188589008__u5626772bb1294744aa79a8cec39a0e0a"><li id="EN-US_TOPIC_0000001188589008__la4cdd1d2ae7846ec8bd84fecb65f9824">For a read-only foreign table imported by GDS from a remote server in parallel, its URL must end with its corresponding schema or file name. (Read-only is the default file attribute.)<p id="EN-US_TOPIC_0000001188589008__ad3f1f19bd7494ab69f89121aa8b3bd4d"><a name="EN-US_TOPIC_0000001188589008__la4cdd1d2ae7846ec8bd84fecb65f9824"></a><a name="la4cdd1d2ae7846ec8bd84fecb65f9824"></a>For example: gsfs://192.168.0.90:5000/* or file:///data/data.txt or gsfs:// 192.168.0.90:5000/* | gsfs:// 192.168.0.91:5000/*.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l871db016b1bf4427aa2001bc14f776ac">For a writable foreign table used for GDS to export data to a remote server in parallel, file names are not required in URLs. If the data source location is a remote URL, for example, <strong id="EN-US_TOPIC_0000001188589008__b16317438155214">gsfs:// 192.168.0.90:5000/</strong>, multiple data sources can be specified. If the number of exported data file locations is less than or equal to the number of DNs, when you use the foreign table for export, data is evenly distributed to each data source location. If the number of exported data file locations is greater than the number of DNs, when you export data, the data is evenly distributed to data source locations corresponding to the DNs. Blank data files are created on the excess data source locations.</li><li id="EN-US_TOPIC_0000001188589008__l561d98aa0d584d7681b13df7b664e014">For a foreign table used for GDS to import data from a remote server in parallel, the number of URLs must be less than the number of DNs, and URLs containing the same location cannot be used.</li><li id="EN-US_TOPIC_0000001188589008__l000a67d67b91470ca5ddb1a854df5439">If the URL begins with <strong id="EN-US_TOPIC_0000001188589008__b1466611415581">gsfss://</strong>, data is imported and exported in encryption mode, and DOP cannot exceed 10.</li><li id="EN-US_TOPIC_0000001188589008__li11248152093917">During GDS export, the <strong id="EN-US_TOPIC_0000001188589008__b2481112019350">2019/09</strong> subdirectory in the <strong id="EN-US_TOPIC_0000001188589008__b1594212257354">gsfs://127.0.0.1:7789/2019/09/</strong> directory specified by the <strong id="EN-US_TOPIC_0000001188589008__b14797114263516">location</strong> table is automatically created.</li><li id="EN-US_TOPIC_0000001188589008__li37779498387">If <strong id="EN-US_TOPIC_0000001188589008__b14409252311">file_type</strong> is set to <strong id="EN-US_TOPIC_0000001188589008__b38141857933">pipe</strong>, GDS determines whether the target file to be imported or exported is a pipe file or a directory based on whether the last character in the URL is a slash (/). Example:<ul id="EN-US_TOPIC_0000001188589008__ul12124174182010"><li id="EN-US_TOPIC_0000001188589008__li483531132018">In <strong id="EN-US_TOPIC_0000001188589008__b1932513261476">gsfs://192.168.0.90:5000/a/b</strong>, GDS identifies <strong id="EN-US_TOPIC_0000001188589008__b155991333671">b</strong> as a pipe file.</li><li id="EN-US_TOPIC_0000001188589008__li0860161172019">In <strong id="EN-US_TOPIC_0000001188589008__b119840110820">gsfs://192.168.0.90:5000/a/b/</strong>, GDS identifies <strong id="EN-US_TOPIC_0000001188589008__b113831576819">b</strong> as a directory and creates a pipe file in the directory.</li></ul>
</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__l251896c64542407a912f06640ef49f5a"><a name="EN-US_TOPIC_0000001188589008__l251896c64542407a912f06640ef49f5a"></a><a name="l251896c64542407a912f06640ef49f5a"></a>format<p id="EN-US_TOPIC_0000001188589008__a2c0315ab604743fb987ef3aed304b470"><a name="EN-US_TOPIC_0000001188589008__l251896c64542407a912f06640ef49f5a"></a><a name="l251896c64542407a912f06640ef49f5a"></a>Specifies the format of the data source file in a foreign table.</p>
<p id="EN-US_TOPIC_0000001188589008__af95757c92e764037b24fa7e5172471c4">Value range: <strong id="EN-US_TOPIC_0000001188589008__b17621940122016">CSV</strong>, <strong id="EN-US_TOPIC_0000001188589008__b1618184542017">TEXT</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b1241183413201">TEXT</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__u4bb492a3219e46bcb0187f8bba88a23f"><li id="EN-US_TOPIC_0000001188589008__l0fbe3a71ff1f4c10a20abafded1951de">In CSV files, escape sequences are processed as common strings. Therefore, linefeeds are processed as data.</li><li id="EN-US_TOPIC_0000001188589008__l48b17bf525764dc7a3e5fd1b09e91981">In TEXT files, escape sequences are processed as they are. Therefore, linefeeds are not processed as data.</li><li id="EN-US_TOPIC_0000001188589008__laedbe49f07a640739b2511e8d64a0f3e">The FIXED file can process newline characters in data columns efficiently, but cannot process special characters very well.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001188589008__n16d5daf7930447d092fd19679002878b"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188589008__ul17550121520328"><li id="EN-US_TOPIC_0000001188589008__li126483241912">An escape sequence is a string starting with a backslash (\), including <strong id="EN-US_TOPIC_0000001188589008__b179487562811">\b</strong> (backspace), <strong id="EN-US_TOPIC_0000001188589008__b5949115152813">\f</strong> (formfeed page break), <strong id="EN-US_TOPIC_0000001188589008__b49494514288">\n</strong> (new line), <strong id="EN-US_TOPIC_0000001188589008__b18950755287">\r</strong> (carriage return), <strong id="EN-US_TOPIC_0000001188589008__b159507513286">\t</strong> (horizontal tab), \v (vertical tab), <strong id="EN-US_TOPIC_0000001188589008__b17951115102817">\</strong><em id="EN-US_TOPIC_0000001188589008__i199521592817">number</em> (octal number), and <strong id="EN-US_TOPIC_0000001188589008__b295225172818">\x</strong><em id="EN-US_TOPIC_0000001188589008__i169531852282">number</em> (hexadecimal number). In TEXT files, strings are processed as they are. In files of other formats, strings are processed as data.</li><li id="EN-US_TOPIC_0000001188589008__li1966713519327"><strong id="EN-US_TOPIC_0000001188589008__b146133321281">FIXED</strong> is defined as follows: (<strong id="EN-US_TOPIC_0000001188589008__b983393412815">POSITION</strong> must be specified for each column when <strong id="EN-US_TOPIC_0000001188589008__b083413346286">FIXED</strong> is used.)<ol id="EN-US_TOPIC_0000001188589008__ol15469720193316"><li id="EN-US_TOPIC_0000001188589008__li1446910201335">The column length of each record is the same.</li><li id="EN-US_TOPIC_0000001188589008__li144693202333">Spaces are used for column padding. Left padding is used for the numeric type and right padding is used for the char type.</li><li id="EN-US_TOPIC_0000001188589008__li1746962003314">No delimiters are used between columns.</li></ol>
</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__l4509784974094c3a8e2e196463bba140"><a name="EN-US_TOPIC_0000001188589008__l4509784974094c3a8e2e196463bba140"></a><a name="l4509784974094c3a8e2e196463bba140"></a>header<p id="EN-US_TOPIC_0000001188589008__a3ad9e69a6fe74123b9ae19a9ff1ae532"><a name="EN-US_TOPIC_0000001188589008__l4509784974094c3a8e2e196463bba140"></a><a name="l4509784974094c3a8e2e196463bba140"></a>Specifies whether a data file contains a table header. header is available only for CSV and FIXED files.</p>
<p id="EN-US_TOPIC_0000001188589008__aab9f48fe3cdf46f9912f494b98ee8d3e">When data is imported, if <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058965600_b842352706145433_1">header</strong> is <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058965600_b842352706101629_1">on</strong>, the first row of the data file will be identified as title row and ignored. If header is <strong id="EN-US_TOPIC_0000001188589008__b224724312533">off</strong>, the first row is identified as data.</p>
<p id="EN-US_TOPIC_0000001188589008__a427a67f8aa9d4a4ba5a5f2502927abc7">When data is exported, if <strong id="EN-US_TOPIC_0000001188589008__b207981346115319">header</strong> is <strong id="EN-US_TOPIC_0000001188589008__b13803446115312">on</strong>, <a href="#EN-US_TOPIC_0000001188589008__l233844e8314043318e05730e92485ab7">fileheader</a> must be specified. <strong id="EN-US_TOPIC_0000001188589008__b14617185335312">fileheader</strong> is used to specify the export header file format. If header is <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058965600_b842352706152947">off</strong>, the exported file does not include a title row.</p>
<p id="EN-US_TOPIC_0000001188589008__ab82c0bf59d5e438b9ebcb1c5529cad01">Value range: <strong id="EN-US_TOPIC_0000001188589008__b842352706174916">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b84235270616240">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b8423527061633">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b842352706174924">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b842352706164830">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b84235270616558">off</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l233844e8314043318e05730e92485ab7"><a name="EN-US_TOPIC_0000001188589008__l233844e8314043318e05730e92485ab7"></a><a name="l233844e8314043318e05730e92485ab7"></a>fileheader<p id="EN-US_TOPIC_0000001188589008__ac41a2be66ffa480d87849323dbf87f5b"><a name="EN-US_TOPIC_0000001188589008__l233844e8314043318e05730e92485ab7"></a><a name="l233844e8314043318e05730e92485ab7"></a>Specifies a file that defines the content in the header for exported data. The file contains one row of data description of each column.</p>
<p id="EN-US_TOPIC_0000001188589008__p890275583917">For example, to add a header in a file containing product information, define the file as follows:</p>
<p id="EN-US_TOPIC_0000001188589008__p11902135519398">The information of products.\n</p>
<div class="notice" id="EN-US_TOPIC_0000001188589008__n400bf167e45d4c81ba1cea807c6961fe"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188589008__u84738526d34a4aa9919f17d19c8e0c43"><li id="EN-US_TOPIC_0000001188589008__li17122137154217">This parameter is available only when <strong id="EN-US_TOPIC_0000001188589008__b187583404392">header</strong> is <strong id="EN-US_TOPIC_0000001188589008__b127582404394">on</strong> or <strong id="EN-US_TOPIC_0000001188589008__b375919401397">true</strong>. The file must be prepared in advance.</li><li id="EN-US_TOPIC_0000001188589008__l5108b6d1f076407d96f111d1f902ccf9">In Remote mode, the definition file must be put to the working directory of GDS (the <strong id="EN-US_TOPIC_0000001188589008__b1191307824145713">-d</strong> directory specified when starting the GDS).</li><li id="EN-US_TOPIC_0000001188589008__l7eca96f8befa4ec09b7086bf4b2c1c3d">The definition file can contain only one row of title information, and end with a newline character. Excess rows will be discarded. (Title information cannot contain newline character).</li><li id="EN-US_TOPIC_0000001188589008__le4354908f7e942e8a1a216ee0fd8f909">The length of the definition file including the newline character cannot exceed 1 MB.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__li02461414114117"><a name="EN-US_TOPIC_0000001188589008__li02461414114117"></a><a name="li02461414114117"></a>out_filename_prefix<p id="EN-US_TOPIC_0000001188589008__p6250414184112"><a name="EN-US_TOPIC_0000001188589008__li02461414114117"></a><a name="li02461414114117"></a>Specifies the name prefix of the exported data file exported using GDS from a write-only foreign table.</p>
<p id="EN-US_TOPIC_0000001188589008__p209171898243">If <strong id="EN-US_TOPIC_0000001188589008__b1477213344441">file_type</strong> is set to <strong id="EN-US_TOPIC_0000001188589008__b10932441114414">pipe</strong>, the pipe file <strong id="EN-US_TOPIC_0000001188589008__b6908205210446">dbName_schemaName_foreignTableName.pipe</strong> is generated.</p>
<p id="EN-US_TOPIC_0000001188589008__p239618396476">If both <strong id="EN-US_TOPIC_0000001188589008__b2522210121116">out_filename_prefix</strong> and <strong id="EN-US_TOPIC_0000001188589008__b125281723141117">location</strong> specify a pipe name, the pipe name specified in <strong id="EN-US_TOPIC_0000001188589008__b10425152951111">location</strong> is used.</p>
<div class="notice" id="EN-US_TOPIC_0000001188589008__note142513144412"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188589008__ul14253914174116"><li id="EN-US_TOPIC_0000001188589008__li122541148410">The prefix of the specified file name must be valid and compliant with the restrictions of the file system in the physical environment where the GDS is deployed. Otherwise, the file will fail to be created.<ul id="EN-US_TOPIC_0000001188589008__ul16126124117441"><li id="EN-US_TOPIC_0000001188589008__li125394403442">The file name prefix can contain only lowercase letters, uppercase letters, digits, and underscores (_).</li><li id="EN-US_TOPIC_0000001188589008__li875863924716">The prefix of the specified export file name cannot contain feature fields reserved for the Windows and Linux OS, including but not limited to:<p id="EN-US_TOPIC_0000001188589008__p1112414471474"><a name="EN-US_TOPIC_0000001188589008__li875863924716"></a><a name="li875863924716"></a>"con","aux","nul","prn","com0","com1","com2","com3","com4","com5","com6","com7","com8","com9","lpt0","lpt1","lpt2","lpt3","lpt4","lpt5","lpt6","lpt7","lpt8","lpt9"</p>
</li><li id="EN-US_TOPIC_0000001188589008__li625144054510">The total length of the absolute path consisting of the exported file prefix, the path specified by <strong id="EN-US_TOPIC_0000001188589008__b842352706211339">GDS d</strong>, <strong id="EN-US_TOPIC_0000001188589008__b842352706211352">.dat</strong>, or <strong id="EN-US_TOPIC_0000001188589008__b5606639194615">.pipe</strong> should be as required by the file system where GDS is deployed.</li><li id="EN-US_TOPIC_0000001188589008__li629917834611">It is required that the prefix can be correctly parsed and identified by the receiver (including but not limited to the original database where it was exported) of the data file. Identify and modify the option that causes the file name resolution problem (if any).</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__li10337147193016">To concurrently perform export jobs, do not use the same file name prefix for them. Otherwise, the exported files may overwrite each other or be lost in the OS or file system.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li99825131592"><a name="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li99825131592"></a><a name="en-us_topic_0059778310_li99825131592"></a>delimiter<p id="EN-US_TOPIC_0000001188589008__abb97d60448a640f292832b07ee6581f3"><a name="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li99825131592"></a><a name="en-us_topic_0059778310_li99825131592"></a>Specifies the column delimiter of data, and uses the default delimiter if it is not set. The default delimiter of TEXT is a tab and that of CSV is a comma (,). No delimiter is used in FIXED format.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__nf96af8e2050445adb17bc9cbc2da8dbc"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188589008__ub618dbe3999e4f80bfc5d8903d251c73"><li id="EN-US_TOPIC_0000001188589008__l5092da06491e4b91ab15f303c6187bef">A delimiter cannot be \r or \n.</li><li id="EN-US_TOPIC_0000001188589008__l5689a574ec8c4425ac605a52c6503f7f">A delimiter cannot be the same as the <strong id="EN-US_TOPIC_0000001188589008__b8423527061885">null</strong> value. The delimiter of CSV cannot be same as the <strong id="EN-US_TOPIC_0000001188589008__b84235270618821">quote</strong> value.</li><li id="EN-US_TOPIC_0000001188589008__l03cd232e1cf3401fbdeb760d2e9dfa1b">The delimiter for the TEXT format data cannot contain any of the following characters: \.abcdefghijklmnopqrstuvwxyz0123456789.</li><li id="EN-US_TOPIC_0000001188589008__lf75fbc26d20c4b5f945905a26d0dfba5">The data length of a single row should be less than 1 GB. If the delimiters are too long and there are too many rows, the length of valid data will be affected.</li><li id="EN-US_TOPIC_0000001188589008__ldcc2a31d99094332a647dea11c83b400">You are advised to use a multi-character, such as the combination of the dollar sign ($), caret (^), the ampersand (&amp;), or invisible characters, such as 0x07, 0x08, and 0x1b as the delimiter.</li><li id="EN-US_TOPIC_0000001188589008__li10607415145114">For a multi-character delimiter, do not use the same characters, for example, <strong id="EN-US_TOPIC_0000001188589008__b227354144510">---</strong>.</li></ul>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__a352b057b7bef4fabaa5e548748ea340f">Valid value:</p>
<p id="EN-US_TOPIC_0000001188589008__a45aa25a8fe7744dbb1c035ecb8f352fb">The value of <strong id="EN-US_TOPIC_0000001188589008__b84235270618738">delimiter</strong> can be a multi-character delimiter whose length is less than or equal to 10 bytes.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l97b17ee10c314710a461ba967e9d0b8c"><a name="EN-US_TOPIC_0000001188589008__l97b17ee10c314710a461ba967e9d0b8c"></a><a name="l97b17ee10c314710a461ba967e9d0b8c"></a>quote<p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p647746152656"><a name="EN-US_TOPIC_0000001188589008__l97b17ee10c314710a461ba967e9d0b8c"></a><a name="l97b17ee10c314710a461ba967e9d0b8c"></a>Specifies which characters in a CSV source data file will be identified as quotation marks. The default value is a double quotation mark (").</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__nfc59741a634245cd9f3dd24097a8777f"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188589008__u8dc0f2831a1a45f19187c2ff0dc7ea8d"><li id="EN-US_TOPIC_0000001188589008__l21c38dc7ab4240fc8d2ec03c05ad3e9d">The quote parameter cannot be the same as the delimiter or null parameter.</li><li id="EN-US_TOPIC_0000001188589008__l19e70e2be4484d5ca4edccad253dfa87">The <strong id="EN-US_TOPIC_0000001188589008__b84235270614567">quote</strong> parameter must be a single-byte character.</li><li id="EN-US_TOPIC_0000001188589008__l4182507d6e6e4d99b4f18733c248cb0a">Invisible characters are recommended as <strong id="EN-US_TOPIC_0000001188589008__b193398281611139">quote</strong> values, such as 0x07, 0x08, and 0x1b.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li74427391592"><a name="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li74427391592"></a><a name="en-us_topic_0059778310_li74427391592"></a>escape<p id="EN-US_TOPIC_0000001188589008__ab88b82d3de25414f864fb5396df185f5"><a name="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li74427391592"></a><a name="en-us_topic_0059778310_li74427391592"></a>Specifies which characters in a CSV source data file are escape characters. Escape characters can only be single-byte characters.</p>
<p id="EN-US_TOPIC_0000001188589008__a311e59465ebb4d06922a793d92efcf21">Default value: the same as the value of QUOTE</p>
</li><li id="EN-US_TOPIC_0000001188589008__l23f5b49658fe4a77b126c30aee563507"><a name="EN-US_TOPIC_0000001188589008__l23f5b49658fe4a77b126c30aee563507"></a><a name="l23f5b49658fe4a77b126c30aee563507"></a>null<div class="p" id="EN-US_TOPIC_0000001188589008__ab91fe36ae27a492990169b276ca9d19e"><a name="EN-US_TOPIC_0000001188589008__l23f5b49658fe4a77b126c30aee563507"></a><a name="l23f5b49658fe4a77b126c30aee563507"></a>Specifies the string that represents a null value.<div class="note" id="EN-US_TOPIC_0000001188589008__n98805631e263478db49afc9e4133082d"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188589008__ud3ea70521bc846eea88c83f40a9a3bc3"><li id="EN-US_TOPIC_0000001188589008__l91d2f11257e44baf936659a848c01769">The null value cannot be \r or \n. The maximum length is 100 characters.</li><li id="EN-US_TOPIC_0000001188589008__l7b02e83353ee40cfa7ff0e5aaaebfa69">The <strong id="EN-US_TOPIC_0000001188589008__b84235270618146">null</strong> value cannot be the same as the delimiter or <strong id="EN-US_TOPIC_0000001188589008__b842352706181413">quote</strong> parameter.</li></ul>
</div></div>
</div>
<p id="EN-US_TOPIC_0000001188589008__ade34c8e1132e409cb53722bb693acc2e">Valid value:</p>
<ul id="EN-US_TOPIC_0000001188589008__ubddc107d3fcf44f8ab80bcf04d5f3f50"><li id="EN-US_TOPIC_0000001188589008__l8740efca3cfd429ab563fd0065296828">The default value is <strong id="EN-US_TOPIC_0000001188589008__b94972589482">\n</strong> for the TEXT format.</li><li id="EN-US_TOPIC_0000001188589008__l11441db5d16d44619a1d9cc004711035">The default value for the CSV format is an empty string without quotation marks.</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__ldb9cda16bf2849678b91826adb3b4c96"><a name="EN-US_TOPIC_0000001188589008__ldb9cda16bf2849678b91826adb3b4c96"></a><a name="ldb9cda16bf2849678b91826adb3b4c96"></a>noescaping<p id="EN-US_TOPIC_0000001188589008__aee3bfcaed7dc47b0bc1900e467c2e82b"><a name="EN-US_TOPIC_0000001188589008__ldb9cda16bf2849678b91826adb3b4c96"></a><a name="ldb9cda16bf2849678b91826adb3b4c96"></a>Specifies in TEXT format, whether to escape the backslash (\) and its following characters.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__n74f15869f29641b3938e2c9bf33f7311"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__a40ca2ca4be484a3dab8bb768e34b2912"><strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b8423527069341">noescaping</strong> is available only for the TEXT format.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__a3fed836460b648e18a5d8b8ac7768254">Value range: <strong id="EN-US_TOPIC_0000001188589008__b1749676061">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b599310586">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b256341225">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b1362191347">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b620670293">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b143978987">off</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l88460d19d60945e99eccf5f6429762b7"><a name="EN-US_TOPIC_0000001188589008__l88460d19d60945e99eccf5f6429762b7"></a><a name="l88460d19d60945e99eccf5f6429762b7"></a>encoding<p id="EN-US_TOPIC_0000001188589008__a9844ff8059c34e8287f4f6c39c80f0f3"><a name="EN-US_TOPIC_0000001188589008__l88460d19d60945e99eccf5f6429762b7"></a><a name="l88460d19d60945e99eccf5f6429762b7"></a>Specifies the encoding of a data file, that is, the encoding used to parse, check, and generate a data file. Its default value is the default <strong id="EN-US_TOPIC_0000001188589008__b84235270612476">client_encoding</strong> value of the current database.</p>
<p id="EN-US_TOPIC_0000001188589008__a19e3cb1c2f41414181cfd61376344b4d">Before you import foreign tables, it is recommended that you set <strong id="EN-US_TOPIC_0000001188589008__b24975262297">client_encoding</strong> to the file encoding format, or a format matching the character set of the file. Otherwise, unnecessary parsing and check errors may occur, leading to import errors, rollback, or even invalid data import. Before you import foreign tables, you are also advised to specify this parameter, because the export result using the default character set may not be what you expected.</p>
<p id="EN-US_TOPIC_0000001188589008__a2307d5d7d4994a6aaa146181b8eb6cd9">If this parameter is not specified when you create a foreign table, a warning message will be displayed on the client.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__n1b4551e33831420f9b9cf6acc22847ae"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p42011271298">Currently, GDS cannot parse or write in a file using multiple encoding formats during foreign table import or export.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__l4217c10dcb944cc3a68346ad11014331"><a name="EN-US_TOPIC_0000001188589008__l4217c10dcb944cc3a68346ad11014331"></a><a name="l4217c10dcb944cc3a68346ad11014331"></a>fill_missing_fields<p id="EN-US_TOPIC_0000001188589008__a31acb0f9baa14f88bb7d6bb90da8960f"><a name="EN-US_TOPIC_0000001188589008__l4217c10dcb944cc3a68346ad11014331"></a><a name="l4217c10dcb944cc3a68346ad11014331"></a>Specifies whether to generate an error message when the last column in a row in the source file is lost during data import.</p>
<p id="EN-US_TOPIC_0000001188589008__ac40d46180fe94fcfb1025f8ecef31faf">Value range: <strong id="EN-US_TOPIC_0000001188589008__b2124569306">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b204685777">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b116670850">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b12396473">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b729024091">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b1745706917">off</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__udd9a858112d14944bbab71dd1956f14d"><li id="EN-US_TOPIC_0000001188589008__l7b1522bbf0d74cedb6a2e825bf2acf05">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b81583471212">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b10159247821">on</strong> and the last column of a data row in a data source file is lost, the column will be replaced with <strong id="EN-US_TOPIC_0000001188589008__b1160104714216">NULL</strong> and no error message will be generated.</li><li id="EN-US_TOPIC_0000001188589008__l41d3b0a290fc4cd3b4a6b745d80d2f58">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b842352706152317">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b842352706172415">off</strong> and the last column is missing, the following error information will be displayed:<pre class="screen" id="EN-US_TOPIC_0000001188589008__s8d72e1f22ff7490ca9812c58c3f51d16">missing data for column "tt"</pre>
</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__l6a63450436114055b9ea51a0174a1886"><a name="EN-US_TOPIC_0000001188589008__l6a63450436114055b9ea51a0174a1886"></a><a name="l6a63450436114055b9ea51a0174a1886"></a>ignore_extra_data<p id="EN-US_TOPIC_0000001188589008__a5b7b34e1f0ba4efabe5b105e9d33e72c"><a name="EN-US_TOPIC_0000001188589008__l6a63450436114055b9ea51a0174a1886"></a><a name="l6a63450436114055b9ea51a0174a1886"></a>Specifies whether to ignore excessive columns when the number of data source files exceeds the number of foreign table columns. This parameter is available during data import.</p>
<p id="EN-US_TOPIC_0000001188589008__a88a05907165c497688e7a79774626883">Value range: <strong id="EN-US_TOPIC_0000001188589008__b986928523">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b2144722551">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b820172755">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b1830826378">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b44430655">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b273887424">off</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__ua4aca6dd0fe04eddb5203afe8419fa07"><li id="EN-US_TOPIC_0000001188589008__lb7620f1a1cec45b19d5bfb2b86fa1050">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b84235270617123">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b842352706171516">on</strong> and the number of data source files exceeds the number of foreign table columns, excessive columns will be ignored.</li><li id="EN-US_TOPIC_0000001188589008__l1b1b3e3e63054f7a919194ff3f048507">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b84235270617130">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b842352706182758">off</strong> and the number of data source files exceeds the number of foreign table columns, the following error information will be displayed:<pre class="screen" id="EN-US_TOPIC_0000001188589008__s827035191beb4bffbfe333a3c41a827f">extra data after last expected column</pre>
</li></ul>
<div class="notice" id="EN-US_TOPIC_0000001188589008__n6280f8af19974a25bbc48421ebe41001"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589008__adf3fc38fd9c746f3aa3b7c28987a2a29">If the newline character at the end of the row is lost, setting the parameter to <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b842352706155739">true</strong> will ignore data in the next row.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__lff1a3b7e86664932b1bb2f44bb740455"><a name="EN-US_TOPIC_0000001188589008__lff1a3b7e86664932b1bb2f44bb740455"></a><a name="lff1a3b7e86664932b1bb2f44bb740455"></a>reject_limit<p id="EN-US_TOPIC_0000001188589008__a5193ed25d11c495c997bdd4739ac9b56"><a name="EN-US_TOPIC_0000001188589008__lff1a3b7e86664932b1bb2f44bb740455"></a><a name="lff1a3b7e86664932b1bb2f44bb740455"></a>Specifies the maximum number of data format errors allowed during a data import task. If the number of errors does not reach the maximum number, the data import task can still be executed.</p>
<div class="notice" id="EN-US_TOPIC_0000001188589008__na569244f8e864de2859f71b7437de9c7"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589008__a6b3ce4efd30141488df7a2105aa5cf1f">You are advised to replace this syntax with <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b842352706172449">PER NODE REJECT LIMIT 'value'</strong>.</p>
<p id="EN-US_TOPIC_0000001188589008__a4053dec24f5346b0b0f14c4a248963ee">Examples of data format errors include the following: a column is lost, an extra column exists, a data type is incorrect, and encoding is incorrect. Once a non-data format error occurs, the whole data import process is stopped.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__a643fff5d193849b6a197170c49b27f2b">Value range: a positive integer or <strong id="EN-US_TOPIC_0000001188589008__b842352706153634">unlimited</strong></p>
<p id="EN-US_TOPIC_0000001188589008__ad6622046d7934adcaebbd4abafe7d4c5">If this parameter is not specified, an error message is returned immediately.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__note63792038171051"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__p37257431171051">Enclose positive integer values with single quotation marks ('').</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__l2c67e08f1cc14a198cf025f1129b8208">mode<p id="EN-US_TOPIC_0000001188589008__a4850d93e1e9146bdb3d779e3d30533e9"><a name="EN-US_TOPIC_0000001188589008__l2c67e08f1cc14a198cf025f1129b8208"></a><a name="l2c67e08f1cc14a198cf025f1129b8208"></a>Specifies the data import policy during a specific data import process. <span id="EN-US_TOPIC_0000001188589008__text1356670670">GaussDB(DWS)</span> supports only the <strong id="EN-US_TOPIC_0000001188589008__b897442416916">Normal</strong> mode.</p>
<p id="EN-US_TOPIC_0000001188589008__a11956049414c4f038611eb01f8cf2938">Valid value:</p>
<ul id="EN-US_TOPIC_0000001188589008__ubb03696363c040e1980e94be961464f8"><li id="EN-US_TOPIC_0000001188589008__lf36bc5abcfa44ebc836c6ebcce0ddf6d"><strong id="EN-US_TOPIC_0000001188589008__b842352706135444">Normal</strong> (default): supports all file types (CSV, TEXT, FIXED). Enabling Gauss data service to help data import.</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li62201592"><a name="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li62201592"></a><a name="en-us_topic_0059778310_li62201592"></a>eol<p id="EN-US_TOPIC_0000001188589008__ac972f10899ca443c8019167639eb78ea"><a name="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_li62201592"></a><a name="en-us_topic_0059778310_li62201592"></a>Specifies the newline character style of the imported or exported data file.</p>
<p id="EN-US_TOPIC_0000001188589008__a1b0c62fd2c5b48c8846081c1cc472715">Value range: multi-character newline characters within 10 bytes. Common newline characters include <strong id="EN-US_TOPIC_0000001188589008__b742813910818">\r</strong> (0x0D), <strong id="EN-US_TOPIC_0000001188589008__b144287391581">\n</strong> (0x0A), and <strong id="EN-US_TOPIC_0000001188589008__b1742815392811">\r\n</strong> (0x0D0A). Special newline characters include <strong id="EN-US_TOPIC_0000001188589008__b24308393814">$</strong> and <strong id="EN-US_TOPIC_0000001188589008__b15430103920817">#</strong>.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__note4822103112229"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188589008__ul13825143117221"><li id="EN-US_TOPIC_0000001188589008__li8771574226">The <strong id="EN-US_TOPIC_0000001188589008__b1689318226248">eol</strong> parameter supports only the TEXT format for data import and export and does not support the CSV or FIXED format for data import. For forward compatibility, the <strong id="EN-US_TOPIC_0000001188589008__b105791814514">eol</strong> parameter can be set to <strong id="EN-US_TOPIC_0000001188589008__b18161857161618">0x0D</strong> or <strong id="EN-US_TOPIC_0000001188589008__b208171557111613">0x0D0A</strong> for data export in the CSV and FIXED formats.</li><li id="EN-US_TOPIC_0000001188589008__li47725710222">The value of the <strong id="EN-US_TOPIC_0000001188589008__b86952235012">eol</strong> parameter cannot be the same as that of <strong id="EN-US_TOPIC_0000001188589008__b3757824105313">DELIMITER</strong> or <strong id="EN-US_TOPIC_0000001188589008__b19759152418535">NULL</strong>.</li><li id="EN-US_TOPIC_0000001188589008__li1777105742214">The value of the <strong id="EN-US_TOPIC_0000001188589008__b1322531250">eol</strong> parameter cannot contain digits, letters, or periods (.).</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__li718215784217"><a name="EN-US_TOPIC_0000001188589008__li718215784217"></a><a name="li718215784217"></a>conflict_delimiter<p id="EN-US_TOPIC_0000001188589008__p1285215176422"><a name="EN-US_TOPIC_0000001188589008__li718215784217"></a><a name="li718215784217"></a>This parameter is generally used with the <a href="#EN-US_TOPIC_0000001188589008__l1355aef8984145488d8b1e213302bf55">compatible_illegal_chars</a> parameter. If a data file contains a truncated Chinese character, the truncated character and a delimiter will be encoded into another Chinese character due to inconsistent encoding between the foreign table and the database. As a result, the delimiter is masked and an error will be reported, indicating that there are missing fields.</p>
<p id="EN-US_TOPIC_0000001188589008__p97961341154717">This parameter is used to avoid encoding a truncated character and a delimiter into another character.</p>
<p id="EN-US_TOPIC_0000001188589008__p441155205019">Value range: <strong id="EN-US_TOPIC_0000001188589008__b7349639165412">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b6354153914542">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b1035516392549">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b153551391544">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b12740191711557">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b107451617105517">off</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__ul0747831185115"><li id="EN-US_TOPIC_0000001188589008__li1174783145112">If the parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b16388102215552">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b17393132217555">on</strong>, encoding a truncated character and a delimiter into another character is allowed.</li><li id="EN-US_TOPIC_0000001188589008__li2747123119515">If the parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b11940132155510">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b19945173215559">off</strong>, encoding a truncated character and a delimiter into another character is not allowed.</li></ul>
<div class="notice" id="EN-US_TOPIC_0000001188589008__note3797114225316"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589008__p187971442185315">This parameter is disabled by default. It is recommended that you disable this parameter, because encoding a truncated character and a delimiter into another character is rarely required. If the parameter is enabled, the scenario may be incorrectly identified and thereby causing incorrect information imported to the table.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__li148341029172620"><a name="EN-US_TOPIC_0000001188589008__li148341029172620"></a><a name="li148341029172620"></a>file_type<p id="EN-US_TOPIC_0000001188589008__p118348299261"><a name="EN-US_TOPIC_0000001188589008__li148341029172620"></a><a name="li148341029172620"></a>Specifies the type of the file to be imported or exported.</p>
<p id="EN-US_TOPIC_0000001188589008__p4938120155215">Value options: <strong id="EN-US_TOPIC_0000001188589008__b178811938191211">normal</strong>, <strong id="EN-US_TOPIC_0000001188589008__b788633819129">pipe</strong>. <strong id="EN-US_TOPIC_0000001188589008__b1574274215120">normal</strong> is the default value.</p>
<ul id="EN-US_TOPIC_0000001188589008__ul13834152914266"><li id="EN-US_TOPIC_0000001188589008__li16834112922616">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b5611144511218">normal</strong>, the file to be imported or exported is a common file.</li><li id="EN-US_TOPIC_0000001188589008__li58341329132620">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b17160151141215">pipe</strong>, the file to be imported or exported is a named pipe.</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__li1155623884317"><a name="EN-US_TOPIC_0000001188589008__li1155623884317"></a><a name="li1155623884317"></a>file_sequence<p id="EN-US_TOPIC_0000001188589008__p135567381437"><a name="EN-US_TOPIC_0000001188589008__li1155623884317"></a><a name="li1155623884317"></a>Concurrently imports data in parallel through GDS foreign tables, to improve single-file import performance. This parameter is only used for data import.</p>
<p id="EN-US_TOPIC_0000001188589008__p14556113818434">The parameter format is <strong id="EN-US_TOPIC_0000001188589008__b1859073417165">file_sequence</strong>'<em id="EN-US_TOPIC_0000001188589008__i65916342167">total number of shards</em>-<em id="EN-US_TOPIC_0000001188589008__i1259114342169">current shard</em>'. Example:</p>
<p id="EN-US_TOPIC_0000001188589008__p85561838194314"><strong id="EN-US_TOPIC_0000001188589008__b390992215322">file_sequence '3-1'</strong> indicates that the imported file is logically split into three shards and the data currently imported by the foreign table is the data on the first shard.</p>
<p id="EN-US_TOPIC_0000001188589008__p16556203824315"><strong id="EN-US_TOPIC_0000001188589008__b553352710362">file_sequence '3-2'</strong> indicates that the imported file is logically split into three shards and the data currently imported by the foreign table is the data on the second shard.</p>
<p id="EN-US_TOPIC_0000001188589008__p145561538134313"><strong id="EN-US_TOPIC_0000001188589008__b96951346183617">file_sequence '3-3'</strong> indicates that the imported file is logically split into three shards and the data currently imported by the foreign table is the data on the third shard.</p>
<p id="EN-US_TOPIC_0000001188589008__p95561638154314">This parameter has the following constraints:</p>
<ul id="EN-US_TOPIC_0000001188589008__ul2557153814439"><li id="EN-US_TOPIC_0000001188589008__li20557193814437">A file can be split to a maximum of 8 shards.</li><li id="EN-US_TOPIC_0000001188589008__li1255783815437">The number of currently imported shard should be less than or equal to the total number of split shards.</li><li id="EN-US_TOPIC_0000001188589008__li65577388435">Only CSV and TXT files can be imported.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001188589008__note12557193814316"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__p115571138124318">When data is imported in parallel in CSV format, some shards fail to be imported in the following scenario because the CSV rules conflict with the GDS splitting logic:</p>
<p id="EN-US_TOPIC_0000001188589008__p10557938194315">Scenario: A CSV file contains a newline character that is not escaped, the newline character is contained in the character specified by <strong id="EN-US_TOPIC_0000001188589008__b1526274615419">quote</strong>, and the data of this line is in the first row of the logical shard.</p>
<p id="EN-US_TOPIC_0000001188589008__p1155823894310">For example, if you import the <strong id="EN-US_TOPIC_0000001188589008__b0424781422">big.csv</strong> file in parallel, the following information is displayed:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188589008__screen6558203854312">--id, username, address
10001,"customer1 name","Rose District"
10002,"customer2 name","
23 Road Rose
District NewCity"
10003,"customer3 name","NewCity"</pre>
<p id="EN-US_TOPIC_0000001188589008__p75589381437">After the file is split into two shards, the content of the first shard is as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188589008__screen115585387435">10001,"customer1 name","Rose District"
10002,"customer2 name","
23</pre>
<p id="EN-US_TOPIC_0000001188589008__p1155893818439">The content of the second shard is as follows:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188589008__screen18559838154314">Road Rose
District NewCity"
10003,"customer3 name","NewCity"</pre>
<p id="EN-US_TOPIC_0000001188589008__p1555993819433">The newline character after the first line of the second shard is contained between double quotation marks. As a result, GDS cannot determine whether the newline character is a newline character in the field or a separator in the line. Therefore, two data records on the first shard are successfully imported, but the second shard fails to be imported.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__li4151040112612"><a name="EN-US_TOPIC_0000001188589008__li4151040112612"></a><a name="li4151040112612"></a>auto_create_pipe<p id="EN-US_TOPIC_0000001188589008__p315184042618"><a name="EN-US_TOPIC_0000001188589008__li4151040112612"></a><a name="li4151040112612"></a>This parameter specifies whether the GDS process automatically creates a named pipe.</p>
<p id="EN-US_TOPIC_0000001188589008__p101534012266">Value options: <strong id="EN-US_TOPIC_0000001188589008__b692211814135">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b0927178131320">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b189275861312">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b17927128141316">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b3466312101312">true</strong>/<strong id="EN-US_TOPIC_0000001188589008__b10471171212136">on</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__ul1151140162617"><li id="EN-US_TOPIC_0000001188589008__li21524017263">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b1814412311820">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b121452351811">on</strong>, the GDS process is allowed to automatically create a named pipe.</li><li id="EN-US_TOPIC_0000001188589008__li191574092614">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b11124530181816">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b0125153051817">off</strong>, you need to manually create a named pipe.</li></ul>
<div class="notice" id="EN-US_TOPIC_0000001188589008__note1587864503416"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188589008__ul296320287199"><li id="EN-US_TOPIC_0000001188589008__li1963142815197">When setting <strong id="EN-US_TOPIC_0000001188589008__b27419361185">auto_create_pipe</strong>, set <strong id="EN-US_TOPIC_0000001188589008__b174643601815">file_type</strong> to <strong id="EN-US_TOPIC_0000001188589008__b1074613671814">pipe</strong>. Otherwise, the foreign table cannot be created.</li><li id="EN-US_TOPIC_0000001188589008__li196322810199">If <strong id="EN-US_TOPIC_0000001188589008__b96643419184">auto_create_pipe</strong> is set to <strong id="EN-US_TOPIC_0000001188589008__b1566964112184">false</strong> and no pipe is specified during data import and export, the <em id="EN-US_TOPIC_0000001188589008__i566924141810">database name</em>_<em id="EN-US_TOPIC_0000001188589008__i14669134118182">schema name</em>_<em id="EN-US_TOPIC_0000001188589008__i966916411186">foreign table name</em><strong id="EN-US_TOPIC_0000001188589008__b66708416184">.pipe</strong> file will be opened. If a pipe has been specified, the specified pipe in the location will be opened. If the named pipe is not written by other programs or is not opened in write mode within the period specified by the <strong id="EN-US_TOPIC_0000001188589008__b83551919121418">pipe-timeout</strong> parameter, an error message is displayed indicating that the import or export task times out. If the file is not a pipe, an error is reported when the import or export task is executed.</li><li id="EN-US_TOPIC_0000001188589008__li109631028141917">If <strong id="EN-US_TOPIC_0000001188589008__b18606954161813">auto_create_pipe</strong> is set to <strong id="EN-US_TOPIC_0000001188589008__b2611454121820">true</strong> and no pipe file is specified during data import and export, the <em id="EN-US_TOPIC_0000001188589008__i1961105414188">database name</em>_<em id="EN-US_TOPIC_0000001188589008__i17611354181818">schema name</em>_<em id="EN-US_TOPIC_0000001188589008__i1561245411189">foreign table name</em><strong id="EN-US_TOPIC_0000001188589008__b2612165410188">.pipe</strong> file will be opened. If the file is a common file, an error is reported when the file is imported or exported. If the file is a pipe, the system automatically deletes the file and re-creates the named pipe.</li><li id="EN-US_TOPIC_0000001188589008__li896413289198">You can use the <a href="#EN-US_TOPIC_0000001188589008__l6a4cdf99a0364e289119f03b114b8b62">location</a> parameter to specify the pipe when exporting data, for example, <strong id="EN-US_TOPIC_0000001188589008__b162763181919">location'gsfs://127.0.0.1:7789/aa.pipe</strong>. When <strong id="EN-US_TOPIC_0000001188589008__b13276141141915">auto_create_pipe</strong> is set to <strong id="EN-US_TOPIC_0000001188589008__b02769119191">true</strong>, GDS automatically creates the <strong id="EN-US_TOPIC_0000001188589008__b227619111193">aa.pipe</strong> file in the data directory.</li></ul>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__li20789241193611"><a name="EN-US_TOPIC_0000001188589008__li20789241193611"></a><a name="li20789241193611"></a>del_pipe<p id="EN-US_TOPIC_0000001188589008__p7312102403317"><a name="EN-US_TOPIC_0000001188589008__li20789241193611"></a><a name="li20789241193611"></a>This parameter specifies whether to automatically delete the pipe file after the import or export task is complete.</p>
<p id="EN-US_TOPIC_0000001188589008__p14045347375">Value options: <strong id="EN-US_TOPIC_0000001188589008__b108215504542">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b9822145025412">on</strong>; <strong id="EN-US_TOPIC_0000001188589008__b16822850185413">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b68224508541">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b178711155510">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b1583117555">on</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__ul19387656173815"><li id="EN-US_TOPIC_0000001188589008__li838813565384">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b11224334135516">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b112251834205514">on</strong>, the GDS process will automatically delete a named pipe file.</li><li id="EN-US_TOPIC_0000001188589008__li72226310398">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b193221338135616">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b15323123811567">off</strong>, the GDS process will not delete a named pipe file.</li></ul>
<div class="notice" id="EN-US_TOPIC_0000001188589008__note152534720391"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589008__p1252584743910">When setting <strong id="EN-US_TOPIC_0000001188589008__b1658867105714">del_pipe</strong>, set <strong id="EN-US_TOPIC_0000001188589008__b5589207185712">file_type</strong> to <strong id="EN-US_TOPIC_0000001188589008__b1659118714577">pipe</strong>. Otherwise, the foreign table cannot be created.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__l34050622afbb479f9fa28baad3df33d5">fix<p id="EN-US_TOPIC_0000001188589008__a15b171e903aa4252a2c5e6d8bfc43399"><a name="EN-US_TOPIC_0000001188589008__l34050622afbb479f9fa28baad3df33d5"></a><a name="l34050622afbb479f9fa28baad3df33d5"></a>Specifies the length of fixed format data. The unit is byte. This syntax is available only for READ ONLY foreign tables.</p>
<p id="EN-US_TOPIC_0000001188589008__ab8f06f69c98b47a08da6df0de9b8ea68">Value range: Less than <strong id="EN-US_TOPIC_0000001188589008__b842352706153032">1 GB</strong>, and greater than or equal to the total length specified by <strong id="EN-US_TOPIC_0000001188589008__b842352706153049">POSITION</strong> (The total length is the sum of <strong id="EN-US_TOPIC_0000001188589008__b842352706153120">offset</strong> and <strong id="EN-US_TOPIC_0000001188589008__b842352706153126">length</strong> in the last column of the table definition.)</p>
</li><li id="EN-US_TOPIC_0000001188589008__li595261833718">out_fix_alignment<p id="EN-US_TOPIC_0000001188589008__p1039919359396"><a name="EN-US_TOPIC_0000001188589008__li595261833718"></a><a name="li595261833718"></a>Specifies how the columns of the types BYTEAOID, CHAROID, NAMEOID, TEXTOID, BPCHAROID, VARCHAROID, NVARCHAR2OID, and CSTRINGOID are aligned during fixed-length export.</p>
<p id="EN-US_TOPIC_0000001188589008__p19571718103717">Value range: <strong id="EN-US_TOPIC_0000001188589008__b842352706155322">align_left</strong>, <strong id="EN-US_TOPIC_0000001188589008__b842352706155318">align_right</strong></p>
<p id="EN-US_TOPIC_0000001188589008__p186721844133916">Default value: <strong id="EN-US_TOPIC_0000001188589008__b842352706103226">align_right</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001188589008__note1233284665717"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589008__p4336546125717">The bytea data type must be in hexadecimal format (for example, \XXXX) or octal format (for example, \XXX\XXX\XXX). The data to be imported must be left-aligned (that is, the column data starts with either of the two formats instead of spaces). Therefore, if the exported file needs to be imported using a GDS foreign table and the file data length is less than that specified by the foreign table formatter, the exported file must be left aligned. Otherwise, an error is reported during the import.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__ldaa7bd53c7974286a205bc80453762ad">date_format<p id="EN-US_TOPIC_0000001188589008__a6ecaddd7df78470796edd8773879df6a"><a name="EN-US_TOPIC_0000001188589008__ldaa7bd53c7974286a205bc80453762ad"></a><a name="ldaa7bd53c7974286a205bc80453762ad"></a>Imports data of the DATE type. This syntax is available only for READ ONLY foreign tables.</p>
<p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p596841495210">Value range: any valid DATE value. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__n2ae322a0b1104a29bbe228fc4fe93bd5"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__a94fab4a790564777a700ab63d637d7b8">If ORACLE is specified as the compatible database, the DATE format is TIMESTAMP. For details, see <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058965600_b84235270617158">timestamp_format</strong> below.</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188589008__l00fa403aef5d42299f2af84f16d3b6cb">time_format<p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p612537510226"><a name="EN-US_TOPIC_0000001188589008__l00fa403aef5d42299f2af84f16d3b6cb"></a><a name="l00fa403aef5d42299f2af84f16d3b6cb"></a>Imports data of the TIME type. This syntax is available only for READ ONLY foreign tables.</p>
<p id="EN-US_TOPIC_0000001188589008__a703907b3cbf04e83a9541a31a3ae184f">Value range: any valid TIME value. Time zones cannot be used. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001188589008__lc8af1a8e713546a683d2250aa4023a56">timestamp_format<p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p678944610616"><a name="EN-US_TOPIC_0000001188589008__lc8af1a8e713546a683d2250aa4023a56"></a><a name="lc8af1a8e713546a683d2250aa4023a56"></a>Imports data of the TIMESTAMP type. This syntax is available only for READ ONLY foreign tables.</p>
<p id="EN-US_TOPIC_0000001188589008__a4ef04a24caaf4515b0e7eaef6139df24">Value range: any valid TIMESTAMP value. Time zones are not supported. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001188589008__lb5b21b8fb41f42f3bb91f1e8a2d7977a">smalldatetime_format<p id="EN-US_TOPIC_0000001188589008__a5d4b686db9bf4696a57286917e570209"><a name="EN-US_TOPIC_0000001188589008__lb5b21b8fb41f42f3bb91f1e8a2d7977a"></a><a name="lb5b21b8fb41f42f3bb91f1e8a2d7977a"></a>Imports data of the SMALLDATETIME type. This syntax is available only for READ ONLY foreign tables.</p>
<p id="EN-US_TOPIC_0000001188589008__a9403ae614bf040c4af6baedcc58a791d">Value range: any valid SMALLDATETIME value. For details, see <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a>.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l1355aef8984145488d8b1e213302bf55"><a name="EN-US_TOPIC_0000001188589008__l1355aef8984145488d8b1e213302bf55"></a><a name="l1355aef8984145488d8b1e213302bf55"></a>compatible_illegal_chars<p id="EN-US_TOPIC_0000001188589008__a41609239065d423ea4011787a049a501"><a name="EN-US_TOPIC_0000001188589008__l1355aef8984145488d8b1e213302bf55"></a><a name="l1355aef8984145488d8b1e213302bf55"></a>Enables or disables fault tolerance on invalid characters during data import. This syntax is available only for READ ONLY foreign tables.</p>
<p id="EN-US_TOPIC_0000001188589008__a3cdf2c40b9454e749445d8721007dc8f">Value range: <strong id="EN-US_TOPIC_0000001188589008__b84633443">true</strong>, <strong id="EN-US_TOPIC_0000001188589008__b294732952">on</strong>, <strong id="EN-US_TOPIC_0000001188589008__b1746741103">false</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b303122243">off</strong>. The default value is <strong id="EN-US_TOPIC_0000001188589008__b134464229">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b1691034915">off</strong>.</p>
<ul id="EN-US_TOPIC_0000001188589008__u83509eccccc641189d12b0c635bfa87f"><li id="EN-US_TOPIC_0000001188589008__ldaa9d13297284ef8832d35464c3d2c88">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b842352706164851">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b84235270617308">on</strong>, invalid characters are tolerated and imported to the database after conversion.</li><li id="EN-US_TOPIC_0000001188589008__l28b4dc7f47484518851d29c62fc8e24f">If this parameter is set to <strong id="EN-US_TOPIC_0000001188589008__b84235270617314">false</strong> or <strong id="EN-US_TOPIC_0000001188589008__b8423527061672">off</strong> and an error occurs when there are invalid characters, the import will be interrupted.</li></ul>
<div class="note" id="EN-US_TOPIC_0000001188589008__n6f1c9538fe4a40e4957de0b203119d3d"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__a6c385ed7543442e09d0b1223d84b11f1">The rule of error tolerance when you import invalid characters is as follows:</p>
<p id="EN-US_TOPIC_0000001188589008__abee94d397cf9461abed921a6e38b5e41">(1) <strong id="EN-US_TOPIC_0000001188589008__b47212053125412">\0</strong> is converted to a space.</p>
<p id="EN-US_TOPIC_0000001188589008__affaa96e5d5a847308a0257dda20149f4">(2) Other invalid characters are converted to question marks.</p>
<p id="EN-US_TOPIC_0000001188589008__a4143cfdd78e548cb9f954a48d05b8434">(3) If <strong id="EN-US_TOPIC_0000001188589008__b14982059115410">compatible_illegal_chars</strong> is set to <strong id="EN-US_TOPIC_0000001188589008__b998813594542">true</strong> or <strong id="EN-US_TOPIC_0000001188589008__b0988145919542">on</strong>, invalid characters are tolerated. If <strong id="EN-US_TOPIC_0000001188589008__b1698915918542">NULL</strong>, <strong id="EN-US_TOPIC_0000001188589008__b149901659145414">DELIMITER</strong>, <strong id="EN-US_TOPIC_0000001188589008__b1299085945419">QUOTE</strong>, and <strong id="EN-US_TOPIC_0000001188589008__b799125917549">ESCAPE</strong> are set to a spaces or question marks. Errors like "illegal chars conversion may confuse COPY escape 0x20" will be displayed to prompt user to modify parameter values that cause confusion, preventing import errors.</p>
</div></div>
</li></ul>
</li><li id="EN-US_TOPIC_0000001188589008__l64d4b214cd4449c9a565bc1f5543e2ba"><strong id="EN-US_TOPIC_0000001188589008__ac5f5c4c49fea4b5b8388f2188de1f7a7">READ ONLY</strong><p id="EN-US_TOPIC_0000001188589008__abcb591bd18e24658b279b5b7883f2fc5">Specifies whether a foreign table is read-only. This parameter is available only for data import.</p>
</li><li id="EN-US_TOPIC_0000001188589008__lc7504ce2a2854ba59b3f283feaa13f89"><strong id="EN-US_TOPIC_0000001188589008__a8b7e77e28162436a8bb6f9d881ac7007">WRITE ONLY</strong><p id="EN-US_TOPIC_0000001188589008__a13176b63e8464ff1a6f6c4244dec5261">Specifies whether a foreign table is write-only. This parameter is available only for data export.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l38d1f5d8d31946d1ac878003337961a6"><a name="EN-US_TOPIC_0000001188589008__l38d1f5d8d31946d1ac878003337961a6"></a><a name="l38d1f5d8d31946d1ac878003337961a6"></a><strong id="EN-US_TOPIC_0000001188589008__aa6bab8d3fd574fc1bb2c5cc385c8b7c7">WITH error_table_name</strong><p id="EN-US_TOPIC_0000001188589008__a23f4a6e9803e44dc94ceefe8aa9abe05">Specifies the table where data format errors generated during parallel data import are recorded. You can query the error information table after data is imported to obtain error details. This parameter is available only after <strong id="EN-US_TOPIC_0000001188589008__en-us_topic_0058966236_b842352706163218">reject_limit</strong> is set.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__n20e5b56c24454a3480cbe9fe107a89eb"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__en-us_topic_0059778310_p359307615315">To be compatible with PostgreSQL open source interfaces, you are advised to replace this syntax with <strong id="EN-US_TOPIC_0000001188589008__b84235270617318">LOG INTO</strong>.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__abc021aa0f69c44a0a4b08b31b3185255">Value range: a string. It must comply with the naming convention.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l0197538463034921bffa55634fa035d2"><a name="EN-US_TOPIC_0000001188589008__l0197538463034921bffa55634fa035d2"></a><a name="l0197538463034921bffa55634fa035d2"></a><strong id="EN-US_TOPIC_0000001188589008__a5b165b3fc337446b8449ac6da9af1d9b">LOG INTO error_table_name</strong><p id="EN-US_TOPIC_0000001188589008__aad5650ac8ba9429c987904bedfc73d20">Specifies the table where data format errors generated during parallel data import are recorded. You can query the error information table after data is imported to obtain error details.</p>
<div class="note" id="EN-US_TOPIC_0000001188589008__n1d0f5c7aafe349e6bb6e3bafeb34cd15"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188589008__a64f20191791f40cd929cf25d5a4ed8bc">This parameter is available only after <strong id="EN-US_TOPIC_0000001188589008__b655416720185659">PER NODE REJECT LIMIT</strong> is set.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__ab4a13ddff376449dbdd11c26c4c0cd86">Value range: a string. It must comply with the naming convention.</p>
</li><li id="EN-US_TOPIC_0000001188589008__leffe0ccd2877448f88dab7b30cea8b7d"><a name="EN-US_TOPIC_0000001188589008__leffe0ccd2877448f88dab7b30cea8b7d"></a><a name="leffe0ccd2877448f88dab7b30cea8b7d"></a><strong id="EN-US_TOPIC_0000001188589008__a45384e0c01294002ba2b58df84f66b52">REMOTE LOG 'name'</strong><p id="EN-US_TOPIC_0000001188589008__ac3f1643eb0d947628d6b25b63d695a02">The data format error information is saved as files in GDS. <strong id="EN-US_TOPIC_0000001188589008__b842352706161211">name</strong> is the prefix of the error data file.</p>
</li><li id="EN-US_TOPIC_0000001188589008__l858bbb2e7da849a8a52f3e80dd08ff74"><a name="EN-US_TOPIC_0000001188589008__l858bbb2e7da849a8a52f3e80dd08ff74"></a><a name="l858bbb2e7da849a8a52f3e80dd08ff74"></a><strong id="EN-US_TOPIC_0000001188589008__a581c6c5dff43462a8690a275d832004f">PER NODE REJECT LIMIT 'value'</strong><p id="EN-US_TOPIC_0000001188589008__a45e123c6519a46e98baa8ba22f19fcce">This parameter specifies the allowed number of data format errors on each DN during data import. If the number of errors exceeds the specified value on any DN, data import fails, an error is reported, and the system exits data import.</p>
<div class="notice" id="EN-US_TOPIC_0000001188589008__nf376d36cb0de4cf7ad9186cf494f4eed"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188589008__a97b53d1744d943a3ba13c8998ffc5448">This syntax specifies the error tolerance of a single node.</p>
<p id="EN-US_TOPIC_0000001188589008__abfd076d156834c11b7ee51958aff5f33">Examples of data format errors include the following: a column is lost, an extra column exists, a data type is incorrect, and encoding is incorrect. When a non-data format error occurs, the whole data import process stops.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188589008__aad13b2515c684e4d99dbf17151c47dab">Value range: integer, unlimited. If this parameter is not specified, an error information is returned immediately.</p>
</li><li id="EN-US_TOPIC_0000001188589008__li234313210232"><strong id="EN-US_TOPIC_0000001188589008__ae3a58cce858a4746a33e116011f28202">TO { GROUP groupname | NODE ( nodename [, ... ] ) }</strong><p id="EN-US_TOPIC_0000001188589008__p15347732112318">Currently, <strong id="EN-US_TOPIC_0000001188589008__b84235270615293">TO GROUP</strong> cannot be used. <strong id="EN-US_TOPIC_0000001188589008__b842352706152947">TO NODE</strong> is used for internal scale-out tools.</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188589008__saa469adb80a64c2eb3e5862ba68f52a1"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188589008__p159919589267">Create a foreign table<strong id="EN-US_TOPIC_0000001188589008__b74681467463">customer_ft</strong> to import data from GDS server 10.10.123.234 in TEXT format:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188589008__screen1226814206276"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span>
<span class="normal">25</span>
<span class="normal">26</span>
<span class="normal">27</span>
<span class="normal">28</span>
<span class="normal">29</span>
<span class="normal">30</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">customer_ft</span>
<span class="p">(</span>
<span class="w"> </span><span class="n">c_customer_sk</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_customer_id</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">16</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_current_cdemo_sk</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_current_hdemo_sk</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_current_addr_sk</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_first_shipto_date_sk</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_first_sales_date_sk</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_salutation</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_first_name</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_last_name</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_preferred_cust_flag</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_birth_day</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_birth_month</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_birth_year</span><span class="w"> </span><span class="nb">integer</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_birth_country</span><span class="w"> </span><span class="nb">varchar</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_login</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">13</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_email_address</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">c_last_review_date</span><span class="w"> </span><span class="nb">char</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="p">)</span>
<span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">gsmpp_server</span>
<span class="w"> </span><span class="k">OPTIONS</span>
<span class="p">(</span>
<span class="w"> </span><span class="k">location</span><span class="w"> </span><span class="s1">'gsfs://10.10.123.234:5000/customer1*.dat'</span><span class="p">,</span>
<span class="w"> </span><span class="n">FORMAT</span><span class="w"> </span><span class="s1">'TEXT'</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="k">DELIMITER</span><span class="w"> </span><span class="s1">'|'</span><span class="p">,</span>
<span class="w"> </span><span class="k">encoding</span><span class="w"> </span><span class="s1">'utf8'</span><span class="p">,</span>
<span class="w"> </span><span class="k">mode</span><span class="w"> </span><span class="s1">'Normal'</span><span class="p">)</span>
<span class="k">READ</span><span class="w"> </span><span class="k">ONLY</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188589008__p897722673310">Create a foreign table to import data from GDS servers 192.168.0.90 and 192.168.0.91 in TEXT format. Record errors that occur during data import in <strong id="EN-US_TOPIC_0000001188589008__b43151257174619">foreign_HR_staffS_ft</strong>. A maximum of two data format errors are allowed during the data import.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188589008__screen116249818372"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">foreign_HR_staffS_ft</span>
<span class="p">(</span>
<span class="w"> </span><span class="n">staff_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">FIRST_NAME</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span>
<span class="w"> </span><span class="n">LAST_NAME</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">25</span><span class="p">),</span>
<span class="w"> </span><span class="n">EMAIL</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">25</span><span class="p">),</span>
<span class="w"> </span><span class="n">PHONE_NUMBER</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span>
<span class="w"> </span><span class="n">HIRE_DATE</span><span class="w"> </span><span class="nb">DATE</span><span class="p">,</span>
<span class="w"> </span><span class="n">employment_ID</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">10</span><span class="p">),</span>
<span class="w"> </span><span class="n">SALARY</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">COMMISSION_PCT</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">MANAGER_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">6</span><span class="p">),</span>
<span class="w"> </span><span class="n">section_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="p">)</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">gsmpp_server</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="k">location</span><span class="w"> </span><span class="s1">'gsfs://192.168.0.90:5000/* | gsfs://192.168.0.91:5000/*'</span><span class="p">,</span><span class="w"> </span><span class="n">format</span><span class="w"> </span><span class="s1">'TEXT'</span><span class="p">,</span><span class="w"> </span><span class="k">delimiter</span><span class="w"> </span><span class="n">E</span><span class="s1">'\x08'</span><span class="p">,</span><span class="w"> </span><span class="k">null</span><span class="w"> </span><span class="s1">''</span><span class="p">,</span><span class="n">reject_limit</span><span class="w"> </span><span class="s1">'2'</span><span class="p">)</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">err_HR_staffS_ft</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188589008__p1660621012320">Create a foreign table to import all files in the <strong id="EN-US_TOPIC_0000001188589008__b453883013489">input_data</strong> directory in CSV format.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188589008__sf61657fe76b14d1b8e807e722edc430c"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">foreign_HR_staffS_ft1</span>
<span class="p">(</span>
<span class="w"> </span><span class="n">staff_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">FIRST_NAME</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span>
<span class="w"> </span><span class="n">LAST_NAME</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">25</span><span class="p">),</span>
<span class="w"> </span><span class="n">EMAIL</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">25</span><span class="p">),</span>
<span class="w"> </span><span class="n">PHONE_NUMBER</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span>
<span class="w"> </span><span class="n">HIRE_DATE</span><span class="w"> </span><span class="nb">DATE</span><span class="p">,</span>
<span class="w"> </span><span class="n">employment_ID</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">10</span><span class="p">),</span>
<span class="w"> </span><span class="n">SALARY</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">COMMISSION_PCT</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">MANAGER_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">6</span><span class="p">),</span>
<span class="w"> </span><span class="n">section_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="p">)</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">gsmpp_server</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="k">location</span><span class="w"> </span><span class="s1">'file:///input_data/*'</span><span class="p">,</span><span class="w"> </span><span class="n">format</span><span class="w"> </span><span class="s1">'csv'</span><span class="p">,</span><span class="w"> </span><span class="n">quote</span><span class="w"> </span><span class="n">E</span><span class="s1">'\x08'</span><span class="p">,</span><span class="w"> </span><span class="k">mode</span><span class="w"> </span><span class="s1">'private'</span><span class="p">,</span><span class="w"> </span><span class="k">delimiter</span><span class="w"> </span><span class="s1">','</span><span class="p">)</span><span class="w"> </span><span class="k">WITH</span><span class="w"> </span><span class="n">err_HR_staffS_ft1</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001188589008__ae395882e882d4f17a227abe4823ef695">Create a foreign table to export data to the <strong id="EN-US_TOPIC_0000001188589008__b18598113644814">output_data</strong> directory in CSV format.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188589008__s4573884838fb40efb5440f712aef1c1f"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">CREATE</span><span class="w"> </span><span class="k">FOREIGN</span><span class="w"> </span><span class="k">TABLE</span><span class="w"> </span><span class="n">foreign_HR_staffS_ft2</span>
<span class="p">(</span>
<span class="w"> </span><span class="n">staff_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span><span class="w"> </span><span class="p">,</span>
<span class="w"> </span><span class="n">FIRST_NAME</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span>
<span class="w"> </span><span class="n">LAST_NAME</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">25</span><span class="p">),</span>
<span class="w"> </span><span class="n">EMAIL</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">25</span><span class="p">),</span>
<span class="w"> </span><span class="n">PHONE_NUMBER</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">20</span><span class="p">),</span>
<span class="w"> </span><span class="n">HIRE_DATE</span><span class="w"> </span><span class="nb">DATE</span><span class="p">,</span>
<span class="w"> </span><span class="n">employment_ID</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">(</span><span class="mi">10</span><span class="p">),</span>
<span class="w"> </span><span class="n">SALARY</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">COMMISSION_PCT</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">),</span>
<span class="w"> </span><span class="n">MANAGER_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">6</span><span class="p">),</span>
<span class="w"> </span><span class="n">section_ID</span><span class="w"> </span><span class="nb">NUMBER</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="p">)</span><span class="w"> </span><span class="n">SERVER</span><span class="w"> </span><span class="n">gsmpp_server</span><span class="w"> </span><span class="k">OPTIONS</span><span class="w"> </span><span class="p">(</span><span class="k">location</span><span class="w"> </span><span class="s1">'file:///output_data/'</span><span class="p">,</span><span class="w"> </span><span class="n">format</span><span class="w"> </span><span class="s1">'csv'</span><span class="p">,</span><span class="w"> </span><span class="n">quote</span><span class="w"> </span><span class="n">E</span><span class="s1">'\x08'</span><span class="p">,</span><span class="w"> </span><span class="k">delimiter</span><span class="w"> </span><span class="s1">'|'</span><span class="p">,</span><span class="w"> </span><span class="n">header</span><span class="w"> </span><span class="s1">'on'</span><span class="p">)</span><span class="w"> </span><span class="k">WRITE</span><span class="w"> </span><span class="k">ONLY</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188589008__s1004a2ab340a4a2db686b6d1f9041bb0"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188589008__a1772fc11d8634a938b6cdfedeadae177"><a href="dws_06_0123.html">ALTER FOREIGN TABLE (GDS Import and Export)</a>, <a href="dws_06_0192.html">DROP FOREIGN TABLE</a></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0118.html">DDL Syntax</a></div>
</div>
</div>