Repository navigation
fix(catalog/glue): case insensitive type match - #480
Merged
Merged
Conversation
table_type and database_type key values are now compared against "ICEBERG" string in case-insensitive way (similar to how PyIceberg and Java implementations work).
zeroshade
reviewed
Jul 8, 2025
| } | ||
|
|
||
| if tblRes.Table.Parameters[tableTypePropsKey] != glueTypeIceberg { | ||
| if strings.ToUpper(tblRes.Table.Parameters[tableTypePropsKey]) != glueTypeIceberg { |
Member
There was a problem hiding this comment.
any particular reason to use ToUpper here and EqualFold below instead of just using EqualFold in both cases?
Contributor
Author
There was a problem hiding this comment.
no particular reason - changed in 9b918b6
zeroshade
approved these changes
Jul 8, 2025
Contributor
Author
|
thanks @zeroshade for the quick review! |
This was referenced Jun 23, 2026
prafulla-kiran
added a commit
to prafulla-kiran/iceberg-go
that referenced
this pull request
Jun 25, 2026
PR apache#480 made the Glue table_type check case-insensitive in getTable and filterTableListByType so iceberg-go would accept the lowercase "iceberg" value produced by PyIceberg and the AWS Glue Iceberg REST endpoint (issue apache#479). PR apache#537 (optimistic locking) later introduced a third call site, convertGlueToIceberg, with a strict != comparison against "ICEBERG". LoadTable -> getTable now passes case-insensitively but the subsequent convertGlueToIceberg rejects the same table, reproducing the symptom from apache#479 ("table X.Y is not an iceberg table" on a valid table). This brings convertGlueToIceberg in line with the other two sites and matches the case-insensitive behaviour in PyIceberg and the Java implementation. Adds TestGlueConvertGlueToIcebergCaseInsensitive mirroring the existing TestGlueGetTableCaseInsensitive.
prafulla-kiran
added a commit
to prafulla-kiran/iceberg-go
that referenced
this pull request
Jun 25, 2026
PR apache#480 made the Glue table_type check case-insensitive in getTable and filterTableListByType so iceberg-go would accept the lowercase "iceberg" value produced by PyIceberg and the AWS Glue Iceberg REST endpoint (issue apache#479). PR apache#537 (optimistic locking) later introduced a third call site, convertGlueToIceberg, with a strict != comparison against "ICEBERG". LoadTable -> getTable now passes case-insensitively but the subsequent convertGlueToIceberg rejects the same table, reproducing the symptom from apache#479 ("table X.Y is not an iceberg table" on a valid table). This brings convertGlueToIceberg in line with the other two sites and matches the case-insensitive behaviour in PyIceberg and the Java implementation. Adds TestGlueConvertGlueToIcebergCaseInsensitive mirroring the existing TestGlueGetTableCaseInsensitive.
laskoviymishka
pushed a commit
that referenced
this pull request
Jun 26, 2026
#1269) Fixes #1267 (related: #479, regressed by #537). ### Summary `convertGlueToIceberg` is the only remaining case-sensitive `table_type` check in `catalog/glue/glue.go` — the other two sites (`getTable`, `filterTableListByType`) already use `strings.EqualFold` since #480. This brings the third site in line so `LoadTable` accepts Glue tables written by PyIceberg or via the AWS Glue Iceberg REST endpoint (both emit lowercase `iceberg`), matching the case-insensitive semantics of the PyIceberg and Java Glue implementations. ### Why `LoadTable` → `getTable` now passes case-insensitively but the subsequent `convertGlueToIceberg` rejects the same table, reproducing the symptom from #479 (`table X.Y is not an iceberg table` on a valid Iceberg table). Originally flagged by @tommika in a comment on #479. ### Change - One-line fix at `catalog/glue/glue.go:703`: `!=` → `!strings.EqualFold(...)`. - New unit test `TestGlueConvertGlueToIcebergCaseInsensitive` mirroring the existing `TestGlueGetTableCaseInsensitive`, covering `ICEBERG`, `iceberg`, `IcEbErG`, and a non-Iceberg negative case. Verified by reverting the fix and confirming the new test fails. ### Test plan - [x] `go test ./catalog/glue/` passes - [x] `golangci-lint run ./catalog/glue/...` clean - [x] New test fails without the fix, passes with it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
table_type and database_type key values are now
compared against "ICEBERG" string in case-insensitive way
(similar to how PyIceberg and Java implementations work).
Fixes #479