Sqoop eval issue


#1

Hello,

I tried running the following swoop command on the lab console, just to validate my write permissions:

sqoop eval --connect jdbc:mysql://ms.itversity.com/retail_export --username retail_user --password itversity --query “CREATE TAB
LE dummy (i INT)”

However, I received the following error:

18/08/15 03:22:02 WARN tool.EvalSqlTool: SQL exception executing statement: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘dummy’ already ex
ists
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2820)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2159)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1383)
at org.apache.sqoop.tool.EvalSqlTool.run(EvalSqlTool.java:68)
at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225)
at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
at org.apache.sqoop.Sqoop.main(Sqoop.java:243)

Can you please confirm that we do not have write permissions on the itversity lab, as the video :run queries on MySQL using eval" shows we can?

Many thanks,
Patrick


#2

table dummy already exist. Please try with some other table name like dummy232


#3

Thank you! However, when I run other queries such as INSERT or SELECT on a table which I have created, I generation error. For example, when I run:

sqoop eval /
–connect jdbc:mysql://ms.itversity.com/retail_export /
–username retail_user > --password itversity /
–query “SELECT * FROM dummy69102”

I receive the following error:

18/08/15 06:33:18 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.6.5.0-292
18/08/15 06:33:18 ERROR tool.BaseSqoopTool: Error parsing arguments for eval:
18/08/15 06:33:18 ERROR tool.BaseSqoopTool: Unrecognized argument: jdbc:mysql://ms.itversity.com/retail_export
18/08/15 06:33:18 ERROR tool.BaseSqoopTool: Unrecognized argument: retail_user
18/08/15 06:33:18 ERROR tool.BaseSqoopTool: Unrecognized argument: itversity
18/08/15 06:33:18 ERROR tool.BaseSqoopTool: Unrecognized argument: SELECT * FROM dummy69102

Can you please tell me what I am I doing wrong?

Many thanks,
Patrick