CREATE TEMPORARY TABLE spark_tblsUSING org.apache.spark.sql.jdbcOPTIONS (url 'jdbc:mysql://hadoop000:3306/hive?user=root&password=root',dbtable 'TBLS');
select TBL_ID, TBL_NAME from spark_tbls limit 5;TBL_ID TBL_NAME126 aaa96 abc
select TBL_ID, TBL_NAME from spark_tbls where TBL_ID=126;TBL_ID TBL_NAME126 aaa
select TBL_ID, TBL_NAME from spark_tbls where TBL_NAME='aaa';
报错:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'aaa' in 'where clause'
测试发现:只要是字符串类型的过滤条件均报错。
详见最新master分支的
在测试sparksql操作phoenix时,由于where条件中有字符串类型的值,就一直报错一直报错,后来用MySQL测试了下,发现也是类似的问题,跟踪了源代码发现是Filter出了问题。