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

Implement writeObject and getObject for RealType and DoubleType #16209

Closed
wants to merge 1 commit into from

Conversation

yuanzhanhku
Copy link
Contributor

With these util functions, we could remove some per function/operator
specific implementations. This commit removes the ValueAccessor
interfaces in ArrayNormalizeFunction.

Test plan
Added unit tests in TestRealType and TestDoubleType. There are existing unit tests for ArrayNormalizeFunction.

== NO RELEASE NOTE ==

With these util functions, we could remove some per function/operator
specific implementations. This commit removes the ValueAccessor
interfaces in ArrayNormalizeFunction.
Copy link
Contributor

@highker highker left a comment

Choose a reason for hiding this comment

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

getObject or writeObject is actually not for primitive types. They are only for array, map, and row types. For primitive types, we always assume the caller knows the exact interface to call into on double, boolean, Slice, or long type. Of course, sometimes, the caller doesn't know; so we have helpers like readNativeValue and writeNativeValue to dispatch the underlying types.

In this case, readNativeValue or writeNativeValue could also be called to help a bit on the different type systems. But it won't provide the final readable values. The values returned are still in-memory representations. LiteralInterpreter has some helpers to do the decoding; but that is way beyond what is required in a function.

I would suggest discarding the patch. cc @kaikalur in case you find some other interesting util to workaround.

@yuanzhanhku
Copy link
Contributor Author

getObject

Thanks for looking into it, James. I will discard this patch.

@yuanzhanhku yuanzhanhku closed this Jun 8, 2021
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.

2 participants