andygrove opened a new issue, #15:
URL: https://github.com/apache/arrow-datafusion-comet/issues/15

   ```
   scala> val inputs = Seq("123", "-123", "86374").toDF("n")
   inputs: org.apache.spark.sql.DataFrame = [n: string]
   
   scala> inputs.write.parquet("test.parquet")
   24/02/13 07:40:14 INFO src/lib.rs: Comet native library initialized
                                                                                
   
   scala> val df = spark.read.parquet("test.parquet")
   df: org.apache.spark.sql.DataFrame = [n: string]
   
   scala> import org.apache.spark.sql.types._
   import org.apache.spark.sql.types._
   
   scala> val df2 = df.withColumn("converted", 
col("n").cast(DataTypes.ShortType))
   df2: org.apache.spark.sql.DataFrame = [n: string, converted: smallint]
   
   scala> df2.show
   +-----+---------+
   |    n|converted|
   +-----+---------+
   |86374|    20838|
   | -123|     -123|
   |  123|      123|
   +-----+---------+
   
   scala> spark.conf.set("spark.comet.enabled", false)
   
   scala> df2.show
   +-----+---------+
   |    n|converted|
   +-----+---------+
   |86374|     null|
   | -123|     -123|
   |  123|      123|
   +-----+---------+
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to