Class MongoScanBuilder
- java.lang.Object
-
- com.mongodb.spark.sql.connector.read.MongoScanBuilder
-
- All Implemented Interfaces:
ScanBuilder
,SupportsPushDownFilters
,SupportsPushDownRequiredColumns
@Internal public final class MongoScanBuilder extends java.lang.Object implements ScanBuilder, SupportsPushDownFilters, SupportsPushDownRequiredColumns
A builder for aMongoScan
.
-
-
Constructor Summary
Constructors Constructor Description MongoScanBuilder(StructType schema, ReadConfig readConfig)
Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Scan
build()
void
pruneColumns(StructType requiredSchema)
Filter[]
pushedFilters()
Filter[]
pushFilters(Filter[] filters)
Processes filters on the dataset.
-
-
-
Constructor Detail
-
MongoScanBuilder
public MongoScanBuilder(StructType schema, ReadConfig readConfig)
Construct a new instance- Parameters:
schema
- the schema to use for the readreadConfig
- the configuration for the read
-
-
Method Detail
-
build
public Scan build()
- Specified by:
build
in interfaceScanBuilder
- Returns:
- the
MongoScan
for the configured scan
-
pushFilters
public Filter[] pushFilters(Filter[] filters)
Processes filters on the dataset.Sets any filters that can be pushed down into an aggregation `$match` pipeline stage.
- Specified by:
pushFilters
in interfaceSupportsPushDownFilters
- Parameters:
filters
- data filters- Returns:
- any filters for Spark to process
-
pushedFilters
public Filter[] pushedFilters()
- Specified by:
pushedFilters
in interfaceSupportsPushDownFilters
- Returns:
- any filters that have been converted into an aggregation pipeline.
-
pruneColumns
public void pruneColumns(StructType requiredSchema)
- Specified by:
pruneColumns
in interfaceSupportsPushDownRequiredColumns
-
-