kazuyukitanimura commented on code in PR #1943: URL: https://github.com/apache/datafusion-comet/pull/1943#discussion_r2178797072
########## spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala: ########## @@ -1605,6 +1605,41 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { } } + test("from_unixtime") { + Seq(false, true).foreach { dictionary => + withSQLConf("parquet.enable.dictionary" -> dictionary.toString) { + val table = "test" + withTempDir { dir => + val path = new Path(dir.toURI.toString, "test.parquet") + makeParquetFileAllPrimitiveTypes( + path, + dictionaryEnabled = dictionary, + -128, + 128, Review Comment: updated, now we test random values as well ########## spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala: ########## @@ -1605,6 +1605,41 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { } } + test("from_unixtime") { + Seq(false, true).foreach { dictionary => + withSQLConf("parquet.enable.dictionary" -> dictionary.toString) { + val table = "test" + withTempDir { dir => + val path = new Path(dir.toURI.toString, "test.parquet") + makeParquetFileAllPrimitiveTypes( + path, + dictionaryEnabled = dictionary, + -128, + 128, + // TODO: DataFusion toChar does not support Spark format + // https://github.com/apache/datafusion/issues/16577 + // https://github.com/apache/datafusion/issues/14536 + // TODO: DataFusion supports only -8334601211038 <= sec <= 8210266876799 + // https://github.com/apache/datafusion/issues/16594 + // randomSize = 100) + randomSize = 0) + withParquetTable(path.toString, table) { + checkSparkAnswerAndOperator(s"SELECT from_unixtime(_5) FROM $table") + checkSparkAnswerAndOperator(s"SELECT from_unixtime(_8) FROM $table") + // checkSparkAnswerAndOperator(s"SELECT from_unixtime(_5, 'YYYY') FROM $table") Review Comment: updated -- 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