Class MongoScan
- java.lang.Object
-
- com.mongodb.spark.sql.connector.read.MongoScan
-
-
Constructor Summary
Constructors Constructor Description MongoScan(StructType schema, ReadConfig readConfig)
Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
description()
A description string of this scan.StructType
readSchema()
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.Batch
toBatch()
Returns the physical representation of this scan for batch query.ContinuousStream
toContinuousStream(java.lang.String checkpointLocation)
Returns the physical representation of this scan for streaming query with continuous mode.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.spark.sql.connector.read.Scan
toMicroBatchStream
-
-
-
-
Constructor Detail
-
MongoScan
public MongoScan(StructType schema, ReadConfig readConfig)
Construct a new instance- Parameters:
schema
- the schema for the datareadConfig
- the read configuration
-
-
Method Detail
-
readSchema
public StructType readSchema()
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.- Specified by:
readSchema
in interfaceScan
-
description
public java.lang.String description()
A description string of this scan.- Specified by:
description
in interfaceScan
-
toBatch
public Batch toBatch()
Returns the physical representation of this scan for batch query.
-
toContinuousStream
public ContinuousStream toContinuousStream(java.lang.String checkpointLocation)
Returns the physical representation of this scan for streaming query with continuous mode.Utilizes MongoDBs change stream functionality, the continuous streams will consist of change events.
Note: Requires MongoDB 4.2+ To support continuing a change stream after a collection has been dropped.
- Specified by:
toContinuousStream
in interfaceScan
-
-