<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: gbk转utf8方案 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413183#M253912</link>
    <description>&lt;P&gt;The error stack trace indicates an issue with the hive encode UDF statement.&lt;/P&gt;&lt;P&gt;Please provide the DDL, sample data, and corresponding SQL to reproduce the problem.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Dec 2025 10:47:31 GMT</pubDate>
    <dc:creator>ggangadharan</dc:creator>
    <dc:date>2025-12-18T10:47:31Z</dc:date>
    <item>
      <title>gbk转utf8方案</title>
      <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413156#M253902</link>
      <description>&lt;P&gt;请问，在cdp7.17 环境，执行gbk转utf8报错，如下图所示,要如何解决？&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zhouweibo_1-1765940703713.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/46495i51D168A2AD8F17AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zhouweibo_1-1765940703713.jpeg" alt="zhouweibo_1-1765940703713.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zhouweibo_0-1765940030470.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/46494iA7F32EE39DD4DDD4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zhouweibo_0-1765940030470.jpeg" alt="zhouweibo_0-1765940030470.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 06:11:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413156#M253902</guid>
      <dc:creator>zhouweibo</dc:creator>
      <dc:date>2026-04-21T06:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: gbk转utf8方案</title>
      <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413157#M253903</link>
      <description>&lt;P&gt;English Translation:&lt;BR /&gt;&lt;BR /&gt;GBK to UTF-8 conversion solution&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a CDP 7.17 environment, I encountered an error when converting GBK to UTF-8, as shown in the image below. How can I resolve this?&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103591"&gt;@zhouweibo&lt;/a&gt;, Welcome to our community! To help you get the best possible answer, I have tagged in our CDP&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/31598"&gt;@zzeng&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/95611"&gt;@upadhyayk04&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80393"&gt;@rki_&lt;/a&gt;&amp;nbsp;&amp;nbsp;experts who may be able to assist you further.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 05:17:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413157#M253903</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2025-12-17T05:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: gbk转utf8方案</title>
      <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413162#M253907</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103591"&gt;@zhouweibo&lt;/a&gt;&amp;nbsp; Hi Weibo,&lt;/P&gt;&lt;P&gt;I build an environment by myself, but I can't reproduce your error.&lt;/P&gt;&lt;P&gt;I created a table in this way:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;-- Create database if not exists
CREATE DATABASE IF NOT EXISTS upidb;

-- Create table with correct syntax
CREATE TABLE IF NOT EXISTS upidb.gscs_tbl_fultrans_2_db (
    trace_num STRING COMMENT 'Trace number',
    acq_ins_cde STRING COMMENT 'Acquiring institution code',
    fwd_ins_cde STRING COMMENT 'Forwarding institution code',
    acq_trans_cde STRING COMMENT 'Acquiring transaction code',
    iss_trans_cde STRING COMMENT 'Issuing transaction code',
    pri_acct_num STRING COMMENT 'Primary account number',
    resv_fld2 STRING COMMENT 'Reserved field 2 - contains encoded data',
    sett_dt STRING COMMENT 'Settlement date in YYYYMMDD format'
)
COMMENT 'Full transaction table for settlement date partition'
STORED AS PARQUET;

-- Insert sample data with GBK encoded characters to reproduce the encoding issue
INSERT INTO upidb.gscs_tbl_fultrans_2_db VALUES
(
    '123456789012',
    'ACQ001',
    'FWD001',
    'TRANS001',
    'TRANS002',
    '1234567890123456',
    'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789测试中文字符ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',
    '20231201'
);&lt;/LI-CODE&gt;&lt;P&gt;Then ran the SELECT sql, but Can't reproduce error:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;SELECT trace_num
      ,acq_ins_cde
      ,fwd_ins_cde
      ,acq_trans_cde
      ,iss_trans_cde
      ,pri_acct_num
      ,trim(SUBSTR(resv_fld2,111,2))
      ,trim(decode(SUBSTR(encode(resv_fld2,'gbk'),113,15),'gbk'))
      ,trim(decode(SUBSTR(encode(resv_fld2,'gbk'),128,40),'gbk'))
      ,trim(decode(SUBSTR(encode(resv_fld2,'gbk'),168,40),'gbk'))
from upidb.gscs_tbl_fultrans_2_db
where sett_dt = '20231201'&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zzeng_0-1765973674946.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/46496iDB232D391D44051F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zzeng_0-1765973674946.png" alt="zzeng_0-1765973674946.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can you please share your DDL?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 12:14:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413162#M253907</guid>
      <dc:creator>zzeng</dc:creator>
      <dc:date>2025-12-17T12:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: gbk转utf8方案</title>
      <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413183#M253912</link>
      <description>&lt;P&gt;The error stack trace indicates an issue with the hive encode UDF statement.&lt;/P&gt;&lt;P&gt;Please provide the DDL, sample data, and corresponding SQL to reproduce the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2025 10:47:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413183#M253912</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2025-12-18T10:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: gbk转utf8方案</title>
      <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413207#M253931</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103591"&gt;@zhouweibo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did the replies help you resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Dec 2025 13:32:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413207#M253931</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2025-12-29T13:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: gbk转utf8方案</title>
      <link>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413322#M254007</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103591"&gt;@zhouweibo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As mentioned previously, please provide the DDL, sample data, and corresponding SQL to reproduce the problem. With this information, we can reproduce the problem locally and&amp;nbsp; offer an exact working solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jan 2026 06:14:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/gbk%E8%BD%ACutf8%E6%96%B9%E6%A1%88/m-p/413322#M254007</guid>
      <dc:creator>ggangadharan</dc:creator>
      <dc:date>2026-01-12T06:14:49Z</dc:date>
    </item>
  </channel>
</rss>

