Skip to content

Commit a55263f

Browse files
minor updates
1 parent 84c0132 commit a55263f

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

spark/src/main/scala/org/apache/comet/serde/strings.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,6 @@ object CometRegExpExtract extends CometExpressionSerde[RegExpExtract] {
309309
expr.idx match {
310310
case Literal(_, DataTypes.IntegerType) =>
311311
Compatible()
312-
case Literal(_, DataTypes.LongType) =>
313-
Compatible()
314-
case Literal(_, DataTypes.ShortType) =>
315-
Compatible()
316-
case Literal(_, DataTypes.ByteType) =>
317-
Compatible()
318312
case _ =>
319313
Unsupported(Some("Only literal group index is supported"))
320314
}
@@ -354,12 +348,6 @@ object CometRegExpExtractAll extends CometExpressionSerde[RegExpExtractAll] {
354348
expr.idx match {
355349
case Literal(_, DataTypes.IntegerType) =>
356350
Compatible()
357-
case Literal(_, DataTypes.LongType) =>
358-
Compatible()
359-
case Literal(_, DataTypes.ShortType) =>
360-
Compatible()
361-
case Literal(_, DataTypes.ByteType) =>
362-
Compatible()
363351
case _ =>
364352
Unsupported(Some("Only literal group index is supported"))
365353
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ class CometStringExpressionSuite extends CometTestBase {
409409
checkSparkAnswerAndOperator("SELECT regexp_extract(_1, '(\\d+)-(\\d+)', 1) FROM tbl")
410410
// Test group 2
411411
checkSparkAnswerAndOperator("SELECT regexp_extract(_1, '(\\d+)-(\\d+)', 2) FROM tbl")
412-
// Test non-existent group → should return ""
412+
// Test non-existent group → should error
413413
checkSparkAnswerAndOperator("SELECT regexp_extract(_1, '(\\d+)-(\\d+)', 3) FROM tbl")
414414
// Test empty pattern
415415
checkSparkAnswerAndOperator("SELECT regexp_extract(_1, '', 0) FROM tbl")
@@ -617,7 +617,7 @@ class CometStringExpressionSuite extends CometTestBase {
617617
val data = Seq(("a1b2c3", 1), ("test123", 1), (null, 1))
618618

619619
withParquetTable(data, "tbl") {
620-
// Group index out of bounds - should match Spark's behavior (error or empty)
620+
// Group index out of bounds - should match Spark's behavior (error)
621621
// Pattern has only 1 group, asking for group 2
622622
checkSparkAnswerAndOperator("SELECT regexp_extract_all(_1, '(\\d+)', 2) FROM tbl")
623623

0 commit comments

Comments
 (0)