Skip to content

Conversation

Fokko
Copy link
Collaborator

@Fokko Fokko commented Sep 8, 2025

What changes are proposed in this pull request?

After #1207 I thought it would be a nice touch to move the traversal of the schema to a visitor, which creates a very nice separation between flow and the actual logic. Also, this reduces the state within the class by removing the error and stack.

I'm still learning rust, so don't hold back on the review.

How was this change tested?

Existing tests

After delta-io#1207 I thought
it would be a nice touch to move the traversal of the schema
to a visitor, which creates a very nice separation between
flow and the actual logic.
@Fokko Fokko force-pushed the fd-move-to-visitor branch from a4e7810 to 1fb0a59 Compare September 8, 2025 21:00
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 91.25000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.53%. Comparing base (023930c) to head (1fb0a59).

Files with missing lines Patch % Lines
kernel/src/schema/visitor.rs 83.33% 1 Missing and 3 partials ⚠️
...el/src/expressions/literal_expression_transform.rs 93.87% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1268      +/-   ##
==========================================
- Coverage   83.54%   83.53%   -0.01%     
==========================================
  Files         106      107       +1     
  Lines       25537    25566      +29     
  Branches    25537    25566      +29     
==========================================
+ Hits        21334    21356      +22     
- Misses       3144     3150       +6     
- Partials     1059     1060       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added the breaking-change Change that require a major version bump label Sep 8, 2025
Copy link
Collaborator

@emkornfield emkornfield left a comment

Choose a reason for hiding this comment

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

I'll let core team comment if they want this abstraction. it certainly seems nice to reduce the need to macros with business logic.

Another option which seems like might fit well is a straight iterator (this might get into some complicated stack handling for this case). I created something like this for Java: https://github.com/delta-io/delta/blob/master/kernel/kernel-api/src/main/java/io/delta/kernel/internal/util/SchemaIterable.java

@Fokko Fokko marked this pull request as draft September 11, 2025 19:54
Fokko added a commit to Fokko/delta-kernel-rs that referenced this pull request Sep 11, 2025
While working on delta-io#1268
I think the StructType could be improved by making it iterable.
Fokko added a commit to Fokko/delta-kernel-rs that referenced this pull request Sep 11, 2025
While working on delta-io#1268
I think the StructType could be improved by making it iterable.
Fokko added a commit that referenced this pull request Sep 18, 2025
<!--
Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md
2. Run `cargo t --all-features --all-targets` to get started testing,
and run `cargo fmt`.
  3. Ensure you have added or run the appropriate tests for your PR.
4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]
Your PR title ...'.
  5. Be sure to keep the PR description updated to reflect all changes.
-->

<!--
PR title formatting:
This project uses conventional commits:
https://www.conventionalcommits.org/

Each PR corresponds to a commit on the `main` branch, with the title of
the PR (typically) being
used for the commit message on main. In order to ensure proper
formatting in the CHANGELOG please
ensure your PR title adheres to the conventional commit specification.

Examples:
- new feature PR: "feat: new API for snapshot.update()"
- bugfix PR: "fix: correctly apply DV in read-table example"
-->

## What changes are proposed in this pull request?

While working on #1268 I
think the StructType could be improved by making it iterable.

<!--
Please clarify what changes you are proposing and why the changes are
needed.
The purpose of this section is to outline the changes, why they are
needed, and how this PR fixes the issue.
If the reason for the change is already explained clearly in an issue,
then it does not need to be restated here.
1. If you propose a new API or feature, clarify the use case for a new
API or feature.
  2. If you fix a bug, you can clarify why it is a bug.
-->

<!--
Uncomment this section if there are any changes affecting public APIs:
### This PR affects the following public APIs

If there are breaking changes, please ensure the `breaking-changes`
label gets added by CI, and describe why the changes are needed.

Note that _new_ public APIs are not considered breaking.
-->


## How was this change tested?
<!--
Please make sure to add test cases that check the changes thoroughly
including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please
clarify how you tested, ideally via a reproducible test documented in
the PR description.
-->

Added new tests 👍
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Change that require a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants