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

Debezium does NOT support "unix_timestamp() as DEFAULT value


    • False
    • None
    • False

      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:

      What Debezium connector do you use and what version?

      <Your answer>

      What is the connector configuration?

      <Your answer>

      What is the captured database version and mode of depoyment?

      (E.g. on-premises, with a specific cloud provider, etc.)

      <Your answer>

      What behaviour do you expect?

      We have a table with a column configured as following

      `created_at` bigint(20) NOT NULL DEFAULT unix_timestamp()

      We expect that Debezium would handle this case and work normally.

      What behaviour do you see?

      Debezium fails to ingest the table with following error 

      org.apache.kafka.connect.errors.ConnectException: no viable alternative at input 'CREATE TABLE `table_a` (\
        `quote_id` varchar(32) NOT NULL,\
        `created_at` bigint(20) NOT NULL DEFAULT unix_timestamp'

      Looking into the code (https://github.com/debezium/debezium/blob/main/debezium-ddl-parser/src/main/antlr4/io/debezium/ddl/parser/mysql/generated/MySqlParser.g4#L2258-L2275) , we think this "DEFAULT unix_timestamp()" is just simply not supported case.

      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:


      We'd like to request that Antlr grammar is updated to support "DEFAULT unix_timestamp"



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

      Debezium can support this schema which is a valid one.

      `created_at` bigint(20) NOT NULL DEFAULT unix_timestamp()

      Implementation ideas (optional)

      <Your answer>

            Unassigned Unassigned
            hoavho Hoa Ho (Inactive)
            1 Vote for this issue
            6 Start watching this issue