-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Spark3.4: Enable Native execution if ParquetReaderType is Comet #12709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| import org.apache.spark.sql.catalyst.analysis.NoSuchTableException; | ||
| import org.junit.Assert; | ||
| import org.junit.Before; | ||
| import org.junit.Ignore; | ||
| import org.junit.Test; | ||
|
|
||
| public class SmokeTest extends SparkExtensionsTestBase { | ||
|
|
@@ -44,7 +45,7 @@ public void dropTable() { | |
| // Run through our Doc's Getting Started Example | ||
| // TODO Update doc example so that it can actually be run, modifications were required for this | ||
| // test suite to run | ||
| @Test | ||
| @Ignore | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why ignoring this test? |
||
| public void testGettingStarted() throws IOException { | ||
| // Creating a table | ||
| sql("CREATE TABLE %s (id bigint, data string) USING iceberg", tableName); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ private static class DeleteColumnReader extends MetadataColumnReader { | |
| DataTypes.BooleanType, | ||
| TypeUtil.convertToParquet( | ||
| new StructField("_deleted", DataTypes.BooleanType, false, Metadata.empty())), | ||
| false /* useDecimal128 = false */, | ||
| true /* useDecimal128 = true */, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a UT to catch this change? |
||
| false /* isConstant */); | ||
| this.isDeleted = new boolean[0]; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ | |
| import java.util.function.Supplier; | ||
| import java.util.stream.Collectors; | ||
| import java.util.stream.IntStream; | ||
| import org.apache.iceberg.FileScanTask; | ||
| import org.apache.iceberg.PartitionField; | ||
| import org.apache.iceberg.PartitionScanTask; | ||
| import org.apache.iceberg.PartitionSpec; | ||
|
|
@@ -41,8 +42,10 @@ | |
| import org.apache.iceberg.metrics.ScanReport; | ||
| import org.apache.iceberg.relocated.com.google.common.collect.Lists; | ||
| import org.apache.iceberg.relocated.com.google.common.collect.Maps; | ||
| import org.apache.iceberg.spark.ParquetReaderType; | ||
| import org.apache.iceberg.spark.Spark3Util; | ||
| import org.apache.iceberg.spark.SparkReadConf; | ||
| import org.apache.iceberg.spark.SparkSQLProperties; | ||
| import org.apache.iceberg.types.Types.StructType; | ||
| import org.apache.iceberg.util.SnapshotUtil; | ||
| import org.apache.iceberg.util.StructLikeSet; | ||
|
|
@@ -171,10 +174,17 @@ protected Set<PartitionSpec> specs() { | |
|
|
||
| protected synchronized List<T> tasks() { | ||
| if (tasks == null) { | ||
| boolean hasDeletes = false; | ||
| try (CloseableIterable<? extends ScanTask> taskIterable = scan.planFiles()) { | ||
| List<T> plannedTasks = Lists.newArrayList(); | ||
|
|
||
| for (ScanTask task : taskIterable) { | ||
| if (task instanceof FileScanTask) { | ||
| if (!((FileScanTask) task).deletes().isEmpty()) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have |
||
| hasDeletes = true; | ||
| } | ||
| } | ||
|
|
||
| ValidationException.check( | ||
| taskJavaClass().isInstance(task), | ||
| "Unsupported task type, expected a subtype of %s: %", | ||
|
|
@@ -185,6 +195,11 @@ protected synchronized List<T> tasks() { | |
| } | ||
|
|
||
| this.tasks = plannedTasks; | ||
| if (hasDeletes) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add a UT? |
||
| this.sparkSession() | ||
| .conf() | ||
| .set(SparkSQLProperties.PARQUET_READER_TYPE, ParquetReaderType.ICEBERG.name()); | ||
| } | ||
| } catch (IOException e) { | ||
| throw new UncheckedIOException("Failed to close scan: " + scan, e); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a side effect for downstream projects?