@@ -395,7 +395,7 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
395
395
}
396
396
397
397
test(" ANSI support for add" ) {
398
- assume(isSpark35Plus )
398
+ assume(isSpark40Plus )
399
399
val data = Seq ((Integer .MAX_VALUE , 1 ), (Integer .MIN_VALUE , - 1 ))
400
400
withSQLConf(SQLConf .ANSI_ENABLED .key -> " true" ) {
401
401
withParquetTable(data, " tbl" ) {
@@ -419,8 +419,9 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
419
419
}
420
420
421
421
test(" ANSI support for subtract" ) {
422
+ assume(isSpark40Plus)
422
423
val data = Seq ((Integer .MIN_VALUE , 1 ))
423
- withSQLConf(SQLConf .ANSI_ENABLED .key -> " true" , " spark.comet.ansi.enabled " -> " true " ) {
424
+ withSQLConf(SQLConf .ANSI_ENABLED .key -> " true" ) {
424
425
withParquetTable(data, " tbl" ) {
425
426
val res = spark.sql("""
426
427
|SELECT
@@ -440,6 +441,7 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
440
441
}
441
442
442
443
test(" ANSI support for multiply" ) {
444
+ assume(isSpark40Plus)
443
445
val data = Seq ((Integer .MAX_VALUE , 10 ))
444
446
withSQLConf(SQLConf .ANSI_ENABLED .key -> " true" ) {
445
447
withParquetTable(data, " tbl" ) {
@@ -462,10 +464,10 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
462
464
}
463
465
464
466
test(" ANSI support for divide" ) {
467
+ assume(isSpark40Plus)
465
468
val data = Seq ((Integer .MIN_VALUE , 0 ))
466
469
withSQLConf(
467
- SQLConf .ANSI_ENABLED .key -> " true" ,
468
- " spark.comet.explainFallback.enabled" -> " true" ) {
470
+ SQLConf .ANSI_ENABLED .key -> " true" ) {
469
471
withParquetTable(data, " tbl" ) {
470
472
val res = spark.sql("""
471
473
|SELECT
@@ -1961,7 +1963,7 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
1961
1963
Seq (
1962
1964
(
1963
1965
s " SELECT cast(make_interval(c0, c1, c0, c1, c0, c0, c2) as string) as C from $table" ,
1964
- Set (" make_interval is not supported" )),
1966
+ Set (" Cast from CalendarIntervalType to StringType is not supported" )),
1965
1967
(
1966
1968
" SELECT "
1967
1969
+ " date_part('YEAR', make_interval(c0, c1, c0, c1, c0, c0, c2))"
@@ -1980,8 +1982,8 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
1980
1982
+ s " (SELECT c1, cast(make_interval(c0, c1, c0, c1, c0, c0, c2) as string) as casted from $table) as B "
1981
1983
+ " where A.c1 = B.c1 " ,
1982
1984
Set (
1983
- " Comet shuffle is not enabled: spark.comet.exec.shuffle.enabled is not enabled " ,
1984
- " make_interval is not supported " )),
1985
+ " Cast from CalendarIntervalType to StringType is not supported " ,
1986
+ " Comet shuffle is not enabled: spark.comet.exec.shuffle.enabled is not enabled " )),
1985
1987
(s " select * from $table LIMIT 10 OFFSET 3 " , Set (" Comet shuffle is not enabled" )))
1986
1988
.foreach(test => {
1987
1989
val qry = test._1
0 commit comments