-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Materialized View GRACE PERIOD #15842
Conversation
676073f
to
27e300e
Compare
27e300e
to
84ad01d
Compare
fbfaeb4
to
d227435
Compare
CI #12535 |
d3090b3
to
1166c44
Compare
1166c44
to
62801b9
Compare
This comment was marked as outdated.
This comment was marked as outdated.
62801b9
to
5c781a7
Compare
ae7c300
to
558d586
Compare
just rebased, still ready for review |
core/trino-main/src/main/java/io/trino/execution/CreateMaterializedViewTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/CreateMaterializedViewTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/CreateMaterializedViewTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
core/trino-spi/src/main/java/io/trino/spi/connector/ConnectorMaterializedViewDefinition.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
core/trino-spi/src/main/java/io/trino/spi/connector/InMemoryRecordSet.java
Show resolved
Hide resolved
plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergMetadata.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
// Can be negative | ||
// TODO should we compare lastFreshTime with session.start() or with current time? The freshness is calculated with respect to current state of things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most predictable would be to cache freshness
within a session and compare agains session start time.
But IDK if there are case when we compute the value within single sessions more than once. If not then it probably does not matter much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will leave this as is
558d586
to
4c04aaa
Compare
thanks @losipiuk for you review. |
Expose the GRACE PERIOD in `ConnectorMaterializedViewDefinition` so that connectors can store the information.
4c04aaa
to
0c8cd1a
Compare
Let connector inform the engine how fresh the materialized view is. This is required to implement materialized view handling as per the new GRACE PERIOD syntax definition. Note: the property is called "last fresh time" and not "last refresh time". This is in support for connectors which know when view became no longer fresh. For example, a materialized view may have been refreshed a day ago, but only an hour ago one of its base tables changed. Then the materialized view is stale and "last fresh time" is one hour ago, not one day ago.
0c8cd1a
to
da7da28
Compare
unrelated, ignored |
Description
Building on top of syntax added in #15104, fulfilling the important part of #15326, this PR delivers GRACE PERIOD support in the engine, exposing it to connectors and supporting it in Iceberg materialized views.
Additional context and related issues
Fixes #15326
Fixes #11698
Release notes