From user-return-1762-apmail-sqoop-user-archive=sqoop.apache.org@sqoop.apache.org Wed Oct 9 12:49:48 2013 Return-Path: X-Original-To: apmail-sqoop-user-archive@www.apache.org Delivered-To: apmail-sqoop-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4CAF810648 for ; Wed, 9 Oct 2013 12:49:48 +0000 (UTC) Received: (qmail 85756 invoked by uid 500); 9 Oct 2013 12:49:47 -0000 Delivered-To: apmail-sqoop-user-archive@sqoop.apache.org Received: (qmail 85587 invoked by uid 500); 9 Oct 2013 12:49:41 -0000 Mailing-List: contact user-help@sqoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@sqoop.apache.org Delivered-To: mailing list user@sqoop.apache.org Received: (qmail 85579 invoked by uid 99); 9 Oct 2013 12:49:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 12:49:41 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.199.18.84] (HELO mail1.impetus.co.in) (203.199.18.84) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 12:49:36 +0000 Received: from MAIL2.impetus.co.in (192.168.100.8) by mail1.impetus.co.in (192.168.100.28) with Microsoft SMTP Server (TLS) id 14.2.318.4; Wed, 9 Oct 2013 18:19:13 +0530 Received: from MAIL3.impetus.co.in ([fe80::443f:4f25:6889:b268]) by Mail2.impetus.co.in ([fe80::9453:16e7:f5d0:4746%11]) with mapi id 14.02.0318.004; Wed, 9 Oct 2013 18:19:13 +0530 From: Vaibhav V Nirkhe To: "user@sqoop.apache.org" Subject: Issue in Sqoop Export from HDFS(Hbase data) to MySql Thread-Topic: Issue in Sqoop Export from HDFS(Hbase data) to MySql Thread-Index: AQHOxO30ujdF67aQwE2aBvNilO+WFg== Importance: high X-Priority: 1 Date: Wed, 9 Oct 2013 12:49:12 +0000 Message-ID: <879BEAEB95E74044838C7CE92AF24CD38CB06FCF@Mail3.impetus.co.in> Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.49.90] Content-Type: multipart/alternative; boundary="_000_879BEAEB95E74044838C7CE92AF24CD38CB06FCFMail3impetuscoi_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_879BEAEB95E74044838C7CE92AF24CD38CB06FCFMail3impetuscoi_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi , I am using Sqoop 1.4.3 on Hadoop 1.2.1 and trying to export HBase da= ta placed in HDFS to MySQL , however I am getting following ClassCastExcept= ion :- I am using following command :- sqoop export --connect jdbc:mysql://localhost:3306/OMS --username root -P -= -table CNT_REPORT_DATA --columns CUSTOMER_ID,MONTH --export-dir /user/hdus= er/esr_data --verbose -m 1 I guess Sqoop is trying to fetch the record by its key and not able to cast= the key :- java.lang.ClassCastException: org.apache.hadoop.hbase.io.ImmutableBytesWrit= able cannot be cast to org.apache.hadoop.io.LongWritable at org.apache.sqoop.mapreduce.CombineShimRecordReader.getCurrentKey(Com= bineShimRecordReader.java:95) at org.apache.sqoop.mapreduce.CombineShimRecordReader.getCurrentKey(Com= bineShimRecordReader.java:38) at org.apache.sqoop.mapreduce.CombineFileRecordReader.getCurrentKey(Com= bineFileRecordReader.java:79) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.getCurrentK= ey(MapTask.java:503) at org.apache.hadoop.mapreduce.MapContext.getCurrentKey(MapContext.java= :57) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145) at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper= .java:64) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInform= ation.java:1190) at org.apache.hadoop.mapred.Child.main(Child.java:249) I don't understand why the key is always expected to be LongWritable here ?= Please suggest asap . Thanks in advance, ________________________________ NOTE: This message may contain information that is confidential, proprietar= y, privileged or otherwise protected by law. The message is intended solely= for the named addressee. If received in error, please destroy and notify t= he sender. Any use of this email is prohibited when received in error. Impe= tus does not represent, warrant and/or guarantee, that the integrity of thi= s communication has been maintained nor that the communication is free of e= rrors, virus, interception or interference. --_000_879BEAEB95E74044838C7CE92AF24CD38CB06FCFMail3impetuscoi_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi ,
       I am using Sqoop 1.4.3 on Hadoop = 1.2.1 and trying to export HBase data placed in HDFS to MySQL , however I a= m getting following ClassCastException :-

I am using following command :-

sqoop export --connect jdbc:mysql://localhost:3306/OMS --username root -P -= -table CNT_REPORT_DATA --columns CUSTOMER_ID,MONTH  --export-dir /user= /hduser/esr_data --verbose -m 1

I guess Sqoop is trying to fetch the record by its key and not able to cast= the key :-

java.lang.ClassCastException: org.apache.hadoop.hbase.io.ImmutableBytesWrit= able cannot be cast to org.apache.hadoop.io.LongWritable
    at org.apache.sqoop.mapreduce.CombineShimRecordReader.ge= tCurrentKey(CombineShimRecordReader.java:95)
    at org.apache.sqoop.mapreduce.CombineShimRecordReader.ge= tCurrentKey(CombineShimRecordReader.java:38)
    at org.apache.sqoop.mapreduce.CombineFileRecordReader.ge= tCurrentKey(CombineFileRecordReader.java:79)
    at org.apache.hadoop.mapred.MapTask$NewTrackingRecordRea= der.getCurrentKey(MapTask.java:503)
    at org.apache.hadoop.mapreduce.MapContext.getCurrentKey(= MapContext.java:57)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:14= 5)
    at org.apache.sqoop.mapreduce.AutoProgressMapper.run(Aut= oProgressMapper.java:64)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask= .java:764)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364= )
    at org.apache.hadoop.mapred.Child$4.run(Child.java:255)<= br>     at java.security.AccessController.doPrivileged(Native Me= thod)
    at javax.security.auth.Subject.doAs(Subject.java:415)     at org.apache.hadoop.security.UserGroupInformation.doAs(= UserGroupInformation.java:1190)
    at org.apache.hadoop.mapred.Child.main(Child.java:249)

I don't understand why the key is always expected to be LongWritable here ?=   Please suggest asap .



Thanks in advance,











NOTE: This message may contain information that is confidential, proprietar= y, privileged or otherwise protected by law. The message is intended solely= for the named addressee. If received in error, please destroy and notify t= he sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant = and/or guarantee, that the integrity of this communication has been maintai= ned nor that the communication is free of errors, virus, interception or in= terference.
--_000_879BEAEB95E74044838C7CE92AF24CD38CB06FCFMail3impetuscoi_--