﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-bob-文章分类-hive</title><link>http://www.blogjava.net/keweibo/category/55305.html</link><description>&lt;script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
&lt;!-- iteye 460 60 --&gt;
&lt;ins class="adsbygoogle"
     style="display:inline-block;width:468px;height:60px"
     data-ad-client="ca-pub-2876867208357149"
     data-ad-slot="0418982663"&gt;&lt;/ins&gt;
&lt;script&gt;
(adsbygoogle = window.adsbygoogle || []).push({});
&lt;/script&gt;
</description><language>zh-cn</language><lastBuildDate>Wed, 04 Apr 2018 21:06:03 GMT</lastBuildDate><pubDate>Wed, 04 Apr 2018 21:06:03 GMT</pubDate><ttl>60</ttl><item><title>sqoop 从Oracle导入到hive   列的值带有回车换行导致HIVE表中记录增多</title><link>http://www.blogjava.net/keweibo/articles/433144.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Tue, 03 Apr 2018 10:01:00 GMT</pubDate><guid>http://www.blogjava.net/keweibo/articles/433144.html</guid><wfw:comment>http://www.blogjava.net/keweibo/comments/433144.html</wfw:comment><comments>http://www.blogjava.net/keweibo/articles/433144.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/keweibo/comments/commentRss/433144.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/keweibo/services/trackbacks/433144.html</trackback:ping><description><![CDATA[<strong>原文地址：http://blog.51cto.com/jackwxh/1917673</strong><br /><br /><p style="font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, 微软雅黑, Arial, sans-serif; margin: 0px; padding: 0px; max-width: 100%; font-size: 16px; color: #333333; background-color: #ffffff;">sqoop import --hive-import --hive-overwrite &nbsp;--connect jdbc:oracle:thin:@192.168.92.136:1521:cyporcl --username ODS --password 'od154DS$!(' &nbsp;-m 1 &nbsp;--hive-database ODS --table Q_TRA_DISPUTESTATUS --fields-terminated-by '\001' --hive-drop-import-delims &nbsp;--null-string '\\N' --null-non-string '\\N' &nbsp;--map-column-java DISPUTERESULT=String</p><p style="font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, 微软雅黑, Arial, sans-serif; margin: 0px; padding: 0px; max-width: 100%; font-size: 16px; color: #333333; background-color: #ffffff;">DISPUTERESULT 这个字段是Oracleclob 类型的，里面有回车， 加载到hive 里面导致 记录增多。</p><p style="font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, 微软雅黑, Arial, sans-serif; margin: 0px; padding: 0px; max-width: 100%; font-size: 16px; color: #333333; background-color: #ffffff;"><br style="margin: 0px; padding: 0px; max-width: 100%;" /></p><p style="font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, 微软雅黑, Arial, sans-serif; margin: 0px; padding: 0px; max-width: 100%; font-size: 16px; color: #333333; background-color: #ffffff;"><span style="font-family: Arial; margin: 0px; padding: 0px; max-width: 100%; font-size: 14px;">--map-column-java和--map-column-hive两个参数都要显示给出；还需要设置--hive-drop-import-delims这样才能顺利导出数据。</span></p><p style="font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, 微软雅黑, Arial, sans-serif; margin: 0px; padding: 0px; max-width: 100%; font-size: 16px; color: #333333; background-color: #ffffff;"><span style="font-family: tahoma, arial, 宋体; margin: 0px; padding: 0px; max-width: 100%; font-size: 14px;">.导入的列有换行符如何解决</span><br style="font-family: tahoma, arial, 宋体; margin: 0px; padding: 0px; max-width: 100%; font-size: 14px;" /><span style="font-family: tahoma, arial, 宋体; margin: 0px; padding: 0px; max-width: 100%; font-size: 14px;">本以为万事大吉，万万没想到导入的列有nclob类型，里面存储了一篇篇文章，势必有着换行符。果不其然，hive查询数据全部错乱， 查询资料发现--hive-delims-replacement（替换/n,/r等符号用你指定的字符）和--hive-drop-import-delims参数。可添加上去发现并没有什么卵用，没有起作用。百度goole很久，终于发现一篇帖子，http://stackoverflow.com/questions/28076200/hive-drop-import-delims-not-removing-newline-while-using-hcatalog-in-sqoop</span><br style="font-family: tahoma, arial, 宋体; margin: 0px; padding: 0px; max-width: 100%; font-size: 14px;" /><span style="font-family: tahoma, arial, 宋体; margin: 0px; padding: 0px; max-width: 100%; font-size: 14px;">意思是要用--map-column-java参数来显示指定列为String类型。我的解决方案为 --map-column-java 我的CLOB列=String 果然，问题解决，换行符全部被去掉。不过听说改变存储格式 或许也可以避免这个问题，希望有着经验的大神来回答一下。总结下来就这么多，希望能帮助大家</span></p><img src ="http://www.blogjava.net/keweibo/aggbug/433144.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/keweibo/" target="_blank">Ke</a> 2018-04-03 18:01 <a href="http://www.blogjava.net/keweibo/articles/433144.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Sqoop&amp;Hive，解决ERROR hive.HiveConfig: Could not load org.apache.hadoop.hive.conf.HiveConf. Make sure HIVE_CONF_DIR is set correctly. </title><link>http://www.blogjava.net/keweibo/articles/433143.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Tue, 03 Apr 2018 08:56:00 GMT</pubDate><guid>http://www.blogjava.net/keweibo/articles/433143.html</guid><wfw:comment>http://www.blogjava.net/keweibo/comments/433143.html</wfw:comment><comments>http://www.blogjava.net/keweibo/articles/433143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/keweibo/comments/commentRss/433143.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/keweibo/services/trackbacks/433143.html</trackback:ping><description><![CDATA[解决方法：<br />在 $SQOOP_HOME/lib目录下执行以下命令<br /><div>ln -s &nbsp;/app/soft/apache-hive-2.3.2-bin/lib/hive-exec-2.3.2.jar &nbsp; hive-exec-2.3.2.jar</div><div></div><code style="margin: 0px 2px; padding: 3px 4px; border-radius: 3px; font-family: Menlo, Monaco, Consolas, &quot;Andale Mono&quot;, &quot;lucida console&quot;, &quot;Courier New&quot;, monospace; background-color: #f6f6f6; color: #1a1a1a; font-size: 16px; white-space: pre-wrap;"></code><img src ="http://www.blogjava.net/keweibo/aggbug/433143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/keweibo/" target="_blank">Ke</a> 2018-04-03 16:56 <a href="http://www.blogjava.net/keweibo/articles/433143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>时间列转化&amp;&amp;动态指定分区Insert数据</title><link>http://www.blogjava.net/keweibo/articles/433141.html</link><dc:creator>Ke</dc:creator><author>Ke</author><pubDate>Mon, 02 Apr 2018 08:47:00 GMT</pubDate><guid>http://www.blogjava.net/keweibo/articles/433141.html</guid><wfw:comment>http://www.blogjava.net/keweibo/comments/433141.html</wfw:comment><comments>http://www.blogjava.net/keweibo/articles/433141.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/keweibo/comments/commentRss/433141.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/keweibo/services/trackbacks/433141.html</trackback:ping><description><![CDATA[--使用 from_unixtime 和 unix_timestamp 将时间列转化成想要的格式<br />--然后再Insert表，动态指定分区<br /><br /><div>insert overwrite table partition_user_table partition (dt) select id, account, name, create_time, &nbsp;from_unixtime(unix_timestamp(create_time,'yyyy/mm/dd'),'yyyymmdd') as dt from external_user_table;</div><div></div><img src ="http://www.blogjava.net/keweibo/aggbug/433141.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/keweibo/" target="_blank">Ke</a> 2018-04-02 16:47 <a href="http://www.blogjava.net/keweibo/articles/433141.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>