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

defaults values missing for columns

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • Backlog
    • None
    • ibmi-connector
    • None
    • False
    • Hide

      None

      Show
      None
    • False

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      debezium-connector-ibmi

      What is the connector configuration?

      as per documentation

      What is the captured database version and mode of deployment?

      DB2 on prem

      What behavior do you expect?

      column defaults to be captured

      What behavior do you see?

      no defaults for any columns

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

      No it's never worked

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

      Can be provided

      How to reproduce the issue using our tutorial deployment?

      Create a table with default values

      Feature request or enhancement

      enhancement - supported for other connectors

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

      this makes it particularly difficult to support adding new columns to tables as avro by default will reject the new column as incompatible without a deafult value

      Implementation ideas (optional)

      This was not implemented as the iseries supports function default values e.g. system_time for timestamp, they appear in the metadata as a default but the literal "CURRENT_TIMESTAMP" is not a valid default for a timestamp

       

      documentation https://www.ibm.com/docs/en/i/7.6.0?topic=views-syscolumns

      suggests we could use the qsys2.syscolumns along with the HAS_DEFAULT, COLUMN_DEFAULT

      SELECT COLUMN_NAME, HAS_DEFAULT, COLUMN_DEFAULT FROM qsys2.syscolumns;

       

      According to this documentation there might be a simpler approach

      https://www.ibm.com/docs/en/i/7.5.0?topic=functions-sqlcolumns-get-column-information-table

       

       

      }}
      The column's default value. If the default value is a numeric literal, then this column contains the character representation of the numeric literal with no enclosing single quotation marks. If the default value is a character string, then this column is that string enclosed in single quotation marks. If the default value a pseudo-literal, such as for DATE, TIME, and TIMESTAMP columns, then this column contains the keyword of the pseudo-literal (for example, CURRENT DATE) with no enclosing quotation marks.

      If NULL is specified as the default value, then this column returns the word NULL, not enclosed in quotation marks. If the default value cannot be represented without truncation, then this column contains TRUNCATED with no enclosing single quotation marks. If no default value is specified, then this column is NULL.

      {{

       

      Based on this I propose we add default values where we only set the default if it's a literal value

      • in single quotes use the value as a literal - probably need to check how to handle types
      • NULL without quotes 
      • all numeric without quotes allow [0-9.-]

      Happy to look into this but it won't be immediate, these are my initial notes on it

              Unassigned Unassigned
              msillencefnz Martin Sillence
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: