【发布时间】:2017-01-04 13:43:10
【问题描述】:
我有两个 SPARK SQL 表如下,
表 1
email | client_ip | travelling_method | travelling_code
person1@abc.com |203.22.22.22 | Car | car001
person1@abc.com |203.22.22.22 | Jeep | jeep001
表2
email | client_ip | account_type | trav_code
person1@abc.com |203.22.22.22 | true | car
person1@abc.com |203.22.22.22 | false | jeep
我的查询如下,
SELECT table1.email, table1.client_ip, table1.travelling_method, table1.travelling_code, table2.account_type FROM table1 LEFT JOIN table2 ON table1.email = table2.email AND table1.client_ip = table2.client_ip AND table1.travelling_code LIKE CONCAT('%' ,table2.trav_code, '%') WHERE table1.email = 'person1@abc.com';
我编写了上面的查询以获得以下输出,但它抛出了一个异常。
想要的输出是:
email | client_ip | travelling_method | travelling_code| account_type
person1@abc.com |203.22.22.22 | Car | car001 | true
person1@abc.com |203.22.22.22 | Jeep | jeep001 | false
感谢有人可以帮助我指出我的查询中缺少什么。 :)
【问题讨论】:
-
你能再添加一个错误堆栈吗?你能用查询的最后一个和在哪里替换吗
标签: apache-spark apache-spark-sql spark-dataframe wso2-das