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

[DRAFT] Allow customization of conversion to relative paths #324

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ashvina
Copy link
Contributor

@ashvina ashvina commented Feb 5, 2024

Addresses #323

The DeltaClient target converts a dataFile's absolute path to a relative path by default. This behavior is usually desirable, as relative paths are more compatible with query engines. However, the behavior is also fixed and cannot be changed. This can be problematic for users who want to keep absolute paths or handle path schemes differently. To address this issue, this change introduces the ability to inject custom code and allow for customization of the path conversion process.

This change introduces a FilterManager that transforms the input list of data files using a set of FilterChains. The user can configure the FilterChains (add list of filters) to apply different transformations to the data files. For example, one FilterChain can convert absolute paths to relative paths, and another can emit telemetry data for the data files. The user can also add new implementations of FilterChains or remove all of them.

The FilterManager can be used to inject the FilterChains at various points in the conversion process. These filters will be added incrementally.

A simpler way to initialize the filters with user configuration will be possible after the PerTableConfig related changes are done.

This change added new tests.

@ashvina ashvina linked an issue Feb 5, 2024 that may be closed by this pull request
}

@VisibleForTesting
protected void initializeFilters(String tableDataPath) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Add test to validate customization

String newPath = oldPath.substring(basePath.length() + 1);

// create a new data file
return OneDataFile.builder()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: is there an easier way to clone an object using lombok such that some fields can be updated?

@ashvina ashvina changed the title Allow customization of conversion to relative paths [DRAFT] Allow customization of conversion to relative paths Feb 6, 2024
@ashvina ashvina marked this pull request as draft February 6, 2024 05:21
@ashvina ashvina force-pushed the 323-conversion-to-relative-paths branch from 1a7cccb to 8d6dc0c Compare February 7, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow customization of conversion to relative paths
1 participant