diff --git a/backends-velox/src/test/resources/parquet-for-read/test-append_1.parquet b/backends-velox/src/test/resources/parquet-for-read/test-append_1.parquet new file mode 100644 index 000000000000..a255f86ebcf8 Binary files /dev/null and b/backends-velox/src/test/resources/parquet-for-read/test-append_1.parquet differ diff --git a/backends-velox/src/test/resources/parquet-for-read/test-append_2.parquet b/backends-velox/src/test/resources/parquet-for-read/test-append_2.parquet new file mode 100644 index 000000000000..3081f893f58d Binary files /dev/null and b/backends-velox/src/test/resources/parquet-for-read/test-append_2.parquet differ diff --git a/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_1.parquet b/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_1.parquet new file mode 100644 index 000000000000..ac8c2dcff16f Binary files /dev/null and b/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_1.parquet differ diff --git a/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_2.parquet b/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_2.parquet new file mode 100644 index 000000000000..56fe96fed0a6 Binary files /dev/null and b/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_2.parquet differ diff --git a/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_3.parquet b/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_3.parquet new file mode 100644 index 000000000000..7efd8a81a88c Binary files /dev/null and b/backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_3.parquet differ diff --git a/backends-velox/src/test/resources/parquet-for-read/test-file-with-no-column-indexes-1.parquet b/backends-velox/src/test/resources/parquet-for-read/test-file-with-no-column-indexes-1.parquet new file mode 100644 index 000000000000..722e687ee63a Binary files /dev/null and b/backends-velox/src/test/resources/parquet-for-read/test-file-with-no-column-indexes-1.parquet differ diff --git a/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetReadSuite.scala b/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetReadSuite.scala new file mode 100644 index 000000000000..d5828c738f33 --- /dev/null +++ b/backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetReadSuite.scala @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.execution + +import org.apache.gluten.execution.{BasicScanExecTransformer, VeloxWholeStageTransformerSuite} + +import java.io.File + +class VeloxParquetReadSuite extends VeloxWholeStageTransformerSuite { + override protected val resourcePath: String = "/parquet-for-read" + override protected val fileFormat: String = "parquet" + + testWithSpecifiedSparkVersion("read example parquet files", Some("3.5"), Some("3.5")) { + withTable("test_table") { + val dir = new File(getClass.getResource(resourcePath).getFile) + val files = dir.listFiles + if (files != null) { + files.foreach { + file => + // Exclude parquet files failed to read by velox for now + if (file.getName != "test-file-with-no-column-indexes-1.parquet") { + val df = spark.read.parquet(file.getAbsolutePath) + df.createOrReplaceTempView("test_table") + runQueryAndCompare("select * from test_table") { + checkGlutenOperatorMatch[BasicScanExecTransformer] + } + } + } + } + } + } +}