forked from apache/incubator-gluten
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GLUTEN-5344][VL] Add some parquet example files from parquet-mr for …
…native read test (apache#5345)
- Loading branch information
Showing
7 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+7.2 KB
backends-velox/src/test/resources/parquet-for-read/test-append_1.parquet
Binary file not shown.
Binary file added
BIN
+7.2 KB
backends-velox/src/test/resources/parquet-for-read/test-append_2.parquet
Binary file not shown.
Binary file added
BIN
+191 Bytes
backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_1.parquet
Binary file not shown.
Binary file added
BIN
+675 Bytes
backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_2.parquet
Binary file not shown.
Binary file added
BIN
+781 Bytes
backends-velox/src/test/resources/parquet-for-read/test-empty-row-group_3.parquet
Binary file not shown.
Binary file added
BIN
+35 KB
...ends-velox/src/test/resources/parquet-for-read/test-file-with-no-column-indexes-1.parquet
Binary file not shown.
46 changes: 46 additions & 0 deletions
46
backends-velox/src/test/scala/org/apache/spark/sql/execution/VeloxParquetReadSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |