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

Oracle Connector failing due to ALTER TABLE for adding column with foreign key

XMLWordPrintable

    • False
    • None
    • False

      Oracle connector is failing due to ALTER TABLE with ADD COLUMN and ADD FOREIGN KEY statements. Example of query:

      ALTER TABLE TABLE_A 
      ADD TABLE_B_ID NUMBER(5)
      ADD FOREIGN KEY (TABLE_B_ID) REFERENCES TABLE_B (ID);
      

      Exception from Debezium connector log:

      org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.
          at io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:42)
          at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:181)
          at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:57)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:172)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:139)
          at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:108)
          at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: Multiple parsing errors
      io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'ALTER TABLE TABLE_A 
      ADD TABLE_B_ID NUMBER(5)
      ADD FOREIGN KEY (TABLE_B_ID) REFERENCES TABLE_B (ID);'
      mismatched input '(' expecting {'DISABLE', 'ENABLE', ';'}
      io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'ALTER TABLE TABLE_A 
      ADD TABLE_B_ID NUMBER(5)
      ADD FOREIGN KEY (TABLE_B_ID) REFERENCES TABLE_B (ID);'
      mismatched input 'TABLE_B_ID' expecting {'SELECT', '('}
          at io.debezium.antlr.AntlrDdlParser.throwParsingException(AntlrDdlParser.java:372)
          at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:95)
          at io.debezium.connector.oracle.antlr.OracleDdlParser.parse(OracleDdlParser.java:68)
          at io.debezium.connector.oracle.OracleSchemaChangeEventEmitter.emitSchemaChangeEvent(OracleSchemaChangeEventEmitter.java:85)
          at io.debezium.pipeline.EventDispatcher.dispatchSchemaChangeEvent(EventDispatcher.java:308)
          at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.handleSchemaChange(AbstractLogMinerEventProcessor.java:546)
          at io.debezium.connector.oracle.logminer.processor.memory.MemoryLogMinerEventProcessor.handleSchemaChange(MemoryLogMinerEventProcessor.java:187)
          at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.processRow(AbstractLogMinerEventProcessor.java:267)
          at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.processResults(AbstractLogMinerEventProcessor.java:239)
          at io.debezium.connector.oracle.logminer.processor.AbstractLogMinerEventProcessor.process(AbstractLogMinerEventProcessor.java:185)
          at io.debezium.connector.oracle.logminer.LogMinerStreamingChangeEventSource.execute(LogMinerStreamingChangeEventSource.java:168)
          ... 9 more
      

              anmohant Anisha Mohanty
              yaroslav.kovalchuk Yaroslav Kovalchuk (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: