sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abraham Elmahrek <...@cloudera.com>
Subject Re: Sqoop2:Duplicate Column Name in Multiple Tables Import
Date Wed, 08 Oct 2014 23:19:57 GMT
Sorry,

I just noticed I didn't add the "AS" operator: "SELECT tbl1.name,
tb1.description, tbl1.id AS t1_id, tbl2.class tbl2.id AS t2_id FROM
test.table_1 as tbl1, test.table_2 as tbl2 WHERE ${CONDITIONS}".

On Wed, Oct 8, 2014 at 12:22 PM, Abraham Elmahrek <abe@cloudera.com> wrote:

> MySQL should support the "AS" operator. Could you try that?
>
> "SELECT tbl1.name, tb1.description, tbl1.id, tbl2.class tbl2.id FROM
> test.table_1 as tbl1, test.table_2 as tbl2 WHERE ${CONDITIONS}".
>
> On Wed, Oct 8, 2014 at 4:16 AM, shakun grover <s28sweet@gmail.com> wrote:
>
>> Hi All,
>>
>> I want to import multiple tables' data to HDFS. But while doing this, if
>> same column name is there in more than one table. It gives me exception
>> while starting the job.
>>
>> *Job:*
>> Name: testMultipleTables
>>
>> Database configuration
>>
>> Schema name:
>> Table name:
>> Table SQL statement: select tbl1.name , tbl1.description, tbl1.id,
>> tbl2.class, tbl2.id from test.table_1 as tbl1, test.table_2 as tbl2 WHERE
>> ${CONDITIONS}
>> Table column names:
>> Partition column name: tbl1.id
>> Nulls in partition column:
>> Boundary query:
>>
>> Output configuration
>>
>> Storage type:
>>   0 : HDFS
>> Choose: 0
>> Output format:
>>   0 : TEXT_FILE
>>   1 : SEQUENCE_FILE
>> Choose: 0
>> Output directory: /tmp/multitables/3
>>
>> *Exception while starting the job on the console:*
>> Exception has occurred during processing command
>> Server has returned exception: Exception: java.lang.Throwable Message:
>> GENERIC_JDBC_CONNECTOR_0002:Unable to execute the SQL statement
>>
>> *Exception in the logs:*
>>
>> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
>> Duplicate column name 'id'
>> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>
>> Could you please tell me a solution for this?
>> --
>> Thanks & Regards,
>> Shakun Grover
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message