-
Notifications
You must be signed in to change notification settings - Fork 92
feat(go): support case-insensitive column names on reads - #796
feat(go): support case-insensitive column names on reads #796jackylee-ch wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we need to add this API? Only for GO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not Go-only: the split is core's and the C ABI's, both merged in #496, whose description left Go's half to a follow-up. Python needs a single switch only because its filter is a dict converted at with_filter time; Go's WithFilter takes an already-resolved handle, so the flag has to sit on the builder that produces the predicate.
Collapsed it into PredicateBuilder.WithCaseSensitive in 23e53fa so both halves share one switch name and Table gains no method. go test ./... in bindings/go green, including a new test pinning that neither switch reaches the other.
Replace Table.PredicateBuilderWithCaseSensitive with a WithCaseSensitive method on PredicateBuilder itself, returning a copy rather than mutating. Table gains no method, and both halves of the feature now share one switch name with ReadBuilder.WithCaseSensitive. Also pin the two contracts that were documented and nothing else: that the read builder's flag never reaches a predicate and vice versa, and that WithProjection rejects a name no casing can match. Move the one-byte bool rationale onto boolByte, where its four call sites can find it, and correct WithProjection's doc — "under either case mode" inverted the contract that the C side states as "under any case sensitivity".
Uh oh!
There was an error while loading. Please reload this page.
Purpose
Follow-up to #496, which added this read-time 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:
Neither half is reachable from Go, and the first message names the column absent
when only its case differs.
Brief change log
One switch name,
WithCaseSensitive, on each object that owns a name resolution:ReadBuilderfor projection,PredicateBuilderfor predicates. The split iscore's and the C ABI's, not Go's: the core resolves a column when the predicate is
built, so a read-builder flag cannot reach an already-built one. Python needs a
single switch only because its filter is a dict converted at
with_filtertime,while Go's
WithFiltertakes a resolved handle.Tablegains no method;PredicateBuilder.WithCaseSensitivereturns a copy. Theten predicates Go exposes now call the additive
paimon_predicate_*_with_case_sensitiveentry points, the default passingtrue.The six operators C gained in #523 but Go never bound stay out of scope.
Tests
Asserted in both directions: unset and
truestill reject uppercase names,falseresolves them, records come back with the schema's own spelling, and bothcall orders agree. Each of the three predicate argument shapes has a case, and one
test pins that neither switch reaches the other.
API and Format
Two new Go methods, one name. No ABI, wire or storage change; the C symbols
already exist.
Documentation
One
go-binding.mdsection per half.