Sqoop import error while importing data using join

sqoop
mysql

#1

I am trying to import data from mysql server to hdfs using sqoop. For that i am joining two tables of loudacre database i.e. accounts and accountdevice

query used:
Select first_name ,last_name,acct_num,city,state from accounts a JOIN accountdevice b on a.acct_num = b.account_id group by first_name ,last_name,acct_num,city,state having count(device_id) =2"

above query is running successfully on mysql server

however i am getting error while importing data as

ERROR manager.SqlManager: Error executing statement: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION b.account_id does not exist
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: FUNCTION b.account_id does not exist

sqoop command:

sqoop import
–connect jdbc:mysql://localhost/loudacre
–username=training
–password=training
–target-dir=/user/loudacre/test
–query " Select first_name ,last_name,acct_num,city,state from accounts a JOIN accountdevice b on a.acct_num = b.account_id $CONDITIONS group by first_name ,last_name,acct_num,city,state having count(device_id) =2"
–split-by acct_num


#2

I suppose it is not able to recognize acct_num as a key for splitting. It can be the reason as you are not specifying what table to use in the command. Try running the query without split-by parameter