Skip to content

[FLINK-36561][table] Fix ResultSet.wasNull() not reflecting per-column null values in JDBC driver#28219

Open
Au-Miner wants to merge 1 commit into
apache:masterfrom
Au-Miner:FLINK-36561
Open

[FLINK-36561][table] Fix ResultSet.wasNull() not reflecting per-column null values in JDBC driver#28219
Au-Miner wants to merge 1 commit into
apache:masterfrom
Au-Miner:FLINK-36561

Conversation

@Au-Miner
Copy link
Copy Markdown
Contributor

What is the purpose of the change

Fix ResultSet.wasNull() in the Flink JDBC driver, which previously only tracked whether the whole row was null and so always returned false for individual null columns — violating the JDBC contract that wasNull() must reflect the value most recently read.

Brief change log

  • Update each column getter in FlinkResultSet (getString, getBoolean, getByte, getShort, getInt, getLong, getFloat, getDouble, getBytes, getObject, getBigDecimal) to set the wasNull flag from currentRow.isNullAt(...) (or the equivalent null check on the returned value) before returning. Label-based overloads and getDate/getTime/getTimestamp inherit the fix by delegation.

Verifying this change

Added FlinkResultSetTest#testWasNullReflectsPerColumnNullness, which reads a row of alternating null and non-null columns across BOOLEAN/TINYINT/SMALLINT/INT/BIGINT/FLOAT/DOUBLE/DECIMAL/STRING/BYTES/MAP and asserts that wasNull() flips to true after each null read and back to false after each non-null read.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? no

@Au-Miner Au-Miner marked this pull request as ready for review May 21, 2026 09:56
@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented May 21, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants