Skip to content

Backport client fixes to rc/2.0.10: fix DATE NULL handling crash and add missing numeric getters for Column#18095

Open
hongzhi-gao wants to merge 2 commits into
apache:rc/2.0.10from
hongzhi-gao:rc/2.0.10
Open

Backport client fixes to rc/2.0.10: fix DATE NULL handling crash and add missing numeric getters for Column#18095
hongzhi-gao wants to merge 2 commits into
apache:rc/2.0.10from
hongzhi-gao:rc/2.0.10

Conversation

@hongzhi-gao

Copy link
Copy Markdown
Contributor

Description

Backport two C++ client fixes to rc/2.0.10: stop treating EMPTY_DATE_INT (10000101) as NULL when decoding query results so 1000-01-01 no longer crashes the C API, and add missing numeric widening getters on Column classes that the [column] IT already expected.

Content1 ...

Fix DATE query crash: remove the EMPTY_DATE_INT sentinel check in parseIntToDate; NULL DATE is determined by the TsBlock null bitmap only. Harden Field::isNull() and ts_row_record_get_date_int32() for invalid dates.

Content2 ...

Cherry-pick a2368b2 (#17759): implement getDouble() / cross-type getters on IntColumn, FloatColumn, and LongColumn to align with Java TsFile and fix Unsupported operation: getDouble in [column] IT (and CALL INFERENCE FLOAT-as-DOUBLE reads).

Content3 ...

Add IT coverage for querying 1000-01-01 via C++ Session and C API ([dateMinYear] / [c_dateMinYear]).


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR
  • iotdb-client/client-cpp/src/session/Date.cpp
  • iotdb-client/client-cpp/src/include/Common.h
  • iotdb-client/client-cpp/src/session/SessionC.cpp
  • iotdb-client/client-cpp/src/session/Column.cpp
  • iotdb-client/client-cpp/src/include/Column.h
  • iotdb-client/client-cpp/test/cpp/sessionIT.cpp
  • iotdb-client/client-cpp/test/cpp/sessionCIT.cpp

Stop treating EMPTY_DATE_INT as a null sentinel when decoding query results, since it encodes the valid date 1000-01-01 and caused C API reads to throw in parseDateExpressionToInt.
…ache#17759)

* Fix C++ client reading FLOAT inference columns declared as DOUBLE

CALL INFERENCE returns FLOAT data in TsBlock while the result schema
declares DOUBLE. Coerce by actual column type in getDouble/getFloat to
avoid Unsupported operation: getDouble when iterating RowRecord.

* Move column type coercion test into sessionIT.cpp

Avoid a separate test source file; keep the same coverage in session_tests.

* Implement numeric widening getters on C++ Column classes

Align with Java TsFile: IntColumn/FloatColumn/LongColumn support cross-type
getters (e.g. FloatColumn::getDouble). IoTDBRpcDataSet delegates directly to
column getters like the Java client. Fixes CALL INFERENCE crash when schema
declares DOUBLE but TsBlock stores FLOAT (including RLE-encoded columns).
@hongzhi-gao hongzhi-gao changed the title Rc/2.0.10 Backport client fixes to rc/2.0.10: fix DATE NULL handling crash and add missing numeric getters for Column Jul 2, 2026
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.

1 participant