trait SupportsRuntimeV2Filtering extends Scan
A mix-in interface for Scan. Data sources can implement this interface if they can
filter initially planned InputPartitions using predicates Spark infers at runtime.
This interface is very similar to SupportsRuntimeFiltering except it uses
data source V2 Predicate instead of data source V1 Filter.
SupportsRuntimeV2Filtering is preferred over SupportsRuntimeFiltering
and only one of them should be implemented by the data sources.
Note that Spark will push runtime filters only if they are beneficial.
- Annotations
- @Experimental()
- Since
3.4.0
- Alphabetic
- By Inheritance
- SupportsRuntimeV2Filtering
- Scan
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
filter(predicates: Array[Predicate]): Unit
Filters this scan using runtime predicates.
Filters this scan using runtime predicates.
The provided expressions must be interpreted as a set of predicates that are ANDed together. Implementations may use the predicates to prune initially planned
InputPartitions.If the scan also implements
SupportsReportPartitioning, it must preserve the originally reported partitioning during runtime filtering. While applying runtime predicates, the scan may detect that someInputPartitions have no matching data. It can omit such partitions entirely only if it does not report a specific partitioning. Otherwise, the scan can replace the initially plannedInputPartitions that have no matching data with emptyInputPartitions but must preserve the overall number of partitions.Note that Spark will call
Scan#toBatch()again after filtering the scan at runtime.- predicates
data source V2 predicates used to filter the scan at runtime
-
abstract
def
filterAttributes(): Array[NamedReference]
Returns attributes this scan can be filtered by at runtime.
Returns attributes this scan can be filtered by at runtime.
Spark will call
#filter(Predicate[])if it can derive a runtime predicate for any of the filter attributes. -
abstract
def
readSchema(): StructType
Returns the actual schema of this data source scan, which may be different from the physical schema of the underlying storage, as column pruning or other optimizations may happen.
Returns the actual schema of this data source scan, which may be different from the physical schema of the underlying storage, as column pruning or other optimizations may happen.
- Definition Classes
- Scan
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
columnarSupportMode(): ColumnarSupportMode
Subclasses can implement this method to indicate if the support for columnar data should be determined by each partition or is set as a default for the whole scan.
Subclasses can implement this method to indicate if the support for columnar data should be determined by each partition or is set as a default for the whole scan.
- Definition Classes
- Scan
- Since
3.5.0
-
def
description(): String
A description string of this scan, which may includes information like: what filters are configured for this scan, what's the value of some important options like path, etc.
A description string of this scan, which may includes information like: what filters are configured for this scan, what's the value of some important options like path, etc. The description doesn't need to include
#readSchema(), as Spark already knows it.By default this returns the class name of the implementation. Please override it to provide a meaningful description.
- Definition Classes
- Scan
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
reportDriverMetrics(): Array[CustomTaskMetric]
Returns an array of custom metrics which are collected with values at the driver side only.
Returns an array of custom metrics which are collected with values at the driver side only. Note that these metrics must be included in the supported custom metrics reported by
supportedCustomMetrics.- Definition Classes
- Scan
-
def
supportedCustomMetrics(): Array[CustomMetric]
Returns an array of supported custom metrics with name and description.
Returns an array of supported custom metrics with name and description. By default it returns empty array.
- Definition Classes
- Scan
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toBatch(): Batch
Returns the physical representation of this scan for batch query.
Returns the physical representation of this scan for batch query. By default this method throws exception, data sources must overwrite this method to provide an implementation, if the
Tablethat creates this scan returnsTableCapability#BATCH_READsupport in itsTable#capabilities().If the scan supports runtime filtering and implements
SupportsRuntimeFiltering, this method may be called multiple times. Therefore, implementations can cache some state to avoid planning the job twice.- Definition Classes
- Scan
- Exceptions thrown
-
def
toContinuousStream(checkpointLocation: String): ContinuousStream
Returns the physical representation of this scan for streaming query with continuous mode.
Returns the physical representation of this scan for streaming query with continuous mode. By default this method throws exception, data sources must overwrite this method to provide an implementation, if the
Tablethat creates this scan returnsTableCapability#CONTINUOUS_READsupport in itsTable#capabilities().- checkpointLocation
a path to Hadoop FS scratch space that can be used for failure recovery. Data streams for the same logical source in the same query will be given the same checkpointLocation.
- Definition Classes
- Scan
- Exceptions thrown
-
def
toMicroBatchStream(checkpointLocation: String): MicroBatchStream
Returns the physical representation of this scan for streaming query with micro-batch mode.
Returns the physical representation of this scan for streaming query with micro-batch mode. By default this method throws exception, data sources must overwrite this method to provide an implementation, if the
Tablethat creates this scan returnsTableCapability#MICRO_BATCH_READsupport in itsTable#capabilities().- checkpointLocation
a path to Hadoop FS scratch space that can be used for failure recovery. Data streams for the same logical source in the same query will be given the same checkpointLocation.
- Definition Classes
- Scan
- Exceptions thrown
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()