@@ -26,6 +26,7 @@ import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper
2626import org .apache .spark .sql .internal .SQLConf
2727import org .apache .spark .sql .types .{DataTypes , StructField , StructType }
2828
29+ import org .apache .comet .CometSparkSessionExtensions .isSpark41Plus
2930import org .apache .comet .serde .{CometDateFormat , CometTruncDate , CometTruncTimestamp }
3031import org .apache .comet .testing .{DataGenOptions , FuzzDataGenerator }
3132
@@ -183,6 +184,7 @@ class CometTemporalExpressionSuite extends CometTestBase with AdaptiveSparkPlanH
183184 }
184185
185186 test(" last_day" ) {
187+ assume(! isSpark41Plus)
186188 val r = new Random (42 )
187189 val schema = StructType (Seq (StructField (" c0" , DataTypes .DateType , true )))
188190 val df = FuzzDataGenerator .generateDataFrame(r, spark, schema, 1000 , DataGenOptions ())
@@ -209,6 +211,7 @@ class CometTemporalExpressionSuite extends CometTestBase with AdaptiveSparkPlanH
209211 }
210212
211213 test(" datediff" ) {
214+ assume(! isSpark41Plus)
212215 val r = new Random (42 )
213216 val schema = StructType (
214217 Seq (
@@ -305,6 +308,7 @@ class CometTemporalExpressionSuite extends CometTestBase with AdaptiveSparkPlanH
305308 }
306309
307310 test(" date_format with literal timestamp" ) {
311+ assume(! isSpark41Plus)
308312 // Test specific literal timestamp formats
309313 // Disable constant folding to ensure Comet actually executes the expression
310314 withSQLConf(
@@ -324,6 +328,7 @@ class CometTemporalExpressionSuite extends CometTestBase with AdaptiveSparkPlanH
324328 }
325329
326330 test(" date_format with null" ) {
331+ assume(! isSpark41Plus)
327332 withSQLConf(
328333 SQLConf .SESSION_LOCAL_TIMEZONE .key -> " UTC" ,
329334 SQLConf .OPTIMIZER_EXCLUDED_RULES .key ->
@@ -376,6 +381,7 @@ class CometTemporalExpressionSuite extends CometTestBase with AdaptiveSparkPlanH
376381 }
377382
378383 test(" unix_date" ) {
384+ assume(! isSpark41Plus)
379385 val r = new Random (42 )
380386 val schema = StructType (Seq (StructField (" c0" , DataTypes .DateType , true )))
381387 val df = FuzzDataGenerator .generateDataFrame(r, spark, schema, 1000 , DataGenOptions ())
0 commit comments