[#2921] fix(catalog-lakehouse-iceberg): Add width param to bucket and truncate functions in Gravitino SortOrder #3530
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.
What changes were proposed in this pull request?
Add width param to bucket and truncate functions in Gravitino SortOrder.
for example:
change
bucket([id])
tobucket(10, id)
change
truncate([name])
totruncate(2, name)
Why are the changes needed?
SortOrder in Iceberg supports
FunctionExpression
, such asyear, month, bucket, truncate, etc
.truncate
andbucket
functions both have two parameters, such asbucket(10, col1), truncate(2, col2)
.However, in gravitino, when converting an iceberg sortorder with
bucket
ortruncate
to gravitino sortOrder, there is only oneparameter in
bucket
andtruncate
functions.This picture shows the details of the parameters of the
bucket
andtruncate
functions in gravitino sortorder, we can test it incom.datastrato.gravitino.catalog.lakehouse.iceberg.converter.TestFromIcebergSortOrder#testFromSortOrder
And if we want to convert the gravitino sortOrder with
bucket
ortruncate
to iceberg sortOrder, we will get the following error as thefirst param is missing.
Fix: #2921
Does this PR introduce any user-facing change?
No
How was this patch tested?
New UTs and ITs.