Hello Everyone,
I am trying to import data using sqoop to Hive, but I am getting following error.
ERROR manager.SqlManager: Error executing statement: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that correspond
s to your MySQL server version for the right syntax to use near 'where (1 = 0)' at line 1
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where
(1 = 0)' at line 1
Code :
sqoop import --connect jdbc:mysql://ip-10-0-1-10.ec2.internal/BDHS_PROJECT --username labuser --password 'edureka' --query ' select date_
format(sp.Trading_date,'yyyy') AS Trading_year, date_format(sp.Trading_date,'MM') AS Trading_month, sp.Symbol, sc.Company_name as CompanyName, sc.Headquarter as State, sc.Sect
or as Sector, sc.Sub_industry as Sub_Industry, AVG(sp.Open) as Open, AVG(sp.Close) as Close, AVG(sp.Low) as Low, AVG(sp.High) as High, AVG(sp.Volume) as Volume from STOCK_PRIC
ES sp left join STOCK_COMPANIES sc on sp.Symbol = sc.Symbol group by Trading_year, Trading_month, CompanyName where $CONDITIONS' --hive-import --hive-table BDHS_PROJECT.stock -m 1;