Skip to content

Commit eb94cb6

Browse files
committed
Enable ABS tests in legacy/ANSI mode
1 parent 7b1965a commit eb94cb6

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,23 +1385,25 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
13851385
testDoubleScalarExpr("expm1")
13861386
}
13871387

1388-
// https://github.com/apache/datafusion-comet/issues/666
1389-
ignore("abs") {
1390-
Seq(true, false).foreach { dictionaryEnabled =>
1391-
withTempDir { dir =>
1392-
val path = new Path(dir.toURI.toString, "test.parquet")
1393-
makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = dictionaryEnabled, 100)
1394-
withParquetTable(path.toString, "tbl") {
1395-
Seq(2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 17).foreach { col =>
1396-
checkSparkAnswerAndOperator(s"SELECT abs(_${col}) FROM tbl")
1388+
test("abs") {
1389+
Seq(true, false).foreach { ansi_enabled =>
1390+
Seq(true, false).foreach { dictionaryEnabled =>
1391+
withSQLConf(SQLConf.ANSI_ENABLED.key -> ansi_enabled.toString) {
1392+
withTempDir { dir =>
1393+
val path = new Path(dir.toURI.toString, "test.parquet")
1394+
makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = dictionaryEnabled, 100)
1395+
withParquetTable(path.toString, "tbl") {
1396+
Seq(2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 15, 16, 17).foreach { col =>
1397+
checkSparkAnswerAndOperator(s"SELECT abs(_${col}) FROM tbl")
1398+
}
1399+
}
13971400
}
13981401
}
13991402
}
14001403
}
14011404
}
14021405

1403-
// https://github.com/apache/datafusion-comet/issues/666
1404-
ignore("abs Overflow ansi mode") {
1406+
test("abs Overflow ANSI mode") {
14051407

14061408
def testAbsAnsiOverflow[T <: Product: ClassTag: TypeTag](data: Seq[T]): Unit = {
14071409
withParquetTable(data, "tbl") {
@@ -1434,8 +1436,7 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
14341436
}
14351437
}
14361438

1437-
// https://github.com/apache/datafusion-comet/issues/666
1438-
ignore("abs Overflow legacy mode") {
1439+
test("abs Overflow legacy mode") {
14391440

14401441
def testAbsLegacyOverflow[T <: Product: ClassTag: TypeTag](data: Seq[T]): Unit = {
14411442
withSQLConf(SQLConf.ANSI_ENABLED.key -> "false") {

spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,10 @@ abstract class CometTestBase
504504
| optional float _6;
505505
| optional double _7;
506506
| optional binary _8(UTF8);
507-
| optional int32 _9(UINT_8);
508-
| optional int32 _10(UINT_16);
509-
| optional int32 _11(UINT_32);
510-
| optional int64 _12(UINT_64);
507+
| optional int32 _9(INT_8);
508+
| optional int32 _10(INT_16);
509+
| optional int32 _11(INT_32);
510+
| optional int64 _12(INT_64);
511511
| optional binary _13(ENUM);
512512
| optional FIXED_LEN_BYTE_ARRAY(3) _14;
513513
| optional int32 _15(DECIMAL(5, 2));

0 commit comments

Comments
 (0)