[
https://issues.apache.org/jira/browse/SQOOP-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246578#comment-13246578
]
Cheolsoo Park commented on SQOOP-452:
-------------------------------------
Hi Prashant, this issue is now fixed by SQOOP-468, by which the boundary query
is changed
from
{code}
SELECT MIN(testtable.id), MAX(testtable.id) FROM ( ... ) AS t1
{code}
to
{code}
SELECT MIN(t1.id), MAX(t1.id) FROM ( ... ) AS t1
{code}
As SQOOP-468 is submitted, I am going to close this jira, but please feel free
to reopen it if you see further problems.
> Mysql free form queries fail if alias is not used.
> --------------------------------------------------
>
> Key: SQOOP-452
> URL: https://issues.apache.org/jira/browse/SQOOP-452
> Project: Sqoop
> Issue Type: Bug
> Components: connectors/mysql
> Affects Versions: 1.4.0-incubating
> Reporter: Prashant Gokhale
> Priority: Minor
>
> Command I am running:
> sqoop import --connect jdbc:mysql://<mysqlhost>/mysqltestdb --username xxx
> --password xxxx --query 'select testtable.id, testtable2.fname from testtable
> join testtable2 on (testtable.id = testtable2.id ) where testtable.id < 3 AND
> $CONDITIONS' --split-by testtable.id --target-dir joinresults
> Sqoop fails with this error message
> {noformat}
> 2/03/02 12:12:08 INFO db.DataDrivenDBInputFormat: BoundingValsQuery: SELECT
> MIN(testtable.id), MAX(testtable.id) FROM (select testtable.id as id,
> testtable2.fname as fname from testtable join testtable2 on (testtable.id =
> testtable2.id ) where testtable.id < 3 AND (1 = 1) ) AS t1
> 12/03/02 12:12:08 INFO mapreduce.JobSubmitter: Cleaning up the staging area
> /user/prashant/.staging/job_1330641624236_0016
> 12/03/02 12:12:09 ERROR security.UserGroupInformation:
> PriviledgedActionException as:prashant (auth:SIMPLE)
> cause:java.io.IOException:
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
> 'testtable.id' in 'field list'
> 12/03/02 12:12:09 ERROR tool.ImportTool: Encountered IOException running
> import job: java.io.IOException:
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column
> 'testtable.id' in 'field list'
> {noformat}
> The job runs successfully if I modify the query:
> sqoop import --connect jdbc:mysql://<mysqlhost>/mysqltestdb --username xxxx
> --password xxxx --query 'select t1.id as id, t2.fname as fname from testtable
> as t1 join testtable2 as t2 on (t1.id = t2.id ) where t1.id < 3 AND
> $CONDITIONS' --split-by t1.id --target-dir joinresults
> It would be nice to have it documented at least.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira