Imported Failed: Partition key TEST_EMP_CITY cannot be a column to import.
在sqoop import中指定查询时,将分区列保留在select语句的末尾。
select TEST_EMP_ID,TEST_EMP_NAME,TEST_EMP_DEPARTMENT,TEST_EMP_SALARY,TEST_EMP_CITY FROM EMP.dbo.TEST_EMP_TABLE where TEST_EMP_CITY = 'NOIDA' AND \$CONDITIONS
1条答案
按热度按时间uxhixvfz1#
您可以直接将数据导入配置单元表,并可以创建分区表并使用sqoop直接加载它。请查找以下代码:
如您所见,这个sqoop导入将在hive中创建一个分区表udb.employee\u partition\u table,并创建一个分区列employee\u city。
这将在配置单元中创建一个托管表,其中包含文本格式的数据。下面是配置单元表的架构:
你需要确定一些事情。使用配置单元导入时,配置单元分区键列名不应是数据库表的一部分。否则你会得到下面的错误。
在sqoop import中指定查询时,将分区列保留在select语句的末尾。
让我知道这是否适合你。