sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakub Havlík (JIRA) <j...@apache.org>
Subject [jira] [Commented] (SQOOP-2737) Cannot import table from Oracle with column with spaces in name
Date Thu, 04 Feb 2016 13:36:39 GMT

    [ https://issues.apache.org/jira/browse/SQOOP-2737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15132331#comment-15132331
] 

Jakub Havlík commented on SQOOP-2737:
-------------------------------------

Hi,

your patch does doesn't work properly. When importing the same table with your patch I'm getting
following error:
{code}
16/02/04 12:32:20 DEBUG manager.SqlManager: Using fetchSize for next query: 1000
16/02/04 12:32:20 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM "USER_MG_DEV_HAVLIKJ_A2.MD_BRICKS_TEST3"
t WHERE 1=0
16/02/04 12:32:20 ERROR manager.SqlManager: Error executing statement: java.sql.SQLSyntaxErrorException:
ORA-00972: identifier is too long

java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long

        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:777)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786)
        at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260)
        at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246)
        at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:327)
        at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1846)
        at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1646)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
16/02/04 12:32:20 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:1652)
        at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
        at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
        at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
        at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
        at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
        at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
        at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
{code}
which is to be expected as just calling {{SELECT t.* FROM "USER_MG_DEV_HAVLIKJ_A2.MD_BRICKS_TEST3"
t WHERE 1=0}} is not valid in Oracle and does not work when executing directly in SQL.

> Cannot import table from Oracle with column with spaces in name
> ---------------------------------------------------------------
>
>                 Key: SQOOP-2737
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2737
>             Project: Sqoop
>          Issue Type: Bug
>          Components: connectors/oracle
>    Affects Versions: 1.4.5
>            Reporter: Jakub Havlík
>            Assignee: Sowmya Ramesh
>            Priority: Critical
>         Attachments: SQOOP-2737.V0.patch, options.txt, oracleDataCreate.sql, stdout.txt,
syslog.txt
>
>
> When importing database containing table(s) with spaces in column name(s) following error
is displayed:
> {code}
> Error: java.io.IOException: SQLException in nextKeyValue
> 	at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:277)
> 	at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:553)
> 	at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:80)
> 	at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:91)
> 	at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
> 	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
> 	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
> 	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at javax.security.auth.Subject.doAs(Subject.java:422)
> 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
> 	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
> Caused by: java.sql.SQLSyntaxErrorException: ORA-00923: FROM keyword not found where
expected
> 	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.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:111)
> 	at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:235)
> 	... 11 more
> {code}
> As a enterprise user I would expect that I can import tables with spaces in a column
name with no issues.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message