Skip to content

Fix C++ client reading FLOAT inference columns declared as DOUBLE#17759

Open
hongzhi-gao wants to merge 3 commits into
apache:masterfrom
hongzhi-gao:fix/cpp-query-ainode
Open

Fix C++ client reading FLOAT inference columns declared as DOUBLE#17759
hongzhi-gao wants to merge 3 commits into
apache:masterfrom
hongzhi-gao:fix/cpp-query-ainode

Conversation

@hongzhi-gao
Copy link
Copy Markdown
Contributor

@hongzhi-gao hongzhi-gao commented May 25, 2026

Summary

Fixes C++ client crash on CALL INFERENCE when reading results via RowRecord (e.g. toString()).

Inference result schema declares output as DOUBLE, but AINode writes FLOAT values in TsBlock (e.g. chronos2 float32, often RLE-encoded). C++ FloatColumn did not implement getDouble(), causing:

Unsupported operation: getDouble

Fix

Implement numeric widening getters on Column subclasses, aligned with Java TsFile:

Column Added getters
IntColumn getLong, getFloat, getDouble
FloatColumn getDouble
LongColumn getDouble

RunLengthEncodedColumn delegates to the inner column, so RLE-wrapped FLOAT inference output works automatically.

IoTDBRpcDataSet now calls column->getDouble() / getFloat() directly, same as the Java client.

Test plan

  • session_tests "[column]" — Float, RLE Float, Int, Long widening getters

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.
Avoid a separate test source file; keep the same coverage in session_tests.
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).
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