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-20951][SQL] Built-in SQL Function FormatNumber validate input value #18175

Closed
wants to merge 2 commits into from
Closed

[SPARK-20951][SQL] Built-in SQL Function FormatNumber validate input value #18175

wants to merge 2 commits into from

Conversation

wangyum
Copy link
Member

@wangyum wangyum commented Jun 1, 2017

What changes were proposed in this pull request?

SQL Function FormatNumber should validate input value, if argument 2 < 0 throw TypeCheckFailure same as Hive's way . after this pr:

spark-sql> select format_number(12332.123456, -4);
Error in query: cannot resolve 'format_number(12332.123456BD, -4)' due to data type mismatch: Argument 2 of function FORMAT_NUMBER must be >= 0, but -4 was found; line 1 pos 7;
'Project [unresolvedalias(format_number(12332.123456, -4), None)]
+- OneRowRelation$

spark-sql> 

How was this patch tested?

unit tests

@SparkQA
Copy link

SparkQA commented Jun 1, 2017

Test build #77637 has finished for PR 18175 at commit 655ec8f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum wangyum closed this Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants