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

[VL] try_cast does not return NULL #8108

Open
acvictor opened this issue Nov 29, 2024 · 0 comments
Open

[VL] try_cast does not return NULL #8108

acvictor opened this issue Nov 29, 2024 · 0 comments
Labels
bug Something isn't working triage

Comments

@acvictor
Copy link
Contributor

Backend

VL (Velox)

Bug description

val data = Seq(("1234567"), ("000A1234"), ("ABCDE0")) 
val df = spark.createDataFrame(data.map(Tuple1(_))).toDF("value") 
df.write.format("parquet").mode("overwrite").save("file:///home/a/src/sparklocal/tbl) 
spark.read.format("parquet").load("file:///home/a/src/sparklocal/wrong").createOrReplaceTempView("tbl") 
val df = sql("select try_cast(value as bigint) from tbl") 

Returns

E1126 15:27:22.105729 44701 CastExpr-inl.h:43] Cannot cast VARCHAR '000A1234' to BIGINT. Encountered a non-digit character 
I1126 15:27:22.106130 44701 Task.cpp:1879] Terminating task Gluten_Stage_2_TID_2_VTID_1 with state Failed after running for 5 ms. 
I1126 15:27:22.106395 44701 Task.cpp:1136] All drivers (1) finished for task Gluten_Stage_2_TID_2_VTID_1 after running for 5 ms. 
24/11/26 15:27:22 ERROR TaskResources: Task 2 failed by error: org.apache.gluten.exception.GlutenException: org.apache.gluten.exception.GlutenException: 
Exception: VeloxUserError 
Error Source: USER 
Error Code: INVALID_ARGUMENT 
Reason: Cannot cast VARCHAR '000A1234' to BIGINT. Encountered a non-digit character 
Retriable: False 
Context: Top-level 
Expression: cast((trim(  
             

:VARCHAR, n0_0)) as BIGINT) 

While Spark returns Array([1234567], [null], [null])

Spark version

Spark-3.5.x

Spark configurations

No response

System information

No response

Relevant logs

No response

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
Projects
None yet
Development

No branches or pull requests

1 participant