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

[SPARK-20668][SQL] Modify ScalaUDF to handle nullability. #17911

Closed
wants to merge 2 commits into from

Conversation

ueshin
Copy link
Member

@ueshin ueshin commented May 9, 2017

What changes were proposed in this pull request?

When registering Scala UDF, we can know if the udf will return nullable value or not. ScalaUDF and related classes should handle the nullability.

How was this patch tested?

Existing tests.

@SparkQA
Copy link

SparkQA commented May 9, 2017

Test build #76632 has started for PR 17911 at commit 120c862.

@ueshin
Copy link
Member Author

ueshin commented May 9, 2017

cc @gatorsmile

@gatorsmile
Copy link
Member

retest this please

@maropu
Copy link
Member

maropu commented May 9, 2017

This pr looks good to me though, do we have any plan to update the interface of UserDefinedFunction in a next major release (spark-v3) ? We still keep adding extra info. (e.g., name, deterministic, distinctLike, ...) in spark-v2.x.x releases?

@SparkQA
Copy link

SparkQA commented May 9, 2017

Test build #76647 has finished for PR 17911 at commit 120c862.

  • This patch fails from timeout after a configured wait of `250m`.
  • This patch merges cleanly.
  • This patch adds no public classes.

@ueshin
Copy link
Member Author

ueshin commented May 9, 2017

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented May 9, 2017

Test build #76677 has finished for PR 17911 at commit 120c862.

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

udf
}

protected[sql] def withNullability(nullable: Boolean): UserDefinedFunction = {
Copy link
Member

Choose a reason for hiding this comment

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

This can be a public function?

Also add a function description?

@@ -47,12 +47,37 @@ case class UserDefinedFunction protected[sql] (
dataType: DataType,
inputTypes: Option[Seq[DataType]]) {

private var _nullable: Boolean = true

def nullable: Boolean = _nullable
Copy link
Member

Choose a reason for hiding this comment

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

Since this is public, could you add a function description with @since?

@gatorsmile
Copy link
Member

LGTM pending test

@SparkQA
Copy link

SparkQA commented May 10, 2017

Test build #76717 has finished for PR 17911 at commit 948335c.

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

@gatorsmile
Copy link
Member

Thanks! Merging to master.

@asfgit asfgit closed this in 0ef16bd May 10, 2017
liyichao pushed a commit to liyichao/spark that referenced this pull request May 24, 2017
## What changes were proposed in this pull request?

When registering Scala UDF, we can know if the udf will return nullable value or not. `ScalaUDF` and related classes should handle the nullability.

## How was this patch tested?

Existing tests.

Author: Takuya UESHIN <ueshin@databricks.com>

Closes apache#17911 from ueshin/issues/SPARK-20668.
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.

4 participants