Skip to content

Conversation

@amaliujia
Copy link
Contributor

@amaliujia amaliujia commented Feb 6, 2021

Please add a meaningful description for your change here


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status --- --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@amaliujia
Copy link
Contributor Author

R: @ibzib

@ibzib
Copy link

ibzib commented Feb 8, 2021

@apilloud is making similar changes in #13898.

@amaliujia
Copy link
Contributor Author

We can certainly use #13898 if that covers BEAM-11747

@amaliujia
Copy link
Contributor Author

@ibzib

I believe #13898 is not intended to fix BEAM-11747 given the current status.

What do you think?

Copy link

@ibzib ibzib left a comment

Choose a reason for hiding this comment

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

Just a couple style/documentation nits.

Basic idea LGTM. I wonder if there are still other possible cases we don't handle here. But I believe this is a strict improvement already.

/** Returns true if the argument contains any user-defined Java functions. */
static boolean hasUdfInProjects(RelOptRuleCall x) {
/**
* Returns true if the arguments only contain any user-defined Java functions, otherwise returns
Copy link

Choose a reason for hiding this comment

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

We should add a few more sentences explaining exactly what this means too. It's kind of confusing right now because not all instances of SqlUserDefinedFunction are actually user defined, but someone who reads this code might not realize that unless we clarify.

Suggested change
* Returns true if the arguments only contain any user-defined Java functions, otherwise returns
* Returns true if the arguments only contain user-defined Java functions, otherwise returns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to comment to clarify what is user-defined java functions.

/**
* Returns false if the argument contains any user-defined Java functions, otherwise returns true.
*/
static boolean hasNoJavaUdfInProjects(RelOptRuleCall x) {
Copy link

Choose a reason for hiding this comment

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

Nit: positive phrasing avoids double negatives and makes the logic easier to follow, so consider inverting this (and renaming to something like hasJavaUdfInProjects or hasAnyJavaUdfInProjects)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agreed this might be better. But I think it's bit tricky to implement the positive version of hasNoJavaUdfInProjects . The hasNoJavaUdfInProjects is more error prone at this moment (we only need to consider java udf).

@amaliujia
Copy link
Contributor Author

I think this is a strict constraint. Maybe we could loose the constraint in the future we can prove that Java UDF can execute with other operators together.

But ultimately, we should go for Calc splitting to solve the problem.

Copy link

@ibzib ibzib left a comment

Choose a reason for hiding this comment

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

LGTM

@amaliujia amaliujia merged commit 09e65cb into apache:master Feb 16, 2021
@amaliujia amaliujia deleted the BEAM-11747 branch February 16, 2021 18:33
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