sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "arvind@cloudera.com" <arv...@cloudera.com>
Subject Re: [sqoop-user] Re: Unknown SQL data type - 9
Date Wed, 21 Dec 2011 18:12:44 GMT
[Moving the thread to sqoop-user@incubator.apache.org. Please subscribe to
this list]

The problem you originally saw was due to the fact that Sqoop does not have
a built-in splitter for NVARCHAR datatype. When you specified the bounding
value query, you bypassed the splitter selection at runtime which helped in
getting past this problem.

Another way you can get past this problem is by running the import using a
split-by column that is numeric type.

Thanks,
Arvind


On Wed, Dec 21, 2011 at 8:58 AM, Siddharth <s.siddharth87@gmail.com> wrote:

> Hi,
>
>    I was able to find a fix for this - not sure if it is the most
> elegant one but this was what I did : the bounding query that sqoop
> creates of the split-by option requires the columns to be a non-
> unicode data type. By changing that it did the import without
> complaining.
>    I would still like to know from the group if this is the only fix
> or is there a better one?
>
> Thanks
> siddharth
>
> On Dec 20, 4:57 pm, Siddharth <s.siddhart...@gmail.com> wrote:
> > Hi,
> >      I am trying to sqoop data from SQL Server into Hbase. One of the
> > fields is a Unicode data type (nvarchar). When I use sqoop to do the
> > import it errors out with the message "Unknown SQL data type - 9".
> >      When I import using the Hbase API I don't get any error and I am
> > able to query that row back as well. Any ideas on why it doesn't work
> > through sqoop.
> >
> > This is my sqoop command
> >
> > sqoop-import -D mapred.job.name=keywordimport -fs hdfs://localhost:8020
> > -jt hdfs://localhost:8021 --connect 'jdbc:sqlserver://
> > localhost;username=test;password=test;database=Traffic' --table
> > HbaseTemp --columns Key,Keyword --split-by Keyword  --hbase-table kw1
> > --hbase-row-key Keyword --column-family keywords1 --class-name
> > Keyword1
> >
> > Below is the error log
> >
> > 11/12/20 16:30:34 INFO db.DataDrivenDBInputFormat: BoundingValsQuery:
> > SELECT MIN([Keyword]), MAX([Keyword]) FROM [HbaseTemp]
> > 11/12/20 16:30:34 INFO mapred.JobClient: Cleaning up the staging area
> >
> hdfs://svr-pr-doop1/tmp/hadoop-mapred/mapred/staging/hdfs/.staging/job_201112161157_0007
> > 11/12/20 16:30:34 ERROR tool.ImportTool: Encountered IOException
> > running import job: java.io.IOException: Unknown SQL data type: -9
> >         at
> >
> com.cloudera.sqoop.mapreduce.db.DataDrivenDBInputFormat.getSplits(DataDrivenDBInputFormat.java:
> > 204)
> >         at
> > org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:944)
> >         at
> > org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:961)
> >         at org.apache.hadoop.mapred.JobClient.access
> > $500(JobClient.java:170)
> >         at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:
> > 880)
> >         at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:
> > 833)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at javax.security.auth.Subject.doAs(Subject.java:396)
> >         at
> >
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:
> > 1127)
> >         at
> > org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:
> > 833)
> >         at org.apache.hadoop.mapreduce.Job.submit(Job.java:476)
> >         at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:
> > 506)
> >         at
> > com.cloudera.sqoop.mapreduce.ImportJobBase.runJob(ImportJobBase.java:
> > 123)
> >         at
> > com.cloudera.sqoop.mapreduce.ImportJobBase.runImport(ImportJobBase.java:
> > 183)
> >         at
> > com.cloudera.sqoop.manager.SqlManager.importTable(SqlManager.java:407)
> >         at
> >
> com.microsoft.sqoop.SqlServer.MSSQLServerManager.importTable(MSSQLServerManager.java:
> > 145)
> >         at
> > com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:382)
> >         at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:455)
> >         at com.cloudera.sqoop.Sqoop.run(Sqoop.java:146)
> >         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
> >         at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:182)
> >         at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:221)
> >         at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:230)
> >         at com.cloudera.sqoop.Sqoop.main(Sqoop.java:239)
> >
> > Thanks
> > Siddharth
>
> --
> NOTE: The mailing list sqoop-user@cloudera.org is deprecated in favor of
> Apache Sqoop mailing list sqoop-user@incubator.apache.org. Please
> subscribe to it by sending an email to
> incubator-sqoop-user-subscribe@apache.org.
>

Mime
View raw message