Uploaded image for project: 'Sqoop (Retired)'
  1. Sqoop (Retired)
  2. SQOOP-1238

SQLSyntaxErrorException on sqoop export when table column has space

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.4.3
    • None
    • sqoop2-client
    • None

    Description

      Inline with SQOOP-468, if a column name of table has a space in it, the sqoop export fails with ORA-00904.
      During debugging this becomes clear, preferred if either exception handling or messaging can be improved.

      Sqoop: 1.4.3 (cdh 4.3.1)
      command: sqoop export Dmapred.job.queue.name=<queue_name>-connect <connection> --username <username> --password <password> --table <table> --input-fields-terminated-by "|" --input-lines-terminated-by
      n --export-dir <export_dir> --input-null-string '
      N' --input-null-non-string 'N'

      error:
      java.io.IOException: java.sql.SQLSyntaxErrorException: ORA-00904: "COL_E": invalid identifier

      at org.apache.sqoop.mapreduce.AsyncSqlRecordWriter.close(AsyncSqlRecordWriter.java:192)
      at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.close(MapTask.java:567)
      at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:675)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
      at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
      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:1408)
      at org.apache.hadoop.mapred.Child.main(Child.java:262)

      on oracle -
      CREATE TABLE "FACT_TEST"
      (
      "COL_A" NUMBER,
      "COL_B" VARCHAR2(100),
      "COL_C" VARCHAR2(255),
      "COL_D" NUMBER,
      "COL_E " NUMBER,
      "COL_F" VARCHAR2(20)
      );
      select "COL_E " from fact_test; returns result

      Attachments

        Activity

          People

            Unassigned Unassigned
            rekhajoshm Rekha Joshi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: