为什么hive和bigsql的1条记录中存在数据不匹配?

cs7cruho  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(329)

我已经创建了一个配置单元表并将其集成到bigsql中。在hive中,我的计数是正确的,但是在bigsql中,记录计数是额外的1。下面是我用来创建配置单元表的表属性。

create table test(name string,age int,sal float,city string,country string,emp_id int,increment int)
ROW FORMAT DELIMITED FIELDS TERMINATED  BY '|'
STORED AS TEXTFILE
LOCATION '/user/test'
tblproperties ("skip.header.line.count"="1");

我正在加载的文本文件在第一行有列名。所以我得用

tblproperties ("skip.header.line.count"="1");

当我在配置单元中执行计数查询时,得到的结果低于输出

Total MapReduce CPU Time Spent: 7 seconds 440 msec
OK
48203

但是,当我在bigsql中同步表时,我得到的数据少于count

+-------+
|     1 |
+-------+
| 48204 |

你知道我在哪里犯的错吗?
谢谢

lg40wkob

lg40wkob1#

我找到了解决这个问题的方法。

1) We need to create a temp hive table with tblproperties ("skip.header.line.count"="1");.
2) Load the file on this temp table.
3) create another table without tblproperties ("skip.header.line.count"="1");.
4) insert into tbl select * from temo_tbl;.

相关问题