hive
alongwaywith
这个作者很懒,什么都没留下…
展开
-
hive load导入本地数据出现null
最近使用load导入数据的时候一直出现多行null。建议去查看一下 本地load 导入数据的txt文件的分隔符是否正确。如果分隔符与创表时所用的分隔符不一致的话,那么hive容易误判这里还有数据,但是识别不了就出现null了...原创 2021-03-28 16:07:52 · 1079 阅读 · 0 评论 -
解决 The specified datastore driver (“com.mysql.jdbc.Driver“)
最近启动hive的时候老是遇到了这个问题具体是上次上传hdfs的东西的时候删错东西了。简单来说原因是slave1的依赖包不见了。(我是一个master salve1和salve2,salve1是hive的服务机)所以最简单的方法就是从slave2中上传mysql-connector-java-5.1.47-bin.jarscp 复制过去就可以了scp /lib/mysql-connector-java-5.1.47-bin.jar root@slave1:/usr/hive/apache-hiv原创 2021-03-25 17:16:13 · 518 阅读 · 0 评论 -
sort by 分区的原理
原理很简单,根据你的给定的字段和之前设定的reduce值来分区比如说 我先设置成set mapreduce.job.reduces=3;然后将id 分成三个区,然后按成绩排序select * from score distribute by s_id sort by s_score;注:可能打印出来不是很明显,建议导成本地文件在看。切记要分隔符。比如说我的 id是1到11那么1到11对3取模取模值相同的就排在一起。...原创 2021-03-24 16:01:54 · 260 阅读 · 0 评论 -
解决 following columns have types incompatible with the existing columns in their respective position
解决 FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. The following columns have types incompatible with the existing columns in their respective positions :在hive 2.1.1这一版的hive已经放弃对colums的强转。也就是说:假原创 2021-03-22 19:58:46 · 9320 阅读 · 4 评论 -
解决 need to specify partition columns because the destination table is partitioned
原因是这个表是分区表,需要制定分区。即在后面加上 partition(分区=“”)原创 2021-03-22 17:27:25 · 9754 阅读 · 0 评论