Skip to content

Session: session-c interface#17347

Open
hongzhi-gao wants to merge 2 commits intoapache:masterfrom
hongzhi-gao:feature/session-c-interface
Open

Session: session-c interface#17347
hongzhi-gao wants to merge 2 commits intoapache:masterfrom
hongzhi-gao:feature/session-c-interface

Conversation

@hongzhi-gao
Copy link
Copy Markdown
Contributor

@hongzhi-gao hongzhi-gao commented Mar 24, 2026

Description

What

Adds a C API (SessionC.h / SessionC.cpp) around the existing C++ Session / TableSession, for C/FFI callers without exposing C++ types.

Design

Opaque handles (CSession, CTableSession, CTablet, CSessionDataSet, CRowRecord); public symbols prefixed with ts_*.
TsStatus return codes + thread-local last error via ts_get_last_error().
Thin wrappers: convert C args → C++ types, map exceptions to status codes; reuse existing client logic (no duplicate Thrift layer).

Scope

Tree + table model: connect, metadata, inserts (record/tablet), queries, result iteration, deletes—aligned with current Session behavior.

This PR has:

self-reviewed
tests added or updated

Key files

client-cpp/src/main/SessionC.h, SessionC.cpp
client-cpp/src/test/main_c*.cpp, sessionC*IT.cpp

@hongzhi-gao hongzhi-gao changed the title session c Session: session-c interface Mar 24, 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