Skip to content

[WIP][SQL] Incapsulate type operations #51467

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
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MaxGekk
Copy link
Member

@MaxGekk MaxGekk commented Jul 13, 2025

What changes were proposed in this pull request?

Why are the changes needed?

  • Type operations are spread across entire codebase. There is high chance to miss processing of new type.
  • Error prone since all errors are caught by tests in runtime. No help from the compiler.

Does this PR introduce any user-facing change?

No. This is just refactoring.

How was this patch tested?

By the existing tests.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the SQL label Jul 13, 2025
@MaxGekk
Copy link
Member Author

MaxGekk commented Jul 14, 2025

@milastdbx @mkaravel @uros-db Please, have a look at this prototype.

@@ -99,10 +99,10 @@ object EncoderUtils {

def dataTypeJavaClass(dt: DataType): Class[_] = {
dt match {
case _ if PhyTypeOps.supports(dt) => PhyTypeOps(dt).getJavaClass
Copy link
Member Author

@MaxGekk MaxGekk Jul 14, 2025

Choose a reason for hiding this comment

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

In the future, we will get an Ops object here, and we will match by it instead of PhyTypeOps.supports. The current implementation is just workaround to avoid passing TypeOps instead of DataType.

@MaxGekk
Copy link
Member Author

MaxGekk commented Jul 14, 2025

@cloud-fan Please, take a look at this prototype.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant