tshauck commented on code in PR #449:
URL: https://github.com/apache/datafusion-comet/pull/449#discussion_r1613950678


##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -1038,6 +1038,20 @@ class CometExpressionSuite extends CometTestBase with 
AdaptiveSparkPlanHelper {
       }
     }
   }
+  test("hex") {
+    Seq(true, false).foreach { dictionaryEnabled =>
+      withTempDir { dir =>
+        val path = new Path(dir.toURI.toString, "hex.parquet")
+        makeParquetFileAllTypes(path, dictionaryEnabled = dictionaryEnabled, 
10000)
+
+        withParquetTable(path.toString, "tbl") {
+          // _9 and _10 (uint8 and uint16) not supported
+          checkSparkAnswerAndOperator(
+            "SELECT hex(_1), hex(_2), hex(_3), hex(_4), hex(_5), hex(_6), 
hex(_7), hex(_8), hex(_11), hex(_12), hex(_13), hex(_14), hex(_15), hex(_16), 
hex(_17), hex(_18), hex(_19), hex(_20) FROM tbl")

Review Comment:
   Thanks for bringing this up. I guess I thought scalars weren't supported yet 
(maybe for UDFs only)? From what I could tell none of the other tests test 
scalars, i.e. most of them insert into a table, then query the table. E.g.,
   
   ```scala
     test("Chr") {
       Seq(false, true).foreach { dictionary =>
         withSQLConf(
           "parquet.enable.dictionary" -> dictionary.toString,
           CometConf.COMET_CAST_ALLOW_INCOMPATIBLE.key -> "true") {
           val table = "test"
           withTable(table) {
             sql(s"create table $table(col varchar(20)) using parquet")
             sql(
               s"insert into $table values('65'), ('66'), ('67'), ('68'), 
('65'), ('66'), ('67'), ('68')")
             checkSparkAnswerAndOperator(s"SELECT chr(col) FROM $table")
           }
         }
       }
     }
   ```
   
   Also running scalar tests seems to fail for the other UDFs I spot checked, 
e.g.,
   
   ```
   - trim *** FAILED *** (7 seconds, 507 milliseconds)
     Expected only Comet native operators, but found Project.
     plan: *(1) Project [HI AS upper(trim(hi))#125]
     +- *(1) Scan OneRowRelation[] (CometTestBase.scala:186)
   ```
   
   Should they be working w/ UDFs, and it's just nothing else tests for them?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to