Mysql 替换配置单元列中的特殊字符

Mysql 替换配置单元列中的特殊字符,mysql,hive,special-characters,Mysql,Hive,Special Characters,我在mysql中有一个表,比如说emp 列名为emp.id、emp.name、emp.salary、emp.dno 现在,我执行sqoop导入并在单个语句中创建配置单元表emp 当我使用select*query查询配置单元表emp时 我得到了错误 Error while compiling statement: FAILED: RuntimeException java.lang.RuntimeException: cannot find field emp from [0:emp.id, 1:

我在mysql中有一个表,比如说emp

列名为emp.id、emp.name、emp.salary、emp.dno

现在,我执行sqoop导入并在单个语句中创建配置单元表emp

当我使用select*query查询配置单元表emp时

我得到了错误

Error while compiling statement: FAILED: RuntimeException java.lang.RuntimeException: cannot find field emp from [0:emp.id, 1:emp.name, 2:emp.salary, 3:emp.dno]
由于配置单元不支持特殊字符,如何修复此问题

我们可以用(下划线)替换(点)吗?因为配置单元支持列名中的下划线


如果是,那么我们该怎么做。

一旦sqoop导入完成,您可以尝试更改配置单元中的列名

ALTER TABLE EMP
CHANGE `emp.id` emp_id int

我这样做了,但我想在自己创建配置单元表时动态地这样做。您可以使用sqoop的
--query
选项在导入时更改coulmn名称。像'Sqoop import--connect jdbc:mysql://localhost:3306/retail_db --username retail_dba--password cloudera--e'选择
order.id
AS order_id FROM orderdot where$CONDITIONS'--hive import--m1--target dir/user/hive/warehouse/orderdot--hive table orderdot`我有50多列像上面的问题一样,我们如何在@Pushkr动态传递select参数