Uploaded image for project: 'CDAP'
  1. CDAP
  2. CDAP-10492

Mysql source does not work if there is a semi-colon in the end of the SQL import or Count query

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Component/s: Pipelines
    • Labels:
      None
    • Release Notes:
      Fixed a bug in the database source where a semicolon at the end of the query would cause an error.
    • Rank:
      1|hzz2iv:

      Description

      If there is a semi-colon in the import or count query, the mysql source doesn't work.

      2015-10-29 15:27:41,116 - WARN  [Thread-35:o.a.h.m.LocalJobRunnerWithFix$Job@562] - Error cleaning up job: job_local11789101_0001
      java.lang.Exception: java.io.IOException: SQLException in nextKeyValue
              at org.apache.hadoop.mapred.LocalJobRunnerWithFix$Job.runTasks(LocalJobRunnerWithFix.java:465) ~[co.cask.cdap.cdap-app-fabric-3.2.1.jar:na]
              at org.apache.hadoop.mapred.LocalJobRunnerWithFix$Job.run(LocalJobRunnerWithFix.java:524) ~[co.cask.cdap.cdap-app-fabric-3.2.1.jar:na]
      java.io.IOException: SQLException in nextKeyValue
              at org.apache.hadoop.mapreduce.lib.db.DBRecordReader.nextKeyValue(DBRecordReader.java:239) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.jar:na]
              at co.cask.cdap.etl.common.ETLDBInputFormat$1.nextKeyValue(ETLDBInputFormat.java:96) ~[1446157657892-0/:na]
              at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:533) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.jar:na]
              at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:80) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.jar:na]
              at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:91) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.j
      ar:na]
              at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:91) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.j
      ar:na]
              at co.cask.cdap.internal.app.runtime.batch.MapperWrapper$1.nextKeyValue(MapperWrapper.java:144) ~[co.cask.cdap.cdap-app-fabric-3.2.1.jar:na]
              at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.jar:na]
              at co.cask.cdap.internal.app.runtime.batch.MapperWrapper.run(MapperWrapper.java:102) ~[co.cask.cdap.cdap-app-fabric-3.2.1.jar:na]
              at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.jar:na]
              at org.apache.hadoop.mapred.MapTask.run(MapTask.java:340) ~[org.apache.hadoop.hadoop-mapreduce-client-core-2.3.0.jar:na]
              at org.apache.hadoop.mapred.LocalJobRunnerWithFix$Job$MapTaskRunnable.run(LocalJobRunnerWithFix.java:243) ~[co.cask.cdap.cdap-app-fabric-3.2.1.jar:na]
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_79]
              at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_79]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_79]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_79]
              at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_79]
      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1 OFFSET 0' at line 1
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_79]
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_79]
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_79]
              at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_79]
              at com.mysql.jdbc.Util.handleNewInstance(Util.java:389) ~[1446157658664-0/:na]
              at com.mysql.jdbc.Util.getInstance(Util.java:372) ~[1446157658664-0/:na]
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980) ~[1446157658664-0/:na]
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3835) ~[1446157658664-0/:na]
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3771) ~[1446157658664-0/:na]
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) ~[1446157658664-0/:na]
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582) ~[1446157658664-0/:na]
              at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2535) ~[1446157658664-0/:na]
              at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1911) ~[1446157658664-0/:na]
              at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2034) ~[1446157658664-0/:na]
      
      

        Attachments

          Activity

            People

            • Assignee:
              ashau Albert Shau
              Reporter:
              sree Sreevatsan Raman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: