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

Fix casting partial date input for Spark #9480

Open
rui-mo opened this issue Apr 15, 2024 · 1 comment
Open

Fix casting partial date input for Spark #9480

rui-mo opened this issue Apr 15, 2024 · 1 comment
Labels
bug Something isn't working triage Newly created issue that needs attention.

Comments

@rui-mo
Copy link
Collaborator

rui-mo commented Apr 15, 2024

Bug description

When casting string as date, Spark throws error or returns null (according to ANSI config) for 123, but works for 2020. While in Velox, 123 and 2020 both work. We can follow-up in a separate PR to fix Spark cast.

scala> spark.sql("select cast('123' as date)").show(false)
+-----------------+                                                             
|CAST(123 AS DATE)|
+-----------------+
|null             |
+-----------------+


scala> spark.sql("select cast('2020' as date)").show(false)
+------------------+                                                            
|CAST(2020 AS DATE)|
+------------------+
|2020-01-01        |
+------------------+

System information

CMake Version: 3.16.3
System: Linux-5.4.0-173-generic
Arch: x86_64
C++ Compiler: /usr/bin/c++
C++ Compiler Version: 11.1.0
C Compiler: /usr/bin/cc
C Compiler Version: 11.1.0
CMake Prefix Path: /usr/local;/usr;/;/usr;/usr/local;/usr/X11R6;/usr/pkg;/opt

Relevant logs

No response

@rui-mo rui-mo added bug Something isn't working triage Newly created issue that needs attention. labels Apr 15, 2024
@rui-mo
Copy link
Collaborator Author

rui-mo commented Apr 15, 2024

#9357 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Newly created issue that needs attention.
Projects
None yet
Development

No branches or pull requests

1 participant