Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7040

Oracle DDL parsing will fail if the DDL ends with a new line character

XMLWordPrintable

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      [2023-10-15 00:03:52,158] ERROR [sms-oracle.connector-2|task-0] Mining session stopped due to error. (io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource:260)
      io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement '
        CREATE TABLE "SMGW"."LG_DM_20231015" 
         (    "OP_MID" VARCHAR2(65) NOT NULL ENABLE, 
              "AP_ID" NUMBER(10,0), 
              "OP_ID" NUMBER(10,0), 
              "SP_ID" VARCHAR2(20), 
              "CLIENT_ID" VARCHAR2(20), 
              "MOBILE" VARCHAR2(32), 
              "ACCESS_CODE" VARCHAR2(50), 
              "EXT_NO" VARCHAR2(50), 
              "RD_FLAG" NUMBER(1,0), 
              "MSG_FORMAT" NUMBER(2,0), 
              "MSG_LENGTH" NUMBER(5,0), 
              "MSG_CONTENT" NVARCHAR2(2000), 
              "DELIVER_TIME" DATE, 
              "REPUSH_STATE" NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE, 
              "REPUSH_TIME" DATE, 
              "CLIENT_RESP_IP" VARCHAR2(256), 
              "CLIENT_RESP_TIME" DATE, 
              "CLIENT_RESP_RESULT" NUMBER(3,0), 
              "IS_ACTIVEPUSH" NUMBER(1,0), 
              "PUSH_DURATION" NUMBER(8,0), 
              "ACCESSCODE_FROM_SM" NUMBER(1,0), 
              "PROVINCE" NVARCHAR2(20), 
              "CITY" NVARCHAR2(20), 
              "ID" NVARCHAR2(32), 
              "CREATE_TIME" DATE DEFAULT SYSDATE NOT NULL ENABLE, 
              "MERGE_ID" NVARCHAR2(32), 
              "SM_DATE" DATE, 
              "SM_CONTENT" NVARCHAR2(2000), 
              "SIGN" NVARCHAR2(2000), 
              "UPDATE_SMCONTENT_TIME" DATE, 
              "SM_MID" NVARCHAR2(32), 
              "DM_CHECKMODE" NUMBER(2,0), 
               PRIMARY KEY ("ID") ENABLE
         ) ;
       ;'
      no viable alternative at input ';\n ;'
              at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43)
              at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
              at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:543)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
              at io.debezium.ddl.parser.oracle.generated.PlSqlParser.sql_script(PlSqlParser.java:2193)
              at io.debezium.connector.oracle.antlr.OracleDdlParser.parseTree(OracleDdlParser.java:73)
              at io.debezium.connector.oracle.antlr.OracleDdlParser.parseTree(OracleDdlParser.java:32)
              at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:78)
              at io.debezium.connector.oracle.antlr.OracleDdlParser.parse(OracleDdlParser.java:68)
              at io.debezium.connector.oracle.OracleSchemaChangeEventEmitter.emitSchemaChangeEvent(OracleSchemaChangeEventEmitter.java:84)
              at io.debezium.pipeline.EventDispatcher.dispatchSchemaChangeEvent(EventDispatcher.java:367)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.dispatchSchemaChangeEventAndGetTableForNewCapturedTable(AbstractLogMinerEventProcessor.java:1202)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.getTableForDataEvent(AbstractLogMinerEventProcessor.java:1099)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.handleDataEvent(AbstractLogMinerEventProcessor.java:1029)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.processRow(AbstractLogMinerEventProcessor.java:366)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.processResults(AbstractLogMinerEventProcessor.java:289)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.process(AbstractLogMinerEventProcessor.java:219)
              at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:241)
              at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:62)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:272)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:197)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:137)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
              at java.base/java.lang.Thread.run(Thread.java:1583)
      Caused by: org.antlr.v4.runtime.NoViableAltException
              at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
              at io.debezium.ddl.parser.oracle.generated.PlSqlParser.sql_script(PlSqlParser.java:2126)
              ... 22 more
      [2023-10-15 00:03:52,160] ERROR [sms-oracle.connector-2|task-0] Producer failure (io.debezium.pipeline.ErrorHandler:52)
      io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement '
        CREATE TABLE "SMGW"."LG_DM_20231015" 
         (    "OP_MID" VARCHAR2(65) NOT NULL ENABLE, 
              "AP_ID" NUMBER(10,0), 
              "OP_ID" NUMBER(10,0), 
              "SP_ID" VARCHAR2(20), 
              "CLIENT_ID" VARCHAR2(20), 
              "MOBILE" VARCHAR2(32), 
              "ACCESS_CODE" VARCHAR2(50), 
              "EXT_NO" VARCHAR2(50), 
              "RD_FLAG" NUMBER(1,0), 
              "MSG_FORMAT" NUMBER(2,0), 
              "MSG_LENGTH" NUMBER(5,0), 
              "MSG_CONTENT" NVARCHAR2(2000), 
              "DELIVER_TIME" DATE, 
              "REPUSH_STATE" NUMBER(1,0) DEFAULT 0 NOT NULL ENABLE, 
              "REPUSH_TIME" DATE, 
              "CLIENT_RESP_IP" VARCHAR2(256), 
              "CLIENT_RESP_TIME" DATE, 
              "CLIENT_RESP_RESULT" NUMBER(3,0), 
              "IS_ACTIVEPUSH" NUMBER(1,0), 
              "PUSH_DURATION" NUMBER(8,0), 
              "ACCESSCODE_FROM_SM" NUMBER(1,0), 
              "PROVINCE" NVARCHAR2(20), 
              "CITY" NVARCHAR2(20), 
              "ID" NVARCHAR2(32), 
              "CREATE_TIME" DATE DEFAULT SYSDATE NOT NULL ENABLE, 
              "MERGE_ID" NVARCHAR2(32), 
              "SM_DATE" DATE, 
              "SM_CONTENT" NVARCHAR2(2000), 
              "SIGN" NVARCHAR2(2000), 
              "UPDATE_SMCONTENT_TIME" DATE, 
              "SM_MID" NVARCHAR2(32), 
              "DM_CHECKMODE" NUMBER(2,0), 
               PRIMARY KEY ("ID") ENABLE
         ) ;
       ;'
      no viable alternative at input ';\n ;'
              at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43)
              at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
              at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:543)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310)
              at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136)
              at io.debezium.ddl.parser.oracle.generated.PlSqlParser.sql_script(PlSqlParser.java:2193)
              at io.debezium.connector.oracle.antlr.OracleDdlParser.parseTree(OracleDdlParser.java:73)
              at io.debezium.connector.oracle.antlr.OracleDdlParser.parseTree(OracleDdlParser.java:32)
              at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:78)
              at io.debezium.connector.oracle.antlr.OracleDdlParser.parse(OracleDdlParser.java:68)
              at io.debezium.connector.oracle.OracleSchemaChangeEventEmitter.emitSchemaChangeEvent(OracleSchemaChangeEventEmitter.java:84)
              at io.debezium.pipeline.EventDispatcher.dispatchSchemaChangeEvent(EventDispatcher.java:367)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.dispatchSchemaChangeEventAndGetTableForNewCapturedTable(AbstractLogMinerEventProcessor.java:1202)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.getTableForDataEvent(AbstractLogMinerEventProcessor.java:1099)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.handleDataEvent(AbstractLogMinerEventProcessor.java:1029)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.processRow(AbstractLogMinerEventProcessor.java:366)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.processResults(AbstractLogMinerEventProcessor.java:289)
              at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.process(AbstractLogMinerEventProcessor.java:219)
              at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:241)
              at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:62)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:272)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:197)
              at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:137)
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
              at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
              at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
              at java.base/java.lang.Thread.run(Thread.java:1583)
      Caused by: org.antlr.v4.runtime.NoViableAltException
              at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2028)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467)
              at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
              at io.debezium.ddl.parser.oracle.generated.PlSqlParser.sql_script(PlSqlParser.java:2126)
              ... 22 more

      What Debezium connector do you use and what version?

      debezium-connector-oracle 2.4

      What is the connector configuration?

      { "connector.class":"io.debezium.connector.oracle.OracleConnector", "database.dbname":"SMGW", "transforms.Reroute.type":"io.debezium.transforms.ByLogicalTableRouter", "tasks.max":"1", "transforms":"Reroute", "schema.include.list":"SMGW", "snapshot.max.threads":"5", "transforms.Reroute.topic.regex":"(.*)_[\\d]\{8}

      ",
      "schema.history.internal.store.only.captured.tables.ddl":"true",
      "database.port":"1521",
      "topic.prefix":"sms-oracle.connector-2",
      "transforms.Reroute.topic.replacement":"$1",
      "schema.history.internal.kafka.topic":"sms-oracle.schema-changes-2",
      "database.hostname":"192.168.0.38",
      "name":"sms-oracle.connector-2"
      }

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)
      BANNER
      Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

      What behaviour do you expect?

      <Your answer>

      What behaviour do you see?

      <Your answer>

      Do you see the same behaviour using the latest relesead Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      <Your answer>

      Do you have the connector logs, ideally from start till finish?

      (You might be asked later to provide DEBUG/TRACE level log)

      <Your answer>

      How to reproduce the issue using our tutorial deployment?

      <Your answer>

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      <Your answer>

      Implementation ideas (optional)

      <Your answer>

              ccranfor@redhat.com Chris Cranford
              wuyinhua21 wu yinhua (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: