You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Chalcy <ch...@gmail.com> on 2012/08/06 21:06:41 UTC

Re: Unable to import tables from sqoop

Hi Prabhjot,

If you have not resolved this issue already, there is another way to do
this using 1.4.1 and that is by using --query tag and "select * from
mytable" like below. Import table does not work, but select * works in
1.4.1.

sqoop import --connect
'jdbc:sqlserver://mysqlserver;username=myuserid;password=mypassword;database=mydatabase'
--query 'select  * from mytable with(nolock) where $CONDITIONS'
--num-mappers 10 --split-by 'rowid' --target-dir /user/hadoop/mydir
 --hive-import --hive-drop-import-delims --hive-overwrite --hive-table
myhivetable --hive-partition-key mykey --hive-partition-value mypartition

Hope this helps!
Chalcy

On Wed, Jul 25, 2012 at 8:53 AM, Chalcy <ch...@gmail.com> wrote:

> I built sqoop 1.4.2_snapshot successfully and deployed along with cdh4 and
> it worked!!!.
>
> P.S. I saw Cheolsoo's email after replying this morning.
>
> Have a great day!
> Chalcy
>
>
> On Wed, Jul 25, 2012 at 6:44 AM, Chalcy <ch...@gmail.com> wrote:
>
>> Hi Prabhjot,
>>
>> sqoop 1.4.1 has a bug sqoop-480 and fixed on sqoop1.4.2  I am trying out
>> cdh4 and found this yesterday.  Looks like have to build sqoop1.4.2 from
>> snapshot.
>>
>> I did the same thing like you, could list databases and list tables, but
>> could not import data.
>>
>> https://issues.apache.org/jira/browse/SQOOP-480
>>
>> --Chalcy
>>
>>
>> On Wed, Jul 25, 2012 at 2:12 AM, iwannaplay games <
>> funnlearnforkids@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am using sqoop 1.4.1 and after succesfully installing and adding sql
>>> server connector i am able to get the list of databases from a server
>>> but am not able to import tables.
>>>
>>> Please see
>>> [hduser@master bin]$ sqoop import-all-tables --connect
>>> 'jdbc:sqlserver://<IP>;username=dev;password=d3v;database=Content'
>>>
>>> Warning: $HADOOP_HOME is deprecated.
>>>
>>> 12/07/25 16:52:40 INFO SqlServer.MSSQLServerManagerFactory: Using
>>> Microsoft's SQL Server - Hadoop Connector
>>> 12/07/25 16:52:40 INFO manager.SqlManager: Using default fetchSize of
>>> 1000
>>> 12/07/25 16:52:46 INFO tool.CodeGenTool: Beginning code generation
>>> 12/07/25 16:52:46 INFO manager.SqlManager: Executing SQL statement:
>>> SELECT TOP 1 * FROM [Batting]
>>> 12/07/25 16:52:47 INFO manager.SqlManager: Executing SQL statement:
>>> SELECT TOP 1 * FROM [Batting]
>>> 12/07/25 16:52:48 INFO orm.CompilationManager: HADOOP_HOME is
>>> /usr/local/hadoop/libexec/..
>>> Note:
>>> /tmp/sqoop-hduser/compile/e80807623f377f6d06f789e49d370a6c/Batting.java
>>> uses or overrides a deprecated API.
>>> Note: Recompile with -Xlint:deprecation for details.
>>> 12/07/25 16:52:48 INFO orm.CompilationManager: Writing jar file:
>>> /tmp/sqoop-hduser/compile/e80807623f377f6d06f789e49d370a6c/Batting.jar
>>> Exception in thread "main" java.lang.NoSuchMethodError:
>>>
>>> com.cloudera.sqoop.manager.ImportJobContext.setConnManager(Lcom/cloudera/sqoop/manager/ConnManager;)V
>>>         at
>>> com.microsoft.sqoop.SqlServer.MSSQLServerManager.importTable(MSSQLServerManager.java:142)
>>>         at
>>> org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:380)
>>>         at
>>> org.apache.sqoop.tool.ImportAllTablesTool.run(ImportAllTablesTool.java:64)
>>>         at org.apache.sqoop.Sqoop.run(Sqoop.java:145)
>>>         at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
>>>         at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:181)
>>>         at org.apache.sqoop.Sqoop.runTool(Sqoop.java:220)
>>>         at org.apache.sqoop.Sqoop.runTool(Sqoop.java:229)
>>>         at org.apache.sqoop.Sqoop.main(Sqoop.java:238)
>>>         at com.cloudera.sqoop.Sqoop.main(Sqoop.java:57)
>>>
>>> Anybody knows the solution
>>>
>>> Regards
>>> Prabhjot
>>>
>>
>>
>