Skip to content

fix(rest-server): use Java's uppercase resourceType in error responses - #830

Open
jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/rest-uppercase-resource-type
Open

jackylee-ch wants to merge 1 commit into
apache:mainfrom
jackylee-ch:fix/rest-uppercase-resource-type

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

The five resourceType values this server emits are lowercase, but Java's
ErrorResponse declares them as DATABASE / TABLE, and a Java client
dispatches on the field: RESTCatalog#alterTable raises
TableNotExistException only when it equals RESOURCE_TYPE_TABLE, comparing
char by char through StringUtils#equals. With table neither branch matches,
so alterTable(ident, changes, false) on a missing table silently returns
instead of throwing. createBranch rethrows in the same position, so the
symptom varies by call.

They are now the uppercase constants. No effect on the Rust client, which keys
off the status code alone.

Left alone deliberately: the two column errors still answer 400 with
column:<table>. Making them Java's 404 plus COLUMN needs the Rust client
changed too, which would otherwise read a missing column as a missing table.

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