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
Open
Backport client fixes to rc/2.0.10: fix DATE NULL handling crash and add missing numeric getters for Column#18095hongzhi-gao wants to merge 2 commits into
hongzhi-gao wants to merge 2 commits into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport two C++ client fixes to
rc/2.0.10: stop treatingEMPTY_DATE_INT(10000101) as NULL when decoding query results so1000-01-01no longer crashes the C API, and add missing numeric widening getters onColumnclasses that the[column]IT already expected.Content1 ...
Fix DATE query crash: remove the
EMPTY_DATE_INTsentinel check inparseIntToDate; NULL DATE is determined by the TsBlock null bitmap only. HardenField::isNull()andts_row_record_get_date_int32()for invalid dates.Content2 ...
Cherry-pick
a2368b2(#17759): implementgetDouble()/ cross-type getters onIntColumn,FloatColumn, andLongColumnto align with Java TsFile and fixUnsupported operation: getDoublein[column]IT (and CALL INFERENCE FLOAT-as-DOUBLE reads).Content3 ...
Add IT coverage for querying
1000-01-01via C++ Session and C API ([dateMinYear]/[c_dateMinYear]).This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR
iotdb-client/client-cpp/src/session/Date.cppiotdb-client/client-cpp/src/include/Common.hiotdb-client/client-cpp/src/session/SessionC.cppiotdb-client/client-cpp/src/session/Column.cppiotdb-client/client-cpp/src/include/Column.hiotdb-client/client-cpp/test/cpp/sessionIT.cppiotdb-client/client-cpp/test/cpp/sessionCIT.cpp