forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
160 lines
22 KiB
HTML
160 lines
22 KiB
HTML
<a name="EN-US_TOPIC_0000001811490789"></a><a name="EN-US_TOPIC_0000001811490789"></a>
|
|
|
|
<h1 class="topictitle1">Synchronizing Hudi Tasks</h1>
|
|
<div id="body0000001592321865"><div class="section" id="EN-US_TOPIC_0000001811490789__section43701150142220"><h4 class="sectiontitle">Creating a Hudi Task</h4><p id="EN-US_TOPIC_0000001811490789__p5630412104515"><strong id="EN-US_TOPIC_0000001811490789__b8291332104819">Migration</strong></p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p2264123910243">If data has been imported to the GaussDB(DWS) table using CDL, use SQL on Hudi to migrate data. Alternatively, use CDM to perform full initialization and then use SQL on Hudi to synchronize incremental data.</p>
|
|
<ol id="EN-US_TOPIC_0000001811490789__ol365172564513"><li id="EN-US_TOPIC_0000001811490789__li865325174513"><span>To create the <strong id="EN-US_TOPIC_0000001811490789__b132456817216">hudi.hudi_sync_state</strong> synchronization status table, you must have the administrator permission.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen72641439182415"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_catalog</span><span class="p">.</span><span class="n">create_hudi_sync_table</span><span class="p">();</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p356182244613">Generally, hudi.hudi_sync_state is created only once in each database.</p>
|
|
</p></li><li id="EN-US_TOPIC_0000001811490789__li439351344619"><span>To set the CDL synchronization progress, you must have the INSERT and UPDATE permissions on the target table and the SELECT permission on the HUDI foreign table. Otherwise, the synchronization progress cannot be set.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen12192204895319"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">hudi_set_sync_commit</span><span class="p">(</span><span class="s1">'SCHEMA.TABLE'</span><span class="p">,</span><span class="w"> </span><span class="s1">'SCHEMA.FOREIGN_TABLE'</span><span class="p">,</span><span class="w"> </span><span class="s1">'LATEST_COMMIT'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p5265339192417">Where:</p>
|
|
<ul id="EN-US_TOPIC_0000001811490789__ul14127194994616"><li id="EN-US_TOPIC_0000001811490789__li81271849124610"><strong id="EN-US_TOPIC_0000001811490789__b161214486253814">SCHEMA.TABLE</strong> indicates the name and schema of the target table for data synchronization.</li><li id="EN-US_TOPIC_0000001811490789__li3127549134612"><strong id="EN-US_TOPIC_0000001811490789__b61606939853814">SCHEMA.FOREIGN_TABLE</strong> indicates the name and schema of the OBS foreign table.</li><li id="EN-US_TOPIC_0000001811490789__li11271949134611"><strong id="EN-US_TOPIC_0000001811490789__b142513988353814">LATEST_COMMIT</strong> indicates the end time of the Hudi synchronization.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001811490789__p1746093311474">Example: Data has been synchronized to the target table <strong id="EN-US_TOPIC_0000001811490789__b669171218233">public.in_rel</strong> from hudi by <strong id="EN-US_TOPIC_0000001811490789__b135611132311">20220913152131</strong>. Use SQL on Hudi to continue to export data from the OBS foreign table <strong id="EN-US_TOPIC_0000001811490789__b43574172312">hudi_read1</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen138816280474"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">hudi_set_sync_commit</span><span class="p">(</span><span class="s1">'public.in_rel'</span><span class="p">,</span><span class="w"> </span><span class="s1">'public.hudi_read1'</span><span class="p">,</span><span class="w"> </span><span class="s1">'20220913152131'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</p></li><li id="EN-US_TOPIC_0000001811490789__li1238513153469"><span>Submit the Hudi synchronization task.</span><p><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen126643916249"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">hudi_sync_task_submit</span><span class="p">(</span><span class="s1">'SCHEMA.TABLE'</span><span class="p">,</span><span class="w"> </span><span class="s1">'SCHEMA.FOREIGN_TABLE'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p152662392244">Example: Use SQL on Hudi to continue to export data from the OBS foreign table <strong id="EN-US_TOPIC_0000001811490789__b205684913053814">hudi_read1</strong> to the target table <strong id="EN-US_TOPIC_0000001811490789__b42513324153814">public.in_rel</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen2056082173711"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">hudi_sync_task_submit</span><span class="p">(</span><span class="s1">'public.in_rel'</span><span class="p">,</span><span class="w"> </span><span class="s1">'public.hudi_read1'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</p></li></ol>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p18211749164812"><strong id="EN-US_TOPIC_0000001811490789__b37541527487">Creation</strong></p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p28411822517">If the GaussDB(DWS) table is empty and data is synchronized from Hudi for the first time, run the following command to create a task:</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen12841218142520"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">hudi_sync_task_submit</span><span class="p">(</span><span class="s1">'SCHEMA.TABLE'</span><span class="p">,</span><span class="w"> </span><span class="s1">'SCHEMA.FOREIGN_TABLE'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section1549974510262"><h4 class="sectiontitle">Querying Hudi Synchronization Tasks</h4><p id="EN-US_TOPIC_0000001811490789__p2717112042917">Query a Hudi synchronization task. In the query result, <strong id="EN-US_TOPIC_0000001811490789__b254641981817">task_id uniquely</strong> identifies a Hudi synchronization task.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen19671235192719"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_task_show</span><span class="p">(</span><span class="s1">'SQLonHudi'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section16708246112710"><h4 class="sectiontitle">Suspending Hudi Synchronization Tasks</h4><p id="EN-US_TOPIC_0000001811490789__p1080815294283">Query the Hudi task and obtain <strong id="EN-US_TOPIC_0000001811490789__b39884167319">task_id</strong> to suspend the Hudi task.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen13808172922820"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_pause</span><span class="p">(</span><span class="s1">'task_id'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p1079933616243">Example:</p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p14809122932812">Suspend the synchronization task whose <strong id="EN-US_TOPIC_0000001811490789__b1657183861815">task_id</strong> is 6<strong id="EN-US_TOPIC_0000001811490789__b6230114221819">4479410-a04c-0700-d150-3037d700fffe</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen9237117124217"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_pause</span><span class="p">(</span><span class="s1">'64479410-a04c-0700-d150-3037d700fffe'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section039992913307"><h4 class="sectiontitle">Resuming Hudi Synchronization Tasks</h4><p id="EN-US_TOPIC_0000001811490789__p8869143183017">Query the Hudi task, obtain the value of <strong id="EN-US_TOPIC_0000001811490789__b1142504718318">task_id</strong>, and resume the Hudi task.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen6869173113013"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_resume</span><span class="p">(</span><span class="s1">'task_id'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p1952414399241">Example:</p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p1286917312302">Resume the synchronization task whose <strong id="EN-US_TOPIC_0000001811490789__b288159133217">task_id</strong> is <strong id="EN-US_TOPIC_0000001811490789__b489293328">64479410-a04c-0700-d150-3037d700fffe</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen1656414287427"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_resume</span><span class="p">(</span><span class="s1">'64479410-a04c-0700-d150-3037d700fffe'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section3247105523016"><h4 class="sectiontitle">Deleting a Hudi Synchronization Task</h4><p id="EN-US_TOPIC_0000001811490789__p1724695517301">Query the Hudi task, obtain <strong id="EN-US_TOPIC_0000001811490789__b13915152483219">task_id</strong>, and delete the Hudi synchronization task.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen11246175543017"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_remove</span><span class="p">(</span><span class="s1">'task_id'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001811490789__p283144222418">Example:</p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p1824645511309">Delete the synchronization task whose <strong id="EN-US_TOPIC_0000001811490789__b06602029183217">task_id</strong> is <strong id="EN-US_TOPIC_0000001811490789__b13661029113214">64479410-a04c-0700-d150-3037d700fffe</strong>.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen1948083511421"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_remove</span><span class="p">(</span><span class="s1">'64479410-a04c-0700-d150-3037d700fffe'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section650344771"><h4 class="sectiontitle">Querying Past Synchronization Information</h4><p id="EN-US_TOPIC_0000001811490789__p15503347713">Use the <strong id="EN-US_TOPIC_0000001811490789__b337171512339">hudi_sync_state_history_view</strong> view to query information about past Hudi synchronization tasks. This view is supported only by clusters of version 9.1.0 and later.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen19503343716"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_catalog</span><span class="p">.</span><span class="n">hudi_sync_state_history_view</span><span class="p">;</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001811490789__t3c8ff3b999c34ad68784a5fe26202b3a" frame="border" border="1" rules="all"><caption><b>Table 1 </b><strong id="EN-US_TOPIC_0000001811490789__b1191211417347">hudi_sync_state_history_view</strong> columns</caption><thead align="left"><tr id="EN-US_TOPIC_0000001811490789__r7b54478e0bf540c8940ecea52deb483f"><th align="left" class="cellrowborder" valign="top" width="25.900000000000002%" id="mcps1.3.10.2.4.1.1"><p id="EN-US_TOPIC_0000001811490789__a07fe3651f76e4b06a408aaac82610f6e">Column</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="32.24%" id="mcps1.3.10.2.4.1.2"><p id="EN-US_TOPIC_0000001811490789__ac6d7fb92a1fe49db9ddb080ac1f66aa1">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.86%" id="mcps1.3.10.2.4.1.3"><p id="EN-US_TOPIC_0000001811490789__ae41259dae98545aebf035ee56ed661f6">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001811490789__r7e959801d3c245578e5dbaff9a9d1c46"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__ac7d8b2bbb59e4801922d248696a9eb7d">task_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p14153101414397">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__a3cd3c57a432246f8baf7e6442d3cbd27">Task ID</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__rd0ffd83016604b3e84ee7c6d048f4cf9"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p10671155113511">target_tbl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p1797701543912">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__a67c6e0c2a4ef4af4921ff3dda17a8092">Name of the synchronization target table</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__r676b355a20974abfbb08c40f5816913a"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p112331425362">source_ftbl</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p13887171396">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__p858417816401">Name of the synchronization source table (foreign table)</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__r960d2d2a89e34e27b73170e8e3c065b7"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p3461158133614">latest_commit</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p4347720153918">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__p1027652484015">Timestamp of the latest successful synchronization</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__r080f79734bb1415c8a75b0eccac7f16b"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p1735014154363">latest_sync_count</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p4752202718394">BIGINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__p19382059151110">Number of rows that are successfully synchronized last time</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__row1843718512110"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p35511923133611">latest_sync_start</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p2019883663911">TIMESTAMP WITH TIME ZONE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__p16795245154013">Start time of the latest synchronization task</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__rbc661829aa784263ae28b9b49af02efd"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p679113415368">latest_sync_end</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p17989103716397">TIMESTAMP WITH TIME ZONE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__p181431346415">Time when the latest synchronization task ends</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001811490789__row853514713366"><td class="cellrowborder" valign="top" width="25.900000000000002%" headers="mcps1.3.10.2.4.1.1 "><p id="EN-US_TOPIC_0000001811490789__p8536447133616">hudi_flushdisk_time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="32.24%" headers="mcps1.3.10.2.4.1.2 "><p id="EN-US_TOPIC_0000001811490789__p1253624718362">TEXT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.86%" headers="mcps1.3.10.2.4.1.3 "><p id="EN-US_TOPIC_0000001811490789__p2536134716369">Time when the hudi file is flushed to disks</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section131511813171320"><h4 class="sectiontitle">Querying the Status of a Synchronization Task</h4><p id="EN-US_TOPIC_0000001811490789__p7151713171320">Use the <strong id="EN-US_TOPIC_0000001811490789__b169961621353814">hudi_show_sync_state()</strong> function to query the status of a Hudi synchronization task.</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen61514137135"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">hudi_show_sync_state</span><span class="p">();</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001811490789__section9857151133113"><h4 class="sectiontitle">Resetting a Hudi Synchronization Task with Consecutive Failures</h4><p id="EN-US_TOPIC_0000001811490789__p2489183918420">Use the <strong id="EN-US_TOPIC_0000001811490789__b215541433716">pg_task_resume()</strong> function to reset a Hudi synchronization task that fails consecutively.</p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p17744510254">If the number of consecutive failures is greater than or equal to 10, the task is automatically suspended. You need to manually call the <strong id="EN-US_TOPIC_0000001811490789__b43663479383">pg_task_resume()</strong> function to reset the task. This function is supported only by clusters of version 9.1.0 and later.</p>
|
|
<p id="EN-US_TOPIC_0000001811490789__p16179163963410">Input parameter: <strong id="EN-US_TOPIC_0000001811490789__b1024343398">task_id</strong> of the Hudi task that fails consecutively</p>
|
|
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001811490789__screen78574111317"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">pg_task_resume</span><span class="p">(</span><span class="s1">'task_id'</span><span class="p">);</span>
|
|
</pre></div></td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_1069.html">SQL on Hudi</a></div>
|
|
</div>
|
|
</div>
|
|
|