Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-8307

NPE in Calcite dialect when input PCollection has logical type in schema, from JdbcIO Transform

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Duplicate
    • 2.15.0
    • Missing
    • dsl-sql, io-java-jdbc
    • None

    Description

      An exception is thrown when SqlTransform is used with JdbcIO.

      Schema of the Source Table:

      CREATE TABLE actor (
      actor_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
      first_name VARCHAR(45) NOT NULL,
      last_name VARCHAR(45) NOT NULL,
      last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
      PRIMARY KEY (actor_id),
      KEY idx_actor_last_name (last_name)
      )ENGINE=InnoDB DEFAULT CHARSET=utf8; 

       

      Many of the Jdbc Types are converted to Logical_Types in Beam.

      Refer: https://github.com/apache/beam/blob/113461a4275eb28a101e416897ccd607aa51f83f/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/SchemaUtil.java#L102

      The initial observation is that this code: https://github.com/apache/beam/blob/113461a4275eb28a101e416897ccd607aa51f83f/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/utils/CalciteUtils.java#L207 is returning null.

       

      PFA exception_sqlTransform.txt

      Attachments

        1. exception_sqlTransform.txt
          4 kB
          Rahul Patwari

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rahul8383 Rahul Patwari
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h