Skip to content

fix(ilp): backwards incompatible way of writing null arrays#6396

Merged
bluestreak01 merged 1 commit intomasterfrom
puzpuzpuz_skip_null_array_columns_in_client
Nov 15, 2025
Merged

fix(ilp): backwards incompatible way of writing null arrays#6396
bluestreak01 merged 1 commit intomasterfrom
puzpuzpuz_skip_null_array_columns_in_client

Conversation

@puzpuzpuz
Copy link
Copy Markdown
Contributor

Sender implementations were encoding ColumnType.NULL when sending null array values to the server. This is problematic from the compatibility perspective since ColumnType.NULL changes each time we add a new column type, e.g. this code changed to 40 recently in v9.2. To fix this, senders now omit the field values for null arrays, so that the column is not included into the ILP message, like it works for other column types.

@puzpuzpuz puzpuzpuz self-assigned this Nov 14, 2025
@puzpuzpuz puzpuzpuz added Bug Incorrect or unexpected behavior ILP Issues or changes relating to Influx Line Protocol Compatibility Compatibility with third-party tools and services labels Nov 14, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 14, 2025

Walkthrough

Null handling logic refactored across Line Protocol sender implementations (TCP and HTTP, versions 2 and 3) by removing a private processNullArray helper method and replacing it with direct inline null checks. Additionally, decimal column methods now check for null object references before invoking isNull(), and a parser explicitly handles NULL element types with early exit.

Changes

Cohort / File(s) Summary
TCP/HTTP V2 senders
core/src/main/java/io/questdb/cutlass/line/LineTcpSenderV2.java, core/src/main/java/io/questdb/cutlass/line/http/LineHttpSenderV2.java
Migrated null-array handling from processNullArray helper to direct inline null checks in doubleArray, longArray, and arrayColumn methods. Removed private processNullArray(CharSequence, Object) method.
TCP/HTTP V3 senders
core/src/main/java/io/questdb/cutlass/line/LineTcpSenderV3.java, core/src/main/java/io/questdb/cutlass/line/http/LineHttpSenderV3.java
Added null-object checks in three decimalColumn overloads (Decimal256, Decimal128, Decimal64) to check value == null before invoking value.isNull(). Minor constructor formatting adjustments in V3 HTTP sender.
Array parser
core/src/main/java/io/questdb/cutlass/line/tcp/ArrayBinaryFormatParser.java
Explicit handling for NULL element type in ELEMENT_TYPE state; marks array as null and exits early, bypassing element type validation for NULL.
Test updates
core/src/test/java/io/questdb/test/cutlass/http/line/LineHttpSenderTest.java
Added third array column (a3 of type DOUBLE[][][]) to InsertNullArray test; updated table creation and expected output to reflect new column.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10–15 minutes

  • The changes follow consistent, repetitive patterns across multiple files, reducing reasoning overhead.
  • Verify that removing processNullArray does not introduce gaps in null-array handling paths.
  • Confirm NULL element type early exit in parser does not inadvertently skip validation for other scenarios.

Suggested labels

Java

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: fixing backward compatibility issues with how null arrays are encoded in ILP sender implementations.
Description check ✅ Passed The description clearly explains the problem (ColumnType.NULL encoding causing compatibility issues) and the solution (omitting null array fields from ILP messages).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch puzpuzpuz_skip_null_array_columns_in_client

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 10 / 18 (55.56%)

file detail

path covered line new line coverage
🔵 io/questdb/cutlass/line/LineTcpSenderV3.java 1 3 33.33%
🔵 io/questdb/cutlass/line/http/LineHttpSenderV3.java 2 5 40.00%
🔵 io/questdb/cutlass/line/LineTcpSenderV2.java 2 3 66.67%
🔵 io/questdb/cutlass/line/http/LineHttpSenderV2.java 5 7 71.43%

@bluestreak01
Copy link
Copy Markdown
Member

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 15, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
core/src/main/java/io/questdb/cutlass/line/tcp/ArrayBinaryFormatParser.java (1)

77-84: Consider adding version or timeline info to the TODO.

The TODO correctly identifies the backwards compatibility issue, but lacks specifics about when this code can be removed. Consider adding:

  • A target version for removal (e.g., "remove in v10.0")
  • A tracking issue link
  • Minimum client version that supports the new behavior

This will make it easier to track and eventually clean up this temporary workaround.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 813dc07 and 7d23af5.

