hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From R J <rj201...@yahoo.com>
Subject Re: Sqoop command syntax
Date Tue, 29 Jul 2014 17:18:06 GMT
I got them. Great! Many thanks for the help!!!


Regards,
Shu


On Tuesday, July 29, 2014 9:13 AM, Sivaram RL <sivaramrls@gmail.com> wrote:
 


Hi,

The file Generated is a by-product of the sqoop job which was run. The documentation says,

"A by-product of the import process is a generated Java class which can encapsulate one row
of the imported table. This class is used during the import process by Sqoop itself. The Java
source code for this class is also provided to you, for use in subsequent MapReduce processing
of the data. This class can serialize and deserialize data to and from the SequenceFile format.
It can also parse the delimited-text form of a record. These abilities allow you to quickly
develop MapReduce applications that use the HDFS-stored records in your processing pipeline.
You are also free to parse the delimiteds record data yourself, using any other tools you
prefer."

The output file should be present in the user's HDFS directory (/user/<user_name>).
--target-dir option will load the data into the specified directory.

Hope this helps :)

Regards,
Sivaram R L



On Tue, Jul 29, 2014 at 9:37 PM, R J <rj201244@yahoo.com> wrote:

Thanks a lot.
>
>
>I tried this and it worked without errors. It at the end created a file named 
>mytab1.java . I thought it would create a csv file that will represent all records of
the table.
>
>
>Could you please let me know how I could get such csv file?
>
>
>Thank you.
>
>
>
>
>
>
>
>On Tuesday, July 29, 2014 1:42 AM, R J <rj201244@yahoo.com> wrote:
> 
>
>
>Hi All,
>
>
>Could anyone please help me with the Sqoop command syntax? I tried the following command:
>
>
>/home/logger/scoop/sqoop-1.4.4.bin__hadoop-0.20/bin/sqoop import --driver oracle.jdbc.driver.OracleDriver
--connect jdbc:oracle:thin:@myoracleserver.com:1521/mysid --username scott --password tiger
--table mytab1
>
>
>I get the error:
>14/07/29 08:26:23 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM mytab1
AS t WHERE 1=0
>14/07/29 08:26:24 ERROR manager.SqlManager: Error executing statement: java.sql.SQLSyntaxErrorException:
ORA-00933: SQL command not properly ended
>
>java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
>
>        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
>        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
>        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
>        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
>        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
>        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
>        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)
>        at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:886)
>        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
>        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
>        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)
>        at
 oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3657)
>        at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1495)
>        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:674)
>        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:683)
>        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:240)
>        at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:223)
>        at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:347)
>        at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1277)
>        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1089)
>        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
>        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:396)
>        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
>        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)
>14/07/29 08:26:24 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException:
No columns to generate for ClassWriter
>        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1095)
>        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:96)
>        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:396)
>        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
>        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)
>
>
>
>
>
>
Mime
View raw message