Skip to content

feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters#17956

Merged
jt2594838 merged 3 commits into
apache:masterfrom
hongzhi-gao:feature/cpp-sessionc-date-blob-api
Jun 16, 2026
Merged

feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters#17956
jt2594838 merged 3 commits into
apache:masterfrom
hongzhi-gao:feature/cpp-sessionc-date-blob-api

Conversation

@hongzhi-gao

Copy link
Copy Markdown
Contributor

Summary

  • Add TSDate_C for typed TS_TYPE_DATE inserts in the C API
  • Add ts_row_record_get_date_int32 and ts_row_record_get_string_byte_length for query result readback
  • Fix TS_TYPE_DATE handling in typed insert (toCharPtrVec / freeCharPtrVec)
  • Extend c_rowDelete IT to cover DATE/BLOB and the new RowRecord getters

Test plan

  • ./session_c_tests "[c_rowDelete]"
  • mvn -P with-cpp -pl iotdb-client/client-cpp -am verify (sessionCIT passed)

Introduce TSDate_C for typed DATE inserts, ts_row_record_get_date_int32
and ts_row_record_get_string_byte_length, and expand c_rowDelete IT to
cover DATE/BLOB readback and deletion paths.
Add TS_TYPE_STRING readback assertions alongside explicit TEXT checks
in the RowRecord integration test.
@jt2594838 jt2594838 merged commit 3767282 into apache:master Jun 16, 2026
1 check passed

@Caideyipi Caideyipi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I found two issues before this is ready:

  1. TS_TYPE_BLOB is still serialized through strlen(src) in toCharPtrVec, and the downstream insert buffer path also uses strlen(values[i]). That silently truncates real binary payloads containing \0, while the PR title/API suggests BLOB support. The new test only uses the ASCII value blobXY, so it does not catch this. Please add a length-aware BLOB write path/API, or narrow the claim and add coverage for embedded-NUL data.

  2. ts_row_record_get_date_int32 can throw through the C ABI for the valid boundary date 1000-01-01. parseDateExpressionToInt allows year 1000, but parseIntToDate(10000101) treats that same value as the empty-date sentinel, so reading that date back produces an invalid IoTDBDate; calling the new getter then calls parseDateExpressionToInt and may throw out of a C-linkage function. The getter should not throw, or the sentinel/range conflict should be fixed, with a regression test for 1000-01-01.

@HTHou HTHou deleted the feature/cpp-sessionc-date-blob-api branch June 16, 2026 09:41
MileaRobertStefan pushed a commit to MileaRobertStefan/iotdb that referenced this pull request Jun 26, 2026
apache#17956)

* feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters

Introduce TSDate_C for typed DATE inserts, ts_row_record_get_date_int32
and ts_row_record_get_string_byte_length, and expand c_rowDelete IT to
cover DATE/BLOB readback and deletion paths.

* test(client-cpp): cover TEXT and STRING in c_rowDelete IT

Add TS_TYPE_STRING readback assertions alongside explicit TEXT checks
in the RowRecord integration test.

* chore(client-cpp): remove redundant TSDate_C comment
JackieTien97 pushed a commit that referenced this pull request Jun 29, 2026
#17956)

* feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters

Introduce TSDate_C for typed DATE inserts, ts_row_record_get_date_int32
and ts_row_record_get_string_byte_length, and expand c_rowDelete IT to
cover DATE/BLOB readback and deletion paths.

* test(client-cpp): cover TEXT and STRING in c_rowDelete IT

Add TS_TYPE_STRING readback assertions alongside explicit TEXT checks
in the RowRecord integration test.

* chore(client-cpp): remove redundant TSDate_C comment
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.

3 participants