在mysql中,有一个表,其中一些列具有空值。我想要sqoop将表导入到单元格中。当我进行sqoop导入时,我将在mysql表中包含空值的列中获取所有空值。
我正在做以下工作
sqoop import --connect jdbc:xxxxxx --username xxxx --password xxxx \
--query "select * from hive_db.xxxx where \$CONDITIONS" --null-string '' \
--null-non-string '' -m 1 --hive-import --hive-database hivedatabase \
--hive-table table --as-parquetfile --create-hive-table --target-dir /user/hive/warehouse/hivedatabase.db/table但我还是得到了空荡荡的蜂巢
为什么会发生这种情况?我怎样才能得到想要的结果。
发布于 2017-02-18 03:24:44
当您将数据作为文本文件导入以指定空值时,将使用它。
解决方法可能是更改查询中的空值。根据数据库引擎的不同,它可能是这样的(sql server sintax)
-查询“从yourTable where $conditions中选择isnull(columnB,''),isnull(columnB,‘’)等”
发布于 2019-08-20 13:09:01
sqoop import --connect jdbc:xxxxxx --username xxxx --password xxxx \
--query "select * from hive_db.xxxx where \$CONDITIONS" --null-string " " \
--null-non-string " " -m 1 --hive-import --hive-database hivedatabase \
--hive-table table --as-parquetfile --create-hive-table --target-dir /user/hive/warehouse/hivedatabase.db/tablehttps://stackoverflow.com/questions/42310564
复制相似问题