@@ -187,47 +187,43 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
187187 }
188188
189189 test(" basic data type support" ) {
190- // this test requires native_comet scan due to unsigned u8/u16 issue
191- withSQLConf(CometConf .COMET_NATIVE_SCAN_IMPL .key -> CometConf . SCAN_NATIVE_COMET ) {
190+ // this test requires COMET_SCAN_ALLOW_INCOMPATIBLE due to unsigned u8/u16 issue
191+ withSQLConf(CometConf .COMET_SCAN_ALLOW_INCOMPATIBLE .key -> " true " ) {
192192 Seq (true , false ).foreach { dictionaryEnabled =>
193193 withTempDir { dir =>
194194 val path = new Path (dir.toURI.toString, " test.parquet" )
195195 makeParquetFileAllPrimitiveTypes(path, dictionaryEnabled = dictionaryEnabled, 10000 )
196- withSQLConf(CometConf .COMET_SCAN_ALLOW_INCOMPATIBLE .key -> " true" ) {
197- withParquetTable(path.toString, " tbl" ) {
198- checkSparkAnswerAndOperator(" select * FROM tbl WHERE _2 > 100" )
199- }
196+ withParquetTable(path.toString, " tbl" ) {
197+ checkSparkAnswerAndOperator(" select * FROM tbl WHERE _2 > 100" )
200198 }
201199 }
202200 }
203201 }
204202 }
205203
206204 test(" uint data type support" ) {
207- // this test requires native_comet scan due to unsigned u8/u16 issue
208- withSQLConf(CometConf .COMET_NATIVE_SCAN_IMPL .key -> CometConf .SCAN_NATIVE_COMET ) {
209- Seq (true , false ).foreach { dictionaryEnabled =>
210- withSQLConf(CometConf .COMET_SCAN_ALLOW_INCOMPATIBLE .key -> " true" ) {
211- withTempDir { dir =>
212- val path = new Path (dir.toURI.toString, " testuint.parquet" )
213- makeParquetFileAllPrimitiveTypes(
214- path,
215- dictionaryEnabled = dictionaryEnabled,
216- Byte .MinValue ,
217- Byte .MaxValue )
218- withParquetTable(path.toString, " tbl" ) {
219- val qry = " select _9 from tbl order by _11"
220- if (usingDataSourceExec(conf)) {
221- // need to convert the values to unsigned values
222- val expected = (Byte .MinValue to Byte .MaxValue )
223- .map(v => {
224- if (v < 0 ) Byte .MaxValue .toShort - v else v
225- })
226- .toDF(" a" )
227- checkAnswer(sql(qry), expected)
228- } else {
229- checkSparkAnswerAndOperator(qry)
230- }
205+ Seq (true , false ).foreach { dictionaryEnabled =>
206+ // this test requires COMET_SCAN_ALLOW_INCOMPATIBLE due to unsigned u8/u16 issue
207+ withSQLConf(CometConf .COMET_SCAN_ALLOW_INCOMPATIBLE .key -> " true" ) {
208+ withTempDir { dir =>
209+ val path = new Path (dir.toURI.toString, " testuint.parquet" )
210+ makeParquetFileAllPrimitiveTypes(
211+ path,
212+ dictionaryEnabled = dictionaryEnabled,
213+ Byte .MinValue ,
214+ Byte .MaxValue )
215+ withParquetTable(path.toString, " tbl" ) {
216+ val qry = " select _9 from tbl order by _11"
217+ if (usingDataSourceExec(conf)) {
218+ // need to convert the values to unsigned values
219+ val expected = (Byte .MinValue to Byte .MaxValue )
220+ .map(v => {
221+ if (v < 0 ) Byte .MaxValue .toShort - v else v
222+ })
223+ .toDF(" a" )
224+ checkAnswer(sql(qry), expected)
225+ } else {
226+ checkSparkAnswerAndOperator(qry)
231227 }
232228 }
233229 }
0 commit comments