This is a bug fixes for put-snapshot code path, where UUID-extraction process is using tableId and databaseId from the request itself. Those ids, if directly obtained from top-level request body, can lost casing if the requests were from platform like Spark SQL. Since the underlying storage (e.g. HDFS ) is case sensitive in its path URL, we will need to ensure the original casing info when issue the first commit as part of CTAS is preserved in the process of UUID-extraction of the second commit.
The other parts in this PR is to ensure, when put is happening, the tableDto is not always built from scratch when there's existing object discovered by findById method previously. This is done by switch orElse method to orElseGet, in which the latter will only call the supplier lazily when the calling object is absent. This leads to a wasteful implementation as well as confusion on the code stack.
This PR also include:
Some refactoring to share code with existing code.
Ensure text-fixtures module has its repository horning case insensitive contract so that this behavior can be tested through embedded instances.
Testing the casing contract in both SQL and Catalog API.
Changes
[ ] Client-facing API Changes
[ ] Internal API Changes
[x] Bug Fixes
[ ] New Features
[ ] Performance Improvements
[ ] Code Style
[ ] Refactoring
[ ] Documentation
[ ] Tests
For all the boxes checked, please include additional details of the changes made in this pull request.
Testing Done
[ ] Manually Tested on local docker setup. Please include commands ran, and their output.
[x] Added new tests for the changes made.
[ ] Updated existing tests to reflect the changes made.
[ ] No tests added or updated. Please explain why. If unsure, please feel free to ask for help.
[ ] Some other form of testing like staging or soak time in production. Please explain.
For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.
Additional Information
[ ] Breaking Changes
[ ] Deprecations
[ ] Large PR broken into smaller PRs, and PR plan linked in the description.
For all the boxes checked, include additional details of the changes made in this pull request.
Summary
This is a bug fixes for put-snapshot code path, where UUID-extraction process is using
tableId
anddatabaseId
from the request itself. Those ids, if directly obtained from top-level request body, can lost casing if the requests were from platform like Spark SQL. Since the underlying storage (e.g. HDFS ) is case sensitive in its path URL, we will need to ensure the original casing info when issue the first commit as part of CTAS is preserved in the process of UUID-extraction of the second commit.The other parts in this PR is to ensure, when
put
is happening, thetableDto
is not always built from scratch when there's existing object discovered byfindById
method previously. This is done by switchorElse
method toorElseGet
, in which the latter will only call the supplier lazily when the calling object is absent. This leads to a wasteful implementation as well as confusion on the code stack.This PR also include:
text-fixtures
module has its repository horning case insensitive contract so that this behavior can be tested through embedded instances.Changes
For all the boxes checked, please include additional details of the changes made in this pull request.
Testing Done
For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.
Additional Information
For all the boxes checked, include additional details of the changes made in this pull request.