{"id":1536,"date":"2021-01-29T13:37:14","date_gmt":"2021-01-29T05:37:14","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=1536"},"modified":"2022-10-13T16:40:57","modified_gmt":"2022-10-13T08:40:57","slug":"tdt-%e6%8a%bd%e6%95%b0%e5%ad%97%e6%ae%b5%e8%bf%87%e5%a4%9a%e6%97%b6%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=1536","title":{"rendered":"tdt \u62bd\u6570\u5b57\u6bb5\u8fc7\u591a\u65f6\u7684\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p>inceptor \u7684\u8868\u5c5e\u6027\u662f\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f\u8bb0\u5f55\u5728 txsql \u4e2d\uff0cTDT \u4e2d\u95f4\u5e93\u8868\u4e2d\u4f1a\u6709 mapreduce.jdbc.input.query \u548c mapreduce.jdbc.input.count.query \u8fd9\u4e24\u4e2a\u5c5e\u6027\uff0c\u5b83\u4eec\u7684\u503c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e3a varchar(4000)\u3002\u5bf9\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u662f\u6ca1\u6709\u95ee\u9898\u7684\uff0c\u4f46\u662f\u5217\u6570\u592a\u591a\uff0c\u8d85\u8fc7\u4e86\u4e0a\u8ff0\u4e24\u4e2a\u5c5e\u6027\u7684\u8868\u8fbe\u8303\u56f4\uff0c\u5bfc\u81f4\u4e2d\u95f4\u8868\u5c5e\u6027\u4e0d\u5b8c\u6574\uff0c\u6b64\u65f6\u62bd\u53d6\u6570\u636e\u5230 inceptor \u6267\u884c\u65f6\u4f1a\u62a5\u9519\u5b57\u7b26\u4e32\u4e0d\u5b8c\u6574\uff0c<\/p>\n<p>\u672c\u6848\u4f8b\u7b80\u5355\u4ecb\u7ecd\u5f53\u5b57\u6bb5\u8fc7\u591a\u65f6\uff0c\u8d85\u8fc7 4000 \u5b57\u7b26\u65f6\u5982\u4f55\u89e3\u51b3\uff1b<br \/>\n\u672c\u6848\u4f8b\u73af\u5883\uff1aTDH 5.2.2\u3001TDT studio 1.1<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<p>\u4f7f\u7528 TDT \u62bd\u53d6\u6570\u636e\u5230inceptor\u7684\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u9047\u5230\u6e90\u8868\u6570\u636e\u5b57\u6bb5\u6bd4\u8f83\u591a\u62bd\u53d6\u5931\u8d25\u7684\u95ee\u9898\uff0c\u5728 TDT \u6216\u8005 inceptor \u65e5\u5fd7\u4e2d\u53d1\u73b0\u4ee5\u4e0b\u62a5\u9519\uff1a<\/p>\n<pre><code class=\"language-java\">2019-11-20 14:36:13,054 ERROR execution.SparkTask: (Logging.scala:logError(96)) [HiveServer2-Handler-Pool: Thread-51752(SessionHandle=6e223954-c49c-44cc-bcea-92b30f660d0a)] - Spark task execution is failed.\njava.io.IOException: Got SQLException\n    at org.apache.hadoop.hive.ql.io.tdt.JDBCDBInputFormat.getSplits(JDBCDBInputFormat.java:116)\n    at org.apache.hadoop.hive.ql.io.tdt.JDBCDBInputFormat.getSplits(JDBCDBInputFormat.java:72)\n    ......\n    at java.lang.Thread.run(Thread.java:745)\nCaused by: com.microsoft.sqlserver.jdbc.SQLServerException: \u5b57\u7b26\u4e32 'AddYFFloa' \u540e\u7684\u5f15\u53f7\u4e0d\u5b8c\u6574\u3002<\/code><\/pre>\n<p>\u6216\u8005\u8fd9\u6837\u7684\u62a5\u9519\uff1a<\/p>\n<pre><code>MysqlDataTruncation: Data truncation: Data too long for column <\/code><\/pre>\n<h4>\u64cd\u4f5c\u6b65\u9aa4<\/h4>\n<hr \/>\n<ol>\n<li>\u8fdb\u5165 metastore_inceptor \u5143\u6570\u636e\u5e93<\/li>\n<li>\u4fee\u6539 metastore_inceptor \u7684 TABLE_PARAMS \u7684\u5b57\u6bb5\u957f\u5ea6<\/li>\n<\/ol>\n<h4>\u8fdb\u5165 metastore_inceptor \u5143\u6570\u636e\u5e93<\/h4>\n<h5>\u53c2\u89c1\u8fde\u63a5 <a href=\"https:\/\/nj.transwarp.cn:8180\/?p=1373\" title=\"Inceptor \u7684\u5143\u6570\u636e\u5e93\u7ba1\u7406\">Inceptor \u7684\u5143\u6570\u636e\u5e93\u7ba1\u7406<\/a> \u7684 5.x \u4ee5\u4e0a\u7248\u672c\u767b\u5f55Metastore \u7ae0\u8282\u3002<\/h5>\n<p>\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-shell\">$ kubectl get pods |grep txsql\ntxsql-server-txsql1-3619959039-lcp6s                        1\/1       Running   4          64d\ntxsql-server-txsql1-3619959039-mdqqs                        1\/1       Running   1          53d\ntxsql-server-txsql1-3619959039-sb8zj                        1\/1       Running   1          16d\n$ kubectl exec -ti txsql-server-txsql1-3619959039-lcp6s -- \/usr\/bin\/txsql\/tools\/txsql.sh localshell\nWarning: Using a password on the command line interface can be insecure.\nWelcome to the MySQL monitor.  Commands end with ; or \\g.\nYour MySQL connection id is 584270\nServer version: 5.6.31-77.0-log Source distribution\n\nCopyright (c) 2009-2016 Percona LLC and\/or its affiliates\nCopyright (c) 2000, 2016, Oracle and\/or its affiliates. All rights reserved.\n\nOracle is a registered trademark of Oracle Corporation and\/or its\naffiliates. Other names may be trademarks of their respective\nowners.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nmysql> show databases;\n+----------------------------+\n| Database                   |\n+----------------------------+\n| information_schema         ||\n| metastore_inceptor1        |\n| metastore_slipstream1      |\n| mysql                      |\n| performance_schema         |\n| test                       |\n| tmp_txsql_function_test    |\n+----------------------------+\n7 rows in set (0.00 sec)\n\nmysql><\/code><\/pre>\n<h5>\u4fee\u6539 metastore_inceptor \u7684 TABLE_PARAMS \u7684\u5b57\u6bb5\u957f\u5ea6<\/h5>\n<p>\u8be5\u8868\u7684 PARAM_VALUE \u5b57\u6bb5\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e3a varchar(4000)\uff0ctdt \u81ea\u52a8\u7ec4\u88c5\u7684 sql \u5e94\u8be5\u662f\u5728\u8fd9\u4e2a\u8303\u56f4\u5185\u7684\uff0c\u6240\u4ee5\u5982\u679c\u5b57\u6bb5\u8fc7\u591a\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u5c06\u8be5\u5b57\u6bb5\u957f\u5ea6\u6539\u5927\u4e00\u4e9b\uff0c\u6bd4\u5982 varchar(10000)\uff1b<br \/>\n\u4fee\u6539 sql \u8bed\u53e5\u4e3a \uff1a<\/p>\n<pre><code class=\"language-sql\">alter table metastore_inceptor1.TABLE_PARAMS modify column PARAM_VALUE varchar(10000);<\/code><\/pre>\n<p><strong><font color=red>\u6ce8\u610f\uff1a<\/strong><\/p>\n<p>\u4fee\u6539<code>TABLE_PARAMS<\/code>\u8868PARAM_VALUE\u5b57\u6bb5\u7684\u957f\u5ea6\u65f6\uff0c\u82e5\u4e0d\u6307\u5b9a\u5b57\u6bb5\u7f16\u7801\uff0c\u5219\u8be5\u5b57\u6bb5\u7f16\u7801\u7531<code>utf-8<\/code>\u53d8\u4e3a<code>latin1_bin<\/code> <\/p>\n<p>\u89e3\u51b3\u65b9\u6848\uff1a<br \/>\n\u6b63\u786e\u7684\u53d8\u66f4\u8bed\u53e5\u4e3a\uff1a<code>ALTER TABLE metastore_inceptor1.TABLE_PARAMS modify column PARAM_VALUE varchar(10002) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL;<\/code> <\/p>\n<p>\u95ee\u9898\u5f71\u54cd\uff1a<strong>\u5df2\u4ea7\u751f\u7684\u5f71\u54cd\u65e0\u6cd5\u81ea\u52a8\u6062\u590d\uff0c\u53ea\u80fd\u9010\u8868\u4fee\u6539\u6ce8\u91ca\u3002<\/strong><br \/>\n<\/font><\/p>\n<p>\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-sql\">mysql> describe metastore_inceptor1.TABLE_PARAMS;\n+-------------+----------------+------+-----+---------+-------+\n| Field       | Type           | Null | Key | Default | Extra |\n+-------------+----------------+------+-----+---------+-------+\n| TBL_ID      | bigint(20)     | NO   | PRI | NULL    |       |\n| PARAM_KEY   | varchar(256)   | NO   | PRI | NULL    |       |\n| PARAM_VALUE | varchar(4000) | YES  |     | NULL    |       |\n+-------------+----------------+------+-----+---------+-------+\n3 rows in set (0.00 sec)\n\nmysql> use metastore_inceptor1;\nDatabase changed\nmysql> alter table TABLE_PARAMS modify column PARAM_VALUE varchar(10000); \nQuery OK, 539 rows affected (0.20 sec)\nRecords: 539  Duplicates: 0  Warnings: 0\n\nmysql> describe metastore_inceptor1.TABLE_PARAMS;\n+-------------+----------------+------+-----+---------+-------+\n| Field       | Type           | Null | Key | Default | Extra |\n+-------------+----------------+------+-----+---------+-------+\n| TBL_ID      | bigint(20)     | NO   | PRI | NULL    |       |\n| PARAM_KEY   | varchar(256)   | NO   | PRI | NULL    |       |\n| PARAM_VALUE | varchar(10000) | YES  |     | NULL    |       |\n+-------------+----------------+------+-----+---------+-------+\n3 rows in set (0.00 sec)\n\nmysql> <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 inceptor \u7684\u8868\u5c5e\u6027\u662f\u4ee5\u952e\u503c\u5bf9\u7684\u5f62\u5f0f\u8bb0\u5f55\u5728 txsql \u4e2d\uff0cTDT \u4e2d\u95f4\u5e93\u8868\u4e2d\u4f1a\u6709 mapre ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=1536\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1536","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1536"}],"version-history":[{"count":3,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1536\/revisions"}],"predecessor-version":[{"id":8861,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1536\/revisions\/8861"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}