[pull] master from prestodb:master#519
Merged
pull[bot] merged 2 commits intofishbone:masterfrom Jan 16, 2026
Merged
Conversation
## Description
This PR support specifying `sorted_by` argument when calling `rewrite_
data_files` procedure. It use the same syntax that is used to specify
the sorting property when creating a table:
```
CALL iceberg.system.rewrite_data_files('db', 'sample', 'partition_key = 1', ARRAY['join_date DESC NULLS FIRST', 'emp_id ASC NULLS LAST']);
CALL iceberg.system.rewrite_data_files(schema => 'db', table_name => 'sample', filter => 'partition_key = 1', sorted_by => ARRAY['join_date']);
```
It's especially useful when the table itself is not defined as a sorted
table, or its sorting property is somewhat insufficient. This
significantly optimizes scanning performance by allowing more irrelevant
data files to be filtered out.
## Motivation and Context
See issue #26824
## Impact
Users can specify `sort_by` argument when calling `rewrite_data_files`
procedure.
## Test Plan
Newly added test cases to show rewriting data files with specified sort
orders.
## Contributor checklist
- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.
- [ ] If adding new dependencies, verified they have an [OpenSSF
Scorecard](https://securityscorecards.dev/#the-checks) score of 5.0 or
higher (or obtained explicit TSC approval for lower scores).
## Release Notes
```
== NO RELEASE NOTE ==
```
…andling (#26949) Add a `catchableByTry` boolean flag to ErrorCode that allows errors to be declaratively marked as catchable by the TRY() function. This replaces hardcoded error code checks in TryFunction with a single flag check, making it extensible for future error types. Changes: - Add `catchableByTry` field to ErrorCode with JSON/Thrift serialization - Mark existing TRY-catchable errors in StandardErrorCode: DIVISION_BY_ZERO, INVALID_CAST_ARGUMENT, INVALID_FUNCTION_ARGUMENT, NUMERIC_VALUE_OUT_OF_RANGE - Mark all RestErrorCode errors as catchableByTry to handle remote function failures gracefully (REST_SERVER_ERROR, REST_SERVER_TIMEOUT, REST_SERVER_CONNECT_ERROR, etc.) - Simplify TryFunction.propagateIfUnhandled() to use isCatchableByTry() This allows any future error code to be marked as TRY-catchable at definition time without modifying TryFunction. ``` == NO RELEASE NOTE == ```
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )