Skip to content

Adds support for reading at a given Delta Lake version or timestamp - #39758

Merged
chamikaramj merged 2 commits into
apache:masterfrom
chamikaramj:delta_read_version
Aug 21, 2026
Merged

Adds support for reading at a given Delta Lake version or timestamp#39758
chamikaramj merged 2 commits into
apache:masterfrom
chamikaramj:delta_read_version

Conversation

@chamikaramj

Copy link
Copy Markdown
Contributor

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @Abacn for label java.
R: @Abacn for label website.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@chamikaramj chamikaramj changed the title Adds support for deading at a given Delta Lake version or timestamp Adds support for reading at a given Delta Lake version or timestamp Aug 20, 2026
ExperimentalOptions.addExperiment(options, "use_runner_v2");

Map<String, String> hadoopConfig = new HashMap<>();
hadoopConfig.put("fs.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are duplicated codes. Can we move the creation of hadoop Configuration into a helper function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Engine engine = DefaultEngine.create(conf);

// Wait briefly to ensure timestamp is after version 0 commit
Thread.sleep(1000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sleep is generally unreliable especially on CI. Consider using a reliable way to detect initial setup is finished, e.g. poll the file system?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

readPipeline.run().waitUntilFinish();
}

@Test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is DeltaIOIT exercised by any GHA tests? Checking https://github.com/apache/beam/blob/master/.github/workflows/beam_PreCommit_Java_Delta_IO_Direct.yml it only runs :sdks:java:io:delta:build not :sdks:java:io:delta:integrationTest

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

File tableDir = tempFolder.newFolder("delta-table-read-version");
Engine engine = DefaultEngine.create(new org.apache.hadoop.conf.Configuration());

Schema schema = Schema.builder().addField("name", Schema.FieldType.STRING).build();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here, consider move repeated test data setup fixtures into a helper function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

@chamikaramj chamikaramj left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

readPipeline.run().waitUntilFinish();
}

@Test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Engine engine = DefaultEngine.create(conf);

// Wait briefly to ensure timestamp is after version 0 commit
Thread.sleep(1000);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

ExperimentalOptions.addExperiment(options, "use_runner_v2");

Map<String, String> hadoopConfig = new HashMap<>();
hadoopConfig.put("fs.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

File tableDir = tempFolder.newFolder("delta-table-read-version");
Engine engine = DefaultEngine.create(new org.apache.hadoop.conf.Configuration());

Schema schema = Schema.builder().addField("name", Schema.FieldType.STRING).build();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

/**
* Specifies the version of the Delta Lake table to read.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are these Javadoc removal intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah (just removed from the commit not the repo). We expect users to use the Managed I/O API. Documentation there is generated from what's in DeltaReadSchemaTransformProvider.

@chamikaramj

Copy link
Copy Markdown
Contributor Author

Thanks!

@chamikaramj
chamikaramj merged commit c101795 into apache:master Aug 21, 2026
25 of 26 checks passed
@chamikaramj
chamikaramj deleted the delta_read_version branch August 21, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants