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

DDL statement couldn't be parsed - Modify Column

XMLWordPrintable

    • False
    • False
    • Hide

      Run a MODIFY COLUMN ddl as above.

      Show
      Run a MODIFY COLUMN ddl as above.

       2021-10-20 06:48:29.821 ERROR [debezium-export,,,] 11405 --- [-master-01:3306] io.debezium.pipeline.ErrorHandler        : Producer failure io.debezium.DebeziumException: Error processing binlog event
       	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:366) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$25(MySqlStreamingChangeEventSource.java:855) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at com.github.shyiko.mysql.binlog.BinaryLogClient.notifyEventListeners(BinaryLogClient.java:1125) ~[mysql-binlog-connector-java-0.25.3.jar!/:0.25.3]
       	at com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:973) ~[mysql-binlog-connector-java-0.25.3.jar!/:0.25.3]
       	at com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:599) ~[mysql-binlog-connector-java-0.25.3.jar!/:0.25.3]
       	at com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:857) ~[mysql-binlog-connector-java-0.25.3.jar!/:0.25.3]
       	at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
       Caused by: io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'ALTER TABLE country.Country MODIFY COLUMN iso varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL' no viable alternative
      at input 'ALTER TABLE country.Country MODIFY COLUMN iso'
       	at io.debezium.antlr.ParsingErrorListener.syntaxError(ParsingErrorListener.java:43) ~[debezium-ddl-parser-1.7.0.Final.jar!/:1.7.0.Final]
       	at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at org.antlr.v4.runtime.DefaultErrorStrategy.reportNoViableAlternative(DefaultErrorStrategy.java:310) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:136) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:1194) ~[debezium-ddl-parser-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.ddl.parser.mysql.generated.MySqlParser.root(MySqlParser.java:922) ~[debezium-ddl-parser-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:72) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.parseTree(MySqlAntlrDdlParser.java:45) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:82) ~[debezium-ddl-parser-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.MySqlDatabaseSchema.parseDdl(MySqlDatabaseSchema.java:216) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.MySqlDatabaseSchema.parseStreamingDdl(MySqlDatabaseSchema.java:202) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleQueryEvent(MySqlStreamingChangeEventSource.java:573) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.lambda$execute$14(MySqlStreamingChangeEventSource.java:827) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final]
       	at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.handleEvent(MySqlStreamingChangeEventSource.java:349) ~[debezium-connector-mysql-1.7.0.Final.jar!/:1.7.0.Final] 	... 6 common frames omitted
       Caused by: org.antlr.v4.runtime.NoViableAltException: null
       	at org.antlr.v4.runtime.atn.ParserATNSimulator.noViableAlt(ParserATNSimulator.java:2026) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:467) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393) ~[antlr4-runtime-4.8.jar!/:4.8]
       	at io.debezium.ddl.parser.mysql.generated.MySqlParser.sqlStatements(MySqlParser.java:996) ~[debezium-ddl-parser-1.7.0.Final.jar!/:1.7.0.Final] 	... 15 common frames omitted
      
      

      Background: to handle the upcoming deprecation of the utf8 (utf8mb3) characted set of MySQL [1] we have earlier been executing steps [i-v].
      We are now at step 1) adjusting the collation of some table columns. (Later on we will need to run steps [A-C] if we choose to fine tune the collations used.) and we see we run into troubles now at step 1) regarding debezium.

      -- Excuted at utf8(mb3)->utf8mb4 migration:
      i) ALTER DATABASE mydb DEFAULT CHARACTER SET = 'utf8mb4' DEFAULT COLLATE = 'utf8mb4_bin';
      ii) ALTER TABLE mydb.mytable DEFAULT CHARACTER SET 'utf8mb4' DEFAULT COLLATE 'utf8mb4_bin';
      iii) ALTER TABLE mydb.mytable CONVERT TO CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_bin', TABLESPACE = myts;
      iv) ALTER TABLE mydb.mytable MODIFY COLUMN mycolumn [...] CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci' [...];
      v) ALTER TABLE mydb.mytable TABLESPACE = innodb_file_per_table ENGINE = InnoDB;
      -- Adjustments:
      1) ALTER TABLE mydb.mytable MODIFY COLUMN mycolumn [...] CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci' [...];
      -- To be executed later on:
      A) ALTER DATABASE mydb DEFAULT CHARACTER SET = 'utf8mb4' DEFAULT COLLATE = 'utf8mb4_0900_bin';
      B) ALTER TABLE mydb.mytable DEFAULT CHARACTER SET 'utf8mb4' DEFAULT COLLATE 'utf8mb4_0900_bin';
      C) ALTER TABLE mydb.mytable MODIFY COLUMN mycolumn [...] CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_0900_bin' [...];
      

      [1] - https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8.html

              anmohant Anisha Mohanty
              epirealer Anders Engström (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: