Skip to content

[pull] master from prestodb:master#519

Merged
pull[bot] merged 2 commits intofishbone:masterfrom
prestodb:master
Jan 16, 2026
Merged

[pull] master from prestodb:master#519
pull[bot] merged 2 commits intofishbone:masterfrom
prestodb:master

Conversation

@pull
Copy link

@pull pull bot commented Jan 16, 2026

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 : )

hantangwangd and others added 2 commits January 16, 2026 09:45
## 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 ==
```
@pull pull bot locked and limited conversation to collaborators Jan 16, 2026
@pull pull bot added the ⤵️ pull label Jan 16, 2026
@pull pull bot merged commit 6616215 into fishbone:master Jan 16, 2026
21 of 23 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants