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.boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
name()
The name of this table.ScanBuilder
newScanBuilder(CaseInsensitiveStringMap options)
Returns aMongoScanBuilder
.WriteBuilder
newWriteBuilder(LogicalWriteInfo info)
Returns aMongoWriteBuilder
.Transform[]
partitioning()
java.util.Map<java.lang.String,java.lang.String>
properties()
StructType
schema()
Returns the schema of this table.java.lang.String
toString()
-
-
-
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:
newWriteBuilder
in interfaceSupportsWrite
- Parameters:
info
- the logical write info
-
newScanBuilder
public ScanBuilder newScanBuilder(CaseInsensitiveStringMap options)
Returns aMongoScanBuilder
.- Specified by:
newScanBuilder
in interfaceSupportsRead
- Parameters:
options
- theCaseInsensitiveStringMap
with configuration regarding the read
-
schema
public StructType schema()
Returns the schema of this table.
-
partitioning
public Transform[] partitioning()
- Specified by:
partitioning
in interfaceTable
-
properties
public java.util.Map<java.lang.String,java.lang.String> properties()
- Specified by:
properties
in interfaceTable
-
capabilities
public java.util.Set<TableCapability> capabilities()
Returns the set of capabilities for this table.- Specified by:
capabilities
in interfaceTable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-