Skip to content

Navigation Menu

Sign in
Sign up

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

Open
jackylee-ch wants to merge 3 commits into
apache:main from
jackylee-ch:feat/go-case-insensitive-read
Open

feat(go): support case-insensitive column names on reads #796
jackylee-ch wants to merge 3 commits into
apache:main from
jackylee-ch:feat/go-case-insensitive-read

Conversation

@jackylee-ch

@jackylee-ch jackylee-ch commented Sep 7, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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:

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

One switch name, WithCaseSensitive, on each object that owns a name resolution:
ReadBuilder for projection, PredicateBuilder for predicates. The split is
core'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_filter time,
while Go's WithFilter takes a resolved handle.

Table gains no method; PredicateBuilder.WithCaseSensitive returns a copy. The
ten predicates Go exposes now call the additive
paimon_predicate_*_with_case_sensitive entry points, the default passing true.
The six operators C gained in #523 but Go never bound stay out of scope.

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, 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.md section per half.

Comment thread bindings/go/predicate.go
type PredicateBuilder struct {
table *Table
table *Table
caseSensitive bool

@JingsongLi JingsongLi Sep 11, 2026

Copy link
Copy Markdown
Contributor

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?

@jackylee-ch jackylee-ch Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

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".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JingsongLi JingsongLi JingsongLi left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /