Skip to content

Conversation

@turboFei
Copy link
Member

@turboFei turboFei commented Jan 9, 2020

What changes were proposed in this pull request?

In this PR, when spark.sql.ansi.enabled is true.
When casting stringType to Int.
If the string format is invalid or its value overflow the range of Int, we would throw exception to keep consistent with ANSI.

Why are the changes needed?

To keep consistent with ANSI, when spark.sql.ansi.enable is true.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Added Unit Test.

@turboFei turboFei changed the title [SPARK-30374] Cast String to Integer Type, throw exception on format invalid and overflow. [SPARK-30374][SQL] Cast String to Integer Type, throw exception on format invalid and overflow. Jan 9, 2020
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@turboFei turboFei changed the title [SPARK-30374][SQL] Cast String to Integer Type, throw exception on format invalid and overflow. [WIP][SPARK-30374][SQL] Cast String to Integer Type, throw exception on format invalid and overflow. Jan 9, 2020
@turboFei turboFei changed the title [WIP][SPARK-30374][SQL] Cast String to Integer Type, throw exception on format invalid and overflow. [SPARK-30472][SQL] ANSI SQL: Throw exception on format invalid and overflow when casting String to IntegerType. Jan 9, 2020
@turboFei
Copy link
Member Author

turboFei commented Jan 9, 2020

cc @wangyum @cloud-fan @mgaido91

@iRakson
Copy link
Contributor

iRakson commented Jan 9, 2020

I guess this problem is solved in this -> #26933

@turboFei
Copy link
Member Author

turboFei commented Jan 9, 2020

thanks. closed @iRakson

@turboFei turboFei closed this Jan 9, 2020
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.

4 participants