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

PicklingUdfWrapper cache type information #689

Merged
merged 9 commits into from
Sep 28, 2020

Conversation

suhsteve
Copy link
Member

Cache parameter type information to determine if converting/casting is necessary. This will help speed up the call if the Type only needs to be casted.

#683

@suhsteve suhsteve self-assigned this Sep 25, 2020
@suhsteve suhsteve added the enhancement New feature or request label Sep 25, 2020
@suhsteve suhsteve added this to the 1.0.0 milestone Sep 25, 2020
src/csharp/Microsoft.Spark/Sql/PicklingUdfWrapper.cs Outdated Show resolved Hide resolved
@@ -35,16 +42,19 @@ internal object Execute(int splitIndex, object[] input, int[] argOffsets)
[UdfWrapper]
internal class PicklingUdfWrapper<T, TResult>
{
[NonSerialized]
private readonly bool?[] _sameT = new bool?[1];
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to create an array?

Copy link
Member Author

Choose a reason for hiding this comment

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

all values in the array will have default values. The default value of a Nullable is null

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I meant that this has only one element, so no need to create an array.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah got it. Changed it to use a non array for the 1 param case.

src/csharp/Microsoft.Spark/Sql/PicklingUdfWrapper.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@imback82 imback82 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @suhsteve!

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

Successfully merging this pull request may close these issues.

3 participants