Repository navigation
Conversation
claudevdm
marked this pull request as ready for review
October 23, 2026 17:14
Collaborator
Author
|
R: @ahmedabu98 |
Contributor
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the two self-contained pieces that dynamic destinations for
IcebergIO.AddFilesarebuilt on: a path-pattern matcher, and the
DoFnthat uses it to name a destination tablefrom each file's path.
AddFilesregisters every input file into one table named bytable. Migrating a lakeusually means a tree of per-table folders, which today needs one
AddFilesper table.The goal is for one transform to route each file to the table its path names:
This PR adds only the routing primitives so they can be reviewed on their own. The
pre-pass, registration and schema-transform surface follow separately.
PathPatternA whole-path glob with
{name}placeholders, each capturing exactly one path segment.Globbing is Beam's own (
FileSystemUtils.wildcardToRegexp), so*,**and?behave asthey do in any other Beam file pattern; placeholders are translated to capturing groups
between the globbed fixed parts.
The whole path must match, so the pattern decides both which table a file belongs to and
whether it belongs at all.
compilerejects patterns that cannot answer thatunambiguously:
{a}twice{a b},{a.b}gs://lake/**/{tbl}/****above a placeholder leaves the captured folder undeterminedgs://lake/{tbl}//, so it names a folder and matches no filerender(template, captures)fills the table template, andcheckRenderable(template)refuses a template naming a placeholder the pattern never captures, so
table: default.{db}against.../{tbl}/**fails at construction rather than producing one errorrow per file.
RouteFilesDoFn<String, KV<String, String>>with two outputs:ROUTED:KV<table, path>for a file the pattern matchedERRORS: a{file, error, table}row for a path it did not, withtableempty becausethere is no table to attribute it to
An unmatched path becomes an error row rather than being silently dropped: a mistyped
pattern must be visible.
PathPattern.compileandcheckRenderableboth run in theconstructor, so a bad pattern or template fails at pipeline construction instead of once
per file on a worker.
RouteFiles.ERROR_SCHEMAis declared locally here. When the transform is wired up itbecomes the same schema as
AddFiles' error output, so the two can be flattened; thatchange belongs with the wiring.
**/*to**, which Python'sFileSystem.translate_patterndoes not. Relevant only if youcompare a
path_patternagainst a glob written for Python'sMatchFilesupstream.