-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-42040][SQL] SPJ: Introduce a new API for V2 input partition to report partition statistics #45314
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
[SPARK-42040][SQL] SPJ: Introduce a new API for V2 input partition to report partition statistics #45314
Changes from all commits
5961fe7
c7e464f
a606175
8c6c1e0
c3bcc09
48742a3
9ceaea0
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 |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| * 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.connector.read; | ||
|
|
||
| import java.util.OptionalLong; | ||
|
|
||
| /** | ||
| * A mix-in for input partitions whose records are clustered on the same set of partition keys | ||
| * (provided via {@link SupportsReportPartitioning}, see below). Data sources can opt-in to | ||
| * implement this interface for the partitions they report to Spark, which will use the info | ||
| * to decide whether partition grouping should be applied or not. | ||
| * | ||
| * @see org.apache.spark.sql.connector.read.SupportsReportPartitioning | ||
| * @since 4.0.0 | ||
| */ | ||
| public interface HasPartitionStatistics extends InputPartition { | ||
|
|
||
| /** | ||
| * Returns the size in bytes of the partition statistics associated to this partition. | ||
| */ | ||
| OptionalLong sizeInBytes(); | ||
|
|
||
| /** | ||
|
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. Nit: can we add some newline between method and next line?
Contributor
Author
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. Thank you @szehon-ho for review, addressed in latest PR. |
||
| * Returns the number of rows in the partition statistics associated to this partition. | ||
| */ | ||
| OptionalLong numRows(); | ||
|
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. @zhuqi-lucas could we add some comments for
Contributor
Author
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. Thank you @sunchao for this suggestion, addressed latest PR. |
||
|
|
||
| /** | ||
| * Returns the count of files in the partition statistics associated to this partition. | ||
| */ | ||
| OptionalLong filesCount(); | ||
| } | ||
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.
How about
ReportStatisticsPartition?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.
Thanks @beliefer for review , because we use HasPartitionKey for the partition key, so i keep the name for HasPartitionStatistics, it is consistent for SPJ feature.