Package com.mongodb.spark.sql.connector
Class MongoTable
- java.lang.Object
-
- com.mongodb.spark.sql.connector.MongoTable
-
- All Implemented Interfaces:
SupportsRead,SupportsWrite,Table
public class MongoTable extends java.lang.Object implements Table, SupportsWrite, SupportsRead
Represents a MongoDB Collection.
-
-
Constructor Summary
Constructors Constructor Description MongoTable(MongoConfig mongoConfig)Construct a new instanceMongoTable(StructType schema, MongoConfig mongoConfig)Construct a new instanceMongoTable(StructType schema, Transform[] partitioning, MongoConfig mongoConfig)Construct a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<TableCapability>capabilities()Returns the set of capabilities for this table.booleanequals(java.lang.Object o)inthashCode()java.lang.Stringname()The name of this table.ScanBuildernewScanBuilder(CaseInsensitiveStringMap options)Returns aMongoScanBuilder.WriteBuildernewWriteBuilder(LogicalWriteInfo info)Returns aMongoWriteBuilder.Transform[]partitioning()java.util.Map<java.lang.String,java.lang.String>properties()StructTypeschema()Returns the schema of this table.java.lang.StringtoString()
-
-
-
Constructor Detail
-
MongoTable
public MongoTable(MongoConfig mongoConfig)
Construct a new instance- Parameters:
mongoConfig- The specified table configuration
-
MongoTable
public MongoTable(StructType schema, MongoConfig mongoConfig)
Construct a new instance- Parameters:
schema- The specified table schema.mongoConfig- The specified table configuration
-
MongoTable
public MongoTable(StructType schema, Transform[] partitioning, MongoConfig mongoConfig)
Construct a new instance- Parameters:
schema- The specified table schema.partitioning- The specified table partitioning.mongoConfig- The specified table configuration
-
-
Method Detail
-
newWriteBuilder
public WriteBuilder newWriteBuilder(LogicalWriteInfo info)
Returns aMongoWriteBuilder.- Specified by:
newWriteBuilderin interfaceSupportsWrite- Parameters:
info- the logical write info
-
newScanBuilder
public ScanBuilder newScanBuilder(CaseInsensitiveStringMap options)
Returns aMongoScanBuilder.- Specified by:
newScanBuilderin interfaceSupportsRead- Parameters:
options- theCaseInsensitiveStringMapwith configuration regarding the read
-
schema
public StructType schema()
Returns the schema of this table.
-
partitioning
public Transform[] partitioning()
- Specified by:
partitioningin interfaceTable
-
properties
public java.util.Map<java.lang.String,java.lang.String> properties()
- Specified by:
propertiesin interfaceTable
-
capabilities
public java.util.Set<TableCapability> capabilities()
Returns the set of capabilities for this table.- Specified by:
capabilitiesin interfaceTable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-