Skip to content

feat(go): support case-insensitive column names on reads - #796

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:feat/go-case-insensitive-read
Open

feat(go): support case-insensitive column names on reads#796
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:feat/go-case-insensitive-read

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

Follow-up to #496, which added the read-time case-sensitivity switch to the core,
the C ABI and Python and left "Go's own opt-in case-insensitive API" to a
follow-up. Measured from Go, fixture columns lowercase:

NewRead() after WithProjection([ID NAME]) -> Column ID does not exist in table ...
pb.Eq("ID", 1)                            -> Column 'ID' not found in schema fields ["id", "name"]

Neither half is reachable from Go, and the first message names the column absent
when only its case differs.

Brief change log

ReadBuilder.WithCaseSensitive covers projection. Predicates need their own
switch, because the core resolves a column when the predicate is built, so
Table.PredicateBuilderWithCaseSensitive carries the choice into every predicate
a builder produces — setting only the read-builder flag would leave the second
line above failing. The additive paimon_predicate_*_with_case_sensitive entry
points are bound for the ten predicates Go already exposes, with the default path
still calling the plain symbols. The six operators C gained in #523 but Go never
bound stay out of scope.

bool is this binding's first non-pointer scalar narrower than four bytes:
declared as a 1-byte type, written as an explicit 0/1 since a Rust bool admits
no other byte, and silently degrading to case-sensitive if got wrong.

Tests

Asserted in both directions: unset and true still reject uppercase names,
false resolves them, records come back with the schema's own spelling, and both
call orders agree. Each of the three predicate argument shapes has a case.

API and Format

Two new Go methods. No ABI, wire or storage change; the C symbols already exist.

Documentation

One go-binding.md section per half.

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