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

CHARACTER VARYING mysql identifier for varchar is not supported in debezium

    XMLWordPrintable

Details

    Description

      CHARACTER VARYING identifier used to identify varchar mysql type in the ddl statement is not supported by debezium in version 1.3.0. I checked the fixes in 1.3.1 as well, I don't think it is supported. This is a valid mysql ddl statement
      in mysql 5.7 and mysql 8.0

      mysql> show create table test_refresh_aux_complex_table\G;
      *************************** 1. row ***************************
             Table: test_refresh_aux_complex_table
      Create Table: CREATE TABLE `test_refresh_aux_complex_table` (
        `id` int(11) NOT NULL AUTO_INCREMENT,
        `test_column_0` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
        PRIMARY KEY (`id`)
      ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
      

      Exception in the debezium embedded engine

      ERROR [2020-12-03 07:55:48,701] io.debezium.embedded.EmbeddedEngine: Error while trying to run connector class 'io.debezium.connector.mysql.MySqlConnector'
      ! org.antlr.v4.runtime.NoViableAltException: null
      ! at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026)
      ! 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.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:956)
      ! ... 12 common frames omitted
      ! Causing: io.debezium.text.ParsingException: no viable alternative at input 'CREATE TABLE test_refresh_aux_complex_table ( `id` int(11) NOT NULL AUTO_INCREMENT , `t
      est_column_0` CHARACTER VARYING'
      ! at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:40)
      ! at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
      ! at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
      ! 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.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1154)
      ! at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:882)
      ! at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:68)
      ! at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:41)
      ! at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:80)
      ! at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:326)
      ! at io.debezium.connector.mysql.BinlogReader.handleQueryEvent(BinlogReader.java:807)
      ! at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:587)
      ! ... 5 common frames omitted
      ! Causing: org.apache.kafka.connect.errors.ConnectException: no viable alternative at input 'CREATE TABLE test_refresh_aux_complex_table ( `id` int(11) NOT NULL AUTO
      _INCREMENT , `test_column_0` CHARACTER VARYING'
      ! at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
      ! at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:207)
      ! at io.debezium.connector.mysql.BinlogReader.handleEvent(BinlogReader.java:604)
      ! at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1100)
      ! at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:951)
      ! at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:594)
      ! at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:838)
      ! at java.base/java.lang.Thread.run(Thread.java:834)
      
      
      

      Attachments

        Activity

          People

            jpechane Jiri Pechanec
            rajagopal-ravikumar Rajagopal Ravikumar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: