Packages

t

org.apache.spark.sql.connector.read

SupportsPushDownAggregates

trait SupportsPushDownAggregates extends ScanBuilder

A mix-in interface for ScanBuilder. Data sources can implement this interface to push down aggregates.

If the data source can't fully complete the grouping work, then #supportCompletePushDown(Aggregation) should return false, and Spark will group the data source output again. For queries like "SELECT min(value) AS m FROM t GROUP BY key", after pushing down the aggregate to the data source, the data source can still output data with duplicated keys, which is OK as Spark will do GROUP BY key again. The final query plan can be something like this:

  Aggregate [key#1], [min(min_value#2) AS m#3]
    +- RelationV2[key#1, min_value#2]
Similarly, if there is no grouping expression, the data source can still output more than one rows.

When pushing down operators, Spark pushes down filters to the data source first, then push down aggregates or apply column pruning. Depends on data source implementation, aggregates may or may not be able to be pushed down with filters. If pushed filters still need to be evaluated after scanning, aggregates can't be pushed down.

Annotations
@Evolving()
Source
SupportsPushDownAggregates.java
Since

3.2.0

Linear Supertypes
ScanBuilder, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SupportsPushDownAggregates
  2. ScanBuilder
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def build(): Scan
    Definition Classes
    ScanBuilder
  2. abstract def pushAggregation(aggregation: Aggregation): Boolean

    Pushes down Aggregation to datasource.

    Pushes down Aggregation to datasource. The order of the datasource scan output columns should be: grouping columns, aggregate columns (in the same order as the aggregate functions in the given Aggregation).

    aggregation

    Aggregation in SQL statement.

    returns

    true if the aggregation can be pushed down to datasource, false otherwise.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  14. def supportCompletePushDown(aggregation: Aggregation): Boolean

    Whether the datasource support complete aggregation push-down.

    Whether the datasource support complete aggregation push-down. Spark will do grouping again if this method returns false.

    aggregation

    Aggregation in SQL statement.

    returns

    true if the aggregation can be pushed down to datasource completely, false otherwise.

  15. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from ScanBuilder

Inherited from AnyRef

Inherited from Any

Ungrouped