Package io.trino.plugin.mongodb
Class MongoSession
java.lang.Object
io.trino.plugin.mongodb.MongoSession
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMongoSession(TypeManager typeManager, com.mongodb.client.MongoClient client, MongoClientConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(MongoTableHandle table, ColumnMetadata columnMetadata) booleancollectionExists(com.mongodb.client.MongoDatabase db, String collectionName) voidcreateSchema(String schemaName) voidcreateTable(RemoteTableName name, List<MongoColumnHandle> columns, Optional<String> comment) longdeleteDocuments(RemoteTableName remoteTableName, TupleDomain<ColumnHandle> constraint) voiddropColumn(MongoTableHandle table, String columnName) voiddropSchema(String schemaName, boolean cascade) voiddropTable(RemoteTableName remoteTableName) com.mongodb.client.MongoCursor<org.bson.Document>execute(MongoTableHandle tableHandle, List<MongoColumnHandle> columns) getAllTables(String schema) com.mongodb.client.MongoCollection<org.bson.Document>getCollection(RemoteTableName remoteTableName) getIndexes(String schemaName, String tableName) getTable(SchemaTableName tableName) static List<MongoColumnHandle>projectSufficientColumns(List<MongoColumnHandle> columnHandles) Creates a set of sufficient columns for the input projected columns.voidrenameColumn(MongoTableHandle table, String source, String target) voidrenameTable(MongoTableHandle table, SchemaTableName newName) voidsetColumnComment(MongoTableHandle table, String columnName, Optional<String> comment) voidsetColumnType(MongoTableHandle table, String columnName, Type type) voidsetTableComment(MongoTableHandle table, Optional<String> comment) voidshutdown()toRemoteSchemaTableName(SchemaTableName schemaTableName)
-
Field Details
-
DATABASE_NAME
- See Also:
-
COLLECTION_NAME
- See Also:
-
ID
- See Also:
-
-
Constructor Details
-
MongoSession
public MongoSession(TypeManager typeManager, com.mongodb.client.MongoClient client, MongoClientConfig config)
-
-
Method Details
-
shutdown
public void shutdown() -
getAddresses
-
getAllSchemas
-
createSchema
-
dropSchema
-
getAllTables
- Throws:
SchemaNotFoundException
-
getTable
- Throws:
TableNotFoundException
-
createTable
public void createTable(RemoteTableName name, List<MongoColumnHandle> columns, Optional<String> comment) -
dropTable
-
setTableComment
-
setColumnComment
-
renameTable
-
addColumn
-
renameColumn
-
dropColumn
-
setColumnType
-
getCollection
public com.mongodb.client.MongoCollection<org.bson.Document> getCollection(RemoteTableName remoteTableName) -
getIndexes
-
deleteDocuments
-
execute
public com.mongodb.client.MongoCursor<org.bson.Document> execute(MongoTableHandle tableHandle, List<MongoColumnHandle> columns) -
projectSufficientColumns
public static List<MongoColumnHandle> projectSufficientColumns(List<MongoColumnHandle> columnHandles) Creates a set of sufficient columns for the input projected columns. For example, if input include columns "a.b" and "a.b.c", then they will be projected from a single column "a.b". -
collectionExists
-
toRemoteSchemaTableName
-