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

Sqoop generates bounding vals queries with synatx error, when the number of mappers is greater than 1 and there is WITH UR option in the query for DB2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4.2, 1.4.4
    • None
    • build, connectors/generic

    Description

      To reproduce this error, execute the sqoop query connecting to DB2 with the option WITH UR and number of mappers > 1 and a split by column:

      Sample query
      sqoop import --connect jdbc:db2://<host>/hadoopguide --username <uname> --password <password>  --query 'SELECT A_I,B_I,C_I,D_I FROM A where $CONDITIONS WITH UR' --split-by A_I -m 8 --target-dir /user/sample/test_with_ur;
      

      Then the sqoop log is printed like :

      Sample query
      INFO db.DataDrivenDBInputFormat: BoundingValsQuery: SELECT MIN(A_I), MAX(A_I) FROM (SELECT A_I,B_I,C_I,D_I FROM A where  (1 = 1)  WITH UR) AS t1
      
      ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-199, SQLSTATE=42601, SQLERRMC=WITH;AND OR HAVING GROUP INTERSECT ORDER FETCH EXCEPT UNION ), DRIVER=
              at org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat.getSplits(DataDrivenDBInputFormat.java:167)
      

      Attachments

        1. 1096.patch
          20 kB
          Filippo

        Issue Links

          Activity

            People

              fcausa Filippo
              thomastechs Thomas Sebastian
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: