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

chore: Refactor CometScanRule to avoid duplication and improve fallback messages #1474

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented Mar 4, 2025

Which issue does this PR close?

N/A

Rationale for this change

The original code was hard to follow due to the duplicated code across multiple match arms.

The original code also contains some bugs/inconsistencies. For example, for v1 data source, there is one match arm that checks CometNativeScanExec.isSchemaSupported(requiredSchema) and another match arm that checks CometScanExec.isSchemaSupported(requiredSchema). There is then another match arm that runs if neither of those arms ran and it reports unsupported schema based on CometScanExec and not CometNativeScanExec, so may miss reporting unsupported schema for native scan.

What changes are included in this PR?

Refactor code for readability and correctness.

How are these changes tested?

}
CometScanExec(scanExec, session)

case SCAN_NATIVE_COMET | SCAN_NATIVE_ICEBERG_COMPAT =>
Copy link
Member Author

Choose a reason for hiding this comment

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

This seems incorrect, but matches the original code.

@andygrove andygrove marked this pull request as ready for review March 4, 2025 20:14
@andygrove
Copy link
Member Author

@mbutrovich, Could you review this since this affects the new experimental native scan support?

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.

1 participant