You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "dcoliversun (via GitHub)" <gi...@apache.org> on 2024/04/01 09:47:43 UTC
Re: [I] [VL]Support cast date as varchar/timestamp in velox [incubator-gluten]
dcoliversun commented on issue #5102:
URL: https://github.com/apache/incubator-gluten/issues/5102#issuecomment-2029497878
result is here
```shell
scala> spark.read.parquet("/opt/data").createOrReplaceTempView("view")
scala> spark.sql("select * from view").show
+----------+
|dateColumn|
+----------+
|2023-01-01|
|2023-01-03|
|2023-01-02|
+----------+
scala> val newDf = spark.sql("select cast(dateColumn as string) from view")
newDf: org.apache.spark.sql.DataFrame = [dateColumn: string]
scala> newDf.explain
== Physical Plan ==
VeloxColumnarToRowExec
+- ^(3) ProjectExecTransformer [cast(dateColumn#0 as string) AS dateColumn#15]
+- ^(3) NativeFileScan parquet [dateColumn#0] Batched: true, DataFilters: [], Format: Parquet, Location: InMemoryFileIndex(1 paths)[file:/opt/data], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<dateColumn:date>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org