Skip to content
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

Time travel engine improvements #12542

Merged
merged 3 commits into from
Jun 14, 2022
Merged

Conversation

findepi
Copy link
Member

@findepi findepi commented May 25, 2022

No description provided.

@findepi findepi force-pushed the findepi/time-travel-api branch 2 times, most recently from 8c2ad46 to 2c8254b Compare June 7, 2022 10:36
@findepi findepi requested review from losipiuk, martint and hashhar and removed request for martint, losipiuk and hashhar June 7, 2022 10:37
@findinpath findinpath self-requested a review June 7, 2022 11:14
@findepi
Copy link
Member Author

findepi commented Jun 7, 2022

@losipiuk @martint mind taking a look ?

@findepi
Copy link
Member Author

findepi commented Jun 7, 2022

previously CI #12726

@findepi
Copy link
Member Author

findepi commented Jun 7, 2022

Rebasing after #10258 merged.

@findepi findepi force-pushed the findepi/time-travel-api branch from ec48889 to 1626d64 Compare June 7, 2022 20:12
@findepi
Copy link
Member Author

findepi commented Jun 8, 2022

CI #12726

@findepi
Copy link
Member Author

findepi commented Jun 8, 2022

Rebasing after #10258 merged.

adding small change to address #10258 (comment)
(i.e. this is why this PR got created)

@findepi findepi force-pushed the findepi/time-travel-api branch 2 times, most recently from e88535a to 50b12f2 Compare June 8, 2022 20:54
@findepi
Copy link
Member Author

findepi commented Jun 9, 2022

previous CI #12726

@findepi
Copy link
Member Author

findepi commented Jun 9, 2022

conflict, rebasing

@findepi findepi force-pushed the findepi/time-travel-api branch 2 times, most recently from a4766ac to c026a60 Compare June 10, 2022 08:13
@findepi findepi force-pushed the findepi/time-travel-api branch 3 times, most recently from bffdacd to 23580da Compare June 10, 2022 08:37
@findepi
Copy link
Member Author

findepi commented Jun 10, 2022

Build is green again. There were some changes (#12542 (comment)). @losipiuk or @martint PTAL.

* some weird way, serving as a smoke test for versioning. The purpose of the test is to validate the connector does proper validation.
*/
@Test
public void testTrySelectTableVersion()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I get the intent here. Is there expectation from specific connector to provide more verbose version of this test which actually verifies specifically which query should fail and which should not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My expectation is that a connector supporting time travel will have its own test covering it.
Here, we only cover cases and verify they don't end up with some NPE, IAE, ISE or something.

Copy link
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice

findepi added 3 commits June 14, 2022 10:54
Move versioned `getTableHandle` under the plain one.
When querying a table `FOR VERSION` there are these potential failure
scenarios

1. The table doesn't exist.
2. The connector doesn't support versioning at all.
3. The connector does not support given version type is not supported
   (e.g. supported versions are `bigint` (as in Iceberg) but user.
  provided a `varchar`)
4. The version type is fine, but requested version doesn't exist (e.g.
   bad Iceberg snapshot id).

Previously, when connector doesn't support versioning *and* table
doesn't exist, the message would indicate unsupported versioning, while
informing about table not being found is more appropriate.

To further differentiate between failure scenarios 2, 3 and 4, the
`ConnectorMetadata.isValidTableVersion` is removed. Instead, we rely on
`ConnectorMetadata.getTableHandle` to do proper checks (is versioning
supported? is version type supported? is version valid?). A sane
implementation will do such checks anyway, so this simplifies the SPI.
If a connector implements table versioning, it's going to implement
`getTableHandle` that accepts optional version specification. It
shouldn't need to still implement the `getTableHandle` without
versioning specification.
@findepi findepi force-pushed the findepi/time-travel-api branch from 23580da to 6b62b43 Compare June 14, 2022 08:55
@findepi
Copy link
Member Author

findepi commented Jun 14, 2022

(rebased to resolve conflict)

@findepi findepi merged commit 2a466ed into trinodb:master Jun 14, 2022
@github-actions github-actions bot added this to the 386 milestone Jun 14, 2022
@colebow
Copy link
Member

colebow commented Jun 14, 2022

Do we want release notes for this?

@findepi findepi deleted the findepi/time-travel-api branch June 15, 2022 09:58
@findepi findepi added the no-release-notes This pull request does not require release notes entry label Jun 15, 2022
@findepi
Copy link
Member Author

findepi commented Jun 15, 2022

Do we want release notes for this?

@colebow
I didn't think we need, but @homar reported this accidentally fixed history + table redirections.

@homar can you please suggest release note wording and also add a test?

@homar
Copy link
Member

homar commented Jun 15, 2022

Test is added in scope of #12831
Regarding release not something like:
Fixes time travel for Iceberg's tables redirected through hive.
Without this AS OF syntax didn't work for table with redirection

@findepi findepi removed the no-release-notes This pull request does not require release notes entry label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

7 participants