我在retail_db.customers表中插入了几条记录以测试Sqoop导入--null-string
和--null-non-string
。
这很好:
sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username retail_dba -P --table customers --null-string 'NA' --nul-non-string '-999' --delete-target-dir --warehouse-dir /user/cloudera/sqoop
这不起作用:
sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username retail_dba -P --table customers --null-string 'NA' --nul-non-string '-999' --delete-target-dir --warehouse-dir /user/cloudera/sqoop --as-avrodatafile
或:
sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username retail_dba -P --table customers --null-string 'NA' --nul-non-string '-999' --delete-target-dir --warehouse-dir /user/cloudera/sqoop --as-parquetfile