Class MongoScan

  • All Implemented Interfaces:
    Scan

    public class MongoScan
    extends java.lang.Object
    implements Scan
    A logical representation of MongoDB data source scan.
    • 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
    • Constructor Detail

      • MongoScan

        public MongoScan​(StructType schema,
                         ReadConfig readConfig)
        Construct a new instance
        Parameters:
        schema - the schema for the data
        readConfig - 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 interface Scan
      • description

        public java.lang.String description()
        A description string of this scan.
        Specified by:
        description in interface Scan
      • toBatch

        public Batch toBatch()
        Returns the physical representation of this scan for batch query.
        Specified by:
        toBatch in interface Scan
      • 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 interface Scan