📒 Files selected for processing (6)
  • core/src/main/java/io/questdb/cutlass/line/LineTcpSenderV2.java (4 hunks)
  • core/src/main/java/io/questdb/cutlass/line/LineTcpSenderV3.java (3 hunks)
  • core/src/main/java/io/questdb/cutlass/line/http/LineHttpSenderV2.java (7 hunks)
  • core/src/main/java/io/questdb/cutlass/line/http/LineHttpSenderV3.java (6 hunks)
  • core/src/main/java/io/questdb/cutlass/line/tcp/ArrayBinaryFormatParser.java (1 hunks)
  • core/src/test/java/io/questdb/test/cutlass/http/line/LineHttpSenderTest.java (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (34)
  • GitHub Check: New pull request (Coverage Report Coverage Report)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-other)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-pgwire)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-cairo-sub)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-cairo-root)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-fuzz2)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-fuzz1)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-griffin-sub)
  • GitHub Check: New pull request (Rust Test and Lint on linux-jdk17)
  • GitHub Check: New pull request (SelfHosted Running tests with cover on linux-griffin-root)
  • GitHub Check: New pull request (SelfHosted Griffin tests on linux-arm64)
  • GitHub Check: New pull request (SelfHosted Other tests on linux-x64-zfs)
  • GitHub Check: New pull request (SelfHosted Griffin tests on linux-x64-zfs)
  • GitHub Check: New pull request (SelfHosted Other tests on linux-x86-graal)
  • GitHub Check: New pull request (SelfHosted Griffin tests on linux-x86-graal)
  • GitHub Check: New pull request (Hosted Running tests on windows-other-2)
  • GitHub Check: New pull request (Hosted Running tests on windows-other-1)
  • GitHub Check: New pull request (Hosted Running tests on windows-pgwire)
  • GitHub Check: New pull request (Hosted Running tests on windows-cairo-2)
  • GitHub Check: New pull request (Hosted Running tests on windows-cairo-1)
  • GitHub Check: New pull request (Hosted Running tests on windows-fuzz2)
  • GitHub Check: New pull request (Hosted Running tests on windows-fuzz1)
  • GitHub Check: New pull request (Hosted Running tests on windows-griffin-sub)
  • GitHub Check: New pull request (Hosted Running tests on windows-griffin-base)
  • GitHub Check: New pull request (Hosted Running tests on mac-other)
  • GitHub Check: New pull request (Hosted Running tests on mac-pgwire)
  • GitHub Check: New pull request (Hosted Running tests on mac-cairo-fuzz)
  • GitHub Check: New pull request (Hosted Running tests on mac-cairo)
  • GitHub Check: New pull request (Hosted Running tests on mac-griffin)
  • GitHub Check: New pull request (SelfHosted Cairo tests on linux-x86-graal)
  • GitHub Check: New pull request (SelfHosted Other tests on linux-arm64)
  • GitHub Check: New pull request (SelfHosted Cairo tests on linux-x64-zfs)
  • GitHub Check: New pull request (SelfHosted Cairo tests on linux-arm64)
  • GitHub Check: New pull request (Check Changes Check changes)
🔇 Additional comments (15)
core/src/test/java/io/questdb/test/cutlass/http/line/LineHttpSenderTest.java (1)

2154-2181: LGTM! Test coverage expanded for null array handling.

The test correctly validates the new null array behavior by:

  • Adding a 3D array column (a3 DOUBLE[][][])
  • Sending null values for all array dimensions (1D, 2D, 3D)
  • Verifying null values are properly stored and retrieved

This confirms the backwards-compatible fix works correctly across different array dimensionalities.

core/src/main/java/io/questdb/cutlass/line/http/LineHttpSenderV2.java (4)

53-84: Constructor parameter formatting updated.

The constructor parameters are now formatted with one parameter per line. This improves readability but has no functional impact.


202-211: LGTM! Null array handling simplified and fixed.

The change from checking a method on the array object to checking if the reference itself is null correctly implements the backwards-compatible fix. Now null arrays are simply omitted from the ILP message instead of encoding an unreliable ColumnType.NULL value.

This aligns with the PR objective to fix backwards incompatibility issues where ColumnType.NULL numeric value changes with new column types.


245-254: LGTM! Consistent null handling for LongArray.

Same pattern as the DoubleArray method - checking for null reference and returning early to skip the field. This ensures consistent null array handling across all array types.


270-289: LGTM! Generic array method follows same null-skipping pattern.

The generic arrayColumn method now uses direct null checks instead of the removed processNullArray helper, ensuring all array column methods consistently skip null values rather than encoding them.

core/src/main/java/io/questdb/cutlass/line/LineTcpSenderV3.java (3)

69-82: LGTM! Null-safety improved for Decimal256 columns.

The added null reference check prevents potential NPE when a null Decimal256 object is passed. The method now safely handles both null references and Decimal objects with null values.


86-97: LGTM! Null-safety improved for Decimal128 columns.

Consistent null-safety pattern applied - checking both null reference and null value.


101-111: LGTM! Null-safety improved for Decimal64 columns.

All three decimal column overloads now have consistent null-safety checks.

core/src/main/java/io/questdb/cutlass/line/http/LineHttpSenderV3.java (4)

45-83: Constructor parameter formatting updated.

One parameter per line improves readability with no functional change.


139-152: LGTM! Null-safety improved for Decimal256 columns.

Consistent with the changes in LineTcpSenderV3, this prevents NPE when null Decimal256 references are passed.


156-167: LGTM! Null-safety improved for Decimal128 columns.

Consistent null-safety pattern applied across HTTP sender variant.


171-181: LGTM! Null-safety improved for Decimal64 columns.

All decimal column overloads now have consistent null-safety checks in both TCP and HTTP sender variants.

core/src/main/java/io/questdb/cutlass/line/LineTcpSenderV2.java (3)

114-123: LGTM! Null array handling simplified and fixed.

The change to check for null reference instead of calling a method on the array object correctly implements the backwards-compatible fix. This ensures null arrays are omitted from the ILP message rather than encoding an unreliable ColumnType.NULL value.


161-170: LGTM! Consistent null handling for LongArray.

Same pattern applied to LongArray - null references are detected early and the field is skipped.


231-250: LGTM! Generic array method updated consistently.

The generic arrayColumn method now uses direct null checks, ensuring all array methods in the TCP sender variant consistently handle nulls by skipping the field rather than encoding a value.

@bluestreak01 bluestreak01 merged commit b89ef48 into master Nov 15, 2025
41 checks passed
@bluestreak01 bluestreak01 deleted the puzpuzpuz_skip_null_array_columns_in_client branch November 15, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Incorrect or unexpected behavior Compatibility Compatibility with third-party tools and services ILP Issues or changes relating to Influx Line Protocol

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants