Skip to content

Commit 194c836

Browse files
andygroveclaude
andcommitted
test: add variants of data type tests that exclude u8/u16 columns
Add duplicate tests for "basic data type support" and "uint data type support" that skip reading _9 (UINT_8) and _10 (UINT_16) columns. This restores test coverage for the default scan implementation which can be overridden in CI. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2624f2c commit 194c836

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,22 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
201201
}
202202
}
203203

204+
test("basic data type support - excluding u8/u16") {
205+
// variant that skips _9 (UINT_8) and _10 (UINT_16) for default scan impl
206+
Seq(true, false).foreach { dictionaryEnabled =>
207+
withTempDir { dir =>
208+
val path = new Path(dir.toURI.toString, "test.parquet")
209+
makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = dictionaryEnabled, 10000)
210+
withParquetTable(path.toString, "tbl") {
211+
// select all columns except _9 (UINT_8) and _10 (UINT_16)
212+
checkSparkAnswerAndOperator(
213+
"""select _1, _2, _3, _4, _5, _6, _7, _8, _11, _12, _13, _14, _15, _16, _17,
214+
|_18, _19, _20, _21, _id FROM tbl WHERE _2 > 100""".stripMargin)
215+
}
216+
}
217+
}
218+
}
219+
204220
test("uint data type support") {
205221
// this test requires native_comet scan due to unsigned u8/u16 issue
206222
withSQLConf(CometConf.COMET_NATIVE_SCAN_IMPL.key -> CometConf.SCAN_NATIVE_COMET) {
@@ -221,6 +237,24 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
221237
}
222238
}
223239

240+
test("uint data type support - excluding u8/u16") {
241+
// variant that tests UINT_32 and UINT_64, skipping _9 (UINT_8) and _10 (UINT_16)
242+
Seq(true, false).foreach { dictionaryEnabled =>
243+
withTempDir { dir =>
244+
val path = new Path(dir.toURI.toString, "testuint.parquet")
245+
makeParquetFileAllPrimitiveTypes(
246+
path,
247+
dictionaryEnabled = dictionaryEnabled,
248+
Byte.MinValue,
249+
Byte.MaxValue)
250+
withParquetTable(path.toString, "tbl") {
251+
// test UINT_32 (_11) and UINT_64 (_12) only
252+
checkSparkAnswerAndOperator("select _11, _12 from tbl order by _11")
253+
}
254+
}
255+
}
256+
}
257+
224258
test("null literals") {
225259
val batchSize = 1000
226260
Seq(true, false).foreach { dictionaryEnabled =>

0 commit comments

Comments
 (0)