Return-Path: X-Original-To: apmail-sqoop-dev-archive@www.apache.org Delivered-To: apmail-sqoop-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4510517EBF for ; Thu, 9 Oct 2014 07:04:28 +0000 (UTC) Received: (qmail 68088 invoked by uid 500); 9 Oct 2014 07:04:28 -0000 Delivered-To: apmail-sqoop-dev-archive@sqoop.apache.org Received: (qmail 68054 invoked by uid 500); 9 Oct 2014 07:04:28 -0000 Mailing-List: contact dev-help@sqoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sqoop.apache.org Delivered-To: mailing list dev@sqoop.apache.org Received: (qmail 68043 invoked by uid 99); 9 Oct 2014 07:04:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 07:04:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of abe@cloudera.com designates 209.85.218.54 as permitted sender) Received: from [209.85.218.54] (HELO mail-oi0-f54.google.com) (209.85.218.54) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 07:04:23 +0000 Received: by mail-oi0-f54.google.com with SMTP id v63so1366594oia.13 for ; Thu, 09 Oct 2014 00:04:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=HnfquQDcDS23FeaGWcxiqrPzLeUsGDG/fjnmbivbXRw=; b=exYIO9z9TdFsPKG8t3VjoplLxj8GPpzKPb2vVIrTK4PNBZm2vouESbO80Oq12ZM+jW d62sNxq37QDem9lPYFd6NGhp08qX+gTwxcPC8Kud2clqQA+lF1xgLLqwU419vbuOEVkK 7x4vW9tJaDClxOT2Xl+x2llZhpaVFUDKgrSe9OXy44YOwV1v7Ny1Uo+XusyLHVFINUSC szYYSlwyeJMn0Ig5/bhM/oXt7A1YpsQblHrnTcFrukjHC3R7gCLnYt4zlRllBMixUXk6 wxCeTguzy5ceIHgb/usS8/8y+ASy03L4BcFODwNmglBE1RM+aW4T2wjIY2sViUHb9LeS QtVg== X-Gm-Message-State: ALoCoQkLNQnpJYdavKydV0+zw65s72ZQVwbzyYc+SrV0d8xShF8A2gU4KUjY5NPGMuSb6LRqKZBc X-Received: by 10.60.220.169 with SMTP id px9mr19300070oec.67.1412838241964; Thu, 09 Oct 2014 00:04:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.154.230 with HTTP; Thu, 9 Oct 2014 00:03:41 -0700 (PDT) In-Reply-To: References: From: Abraham Elmahrek Date: Thu, 9 Oct 2014 00:03:41 -0700 Message-ID: Subject: Re: Sqoop2:Duplicate Column Name in Multiple Tables Import To: "dev@sqoop.apache.org" Content-Type: multipart/alternative; boundary=001a1133e0e489b1d00504f809e9 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133e0e489b1d00504f809e9 Content-Type: text/plain; charset=UTF-8 Thank you! On Wed, Oct 8, 2014 at 11:24 PM, shakun grover wrote: > Thanks Abe. > I have opened a bug in Jira i.e. > https://issues.apache.org/jira/browse/SQOOP-1572 > > On Thu, Oct 9, 2014 at 11:31 AM, Abraham Elmahrek > wrote: > > > Got it. This looks like a legitimate bug. Would you mind filing a Jira > > describing what you're seeing at https://issues.apache.org/jira. We're > > actively developing Sqoop2 and it's still in what I'd consider its > > developmental stages. I sent out a potential roadmap about a week ago, so > > hopefully Sqoop2 will be feature packed and more stable in the months to > > come. > > > > -Abe > > > > On Wed, Oct 8, 2014 at 10:51 PM, shakun grover > wrote: > > > > > Even with"AS" operator, it is not working: > > > > > > *Job:* > > > Name: > > > > > > Database configuration > > > > > > Schema name: > > > Table name: > > > Table SQL statement: select list.action,list.description,list.id AS > > > listId,cl.class,cl.id AS classId from test.action_list AS > > list,test.class > > > AS cl WHERE ${CONDITIONS} > > > Table column names: > > > Partition column name: listId > > > 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/5 > > > > > > *LOGS:* > > > org.apache.sqoop.common.SqoopException: SCHEMA_0002:Duplicate column > > name - > > > Column: FixedPoint{name=id,nullable=null,byteSize=null,unsigned=null} > > > at org.apache.sqoop.schema.Schema.addColumn(Schema.java:88) > > > at > > > > > > > > > org.apache.sqoop.connector.jdbc.GenericJdbcImportInitializer.getSchema(GenericJdbcImportInitializer.java:99) > > > at > > > > > > > > > org.apache.sqoop.connector.jdbc.GenericJdbcImportInitializer.getSchema(GenericJdbcImportInitializer.java:40) > > > at org.apache.sqoop.framework.JobManager.submit(JobManager.java:388) > > > at > > > > > > > > > org.apache.sqoop.handler.SubmissionRequestHandler.submissionSubmit(SubmissionRequestHandler.java:152) > > > at > > > > > > > > > org.apache.sqoop.handler.SubmissionRequestHandler.handleActionEvent(SubmissionRequestHandler.java:122) > > > at > > > > > > > > > org.apache.sqoop.handler.SubmissionRequestHandler.handleEvent(SubmissionRequestHandler.java:75) > > > at > > > > > > > > > org.apache.sqoop.server.v1.SubmissionServlet.handlePostRequest(SubmissionServlet.java:44) > > > at > > > > > > > > > org.apache.sqoop.server.SqoopProtocolServlet.doPost(SqoopProtocolServlet.java:63) > > > > > > > > > > > > On Thu, Oct 9, 2014 at 4:49 AM, Abraham Elmahrek > > wrote: > > > > > > > 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 > > > > 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 > > > > 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 > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Thanks & Regards, > > > Shakun Grover > > > > > > > > > -- > Thanks & Regards, > Shakun Grover > --001a1133e0e489b1d00504f809e9--