Skip to content

Conversation

@sunchao
Copy link
Member

@sunchao sunchao commented May 13, 2021

What changes were proposed in this pull request?

Move hash map lookup operation out of InvokeLike.invoke since it doesn't depend on the input.

Why are the changes needed?

We shouldn't need to look up the hash map for every input row evaluated by InvokeLike.invoke since it doesn't depend on input. This could speed up the performance a bit.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing tests.

@github-actions github-actions bot added the SQL label May 13, 2021
@SparkQA
Copy link

SparkQA commented May 13, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43019/

@SparkQA
Copy link

SparkQA commented May 13, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43019/

} else {
ret
}
boxingFn(ret)
Copy link
Member

Choose a reason for hiding this comment

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

This could speed up the performance a bit.

Are you going to attach the new benchmark result?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. Yes I'll attach benchmark results for this later.

@SparkQA
Copy link

SparkQA commented May 13, 2021

Test build #138499 has finished for PR 32532 at commit 8a97c30.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

} else {
ret
}
boxingFn(ret)
Copy link
Member

Choose a reason for hiding this comment

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

I'm probably missing something dumb here but dataType is an argument to this method - how can we have one function for it? I don't see where dataType is available to the trait

Copy link
Member Author

@sunchao sunchao May 13, 2021

Choose a reason for hiding this comment

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

It's a bit misleading by looking at it, but in the call sites of invoke we currently always pass Expression.dataType (which is overridden by Invoke and StaticInvoke) as its argument, so the parameter is actually unnecessary. The same goes to arguments. To avoid confusion I think we can just remove these two parameters.

@SparkQA
Copy link

SparkQA commented May 13, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43048/

@SparkQA
Copy link

SparkQA commented May 13, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/43048/

@SparkQA
Copy link

SparkQA commented May 14, 2021

Test build #138527 has finished for PR 32532 at commit 92f3284.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@sunchao
Copy link
Member Author

sunchao commented May 14, 2021

@dongjoon-hyun @srowen let me know if you have more comments - also cc @cloud-fan @viirya

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you, @sunchao and @srowen .
Merged to master

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

lgtm

dongjoon-hyun pushed a commit that referenced this pull request Jun 8, 2021
### What changes were proposed in this pull request?

Fix Scala doc for removed parameters for `InvokeLike.invoke`.

### Why are the changes needed?

#32532 forgot to update the Scala doc after removing 2 parameters for `InvokeLike.invoke`. This fixes it.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

N/A

Closes #32827 from sunchao/SPARK-35384-followup.

Authored-by: Chao Sun <sunchao@apple.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
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.

5 participants