Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Allow connecting to a single schema without writing a model. Currently, to use a SchemaFactory you need to write a model.json file, but with this feature, you could specify the same information as connect string parameters.
Examples
1. JDBC (built-in). Instead of writing a model with
{ type: 'jdbc', name: 'FOODMART', jdbcUser: 'FOODMART', jdbcPassword: 'FOODMART', jdbcUrl: 'jdbc:hsqldb:res:foodmart', jdbcSchema: 'foodmart' }
use the connect string jdbc:calcite:schema_type=jdbc; schema.jdbcUser=FOODMART; schema.jdbcPassword=FOODMART; schema.jdbcUrl='jdbc:hsqldb:res:foodmart'; schema.jdbcSchema=foodmart
2. Mongo (user-defined). Instead of writing a model with
{ type: 'custom', name: 'mongo_raw', factory: 'org.apache.calcite.adapter.mongodb.MongoSchemaFactory', operand: { host: 'localhost', database: 'test' } }
use the connect string jdbc:calcite:schemaFactory=org.apache.calcite.adapter.mongodb.MongoSchemaFactory; schema.host=localhost; schema.database=test
3. Cassandra (user-defined). Instead of writing a model with
{ type: 'custom', name: 'twissandra', factory: 'org.apache.calcite.adapter.cassandra.CassandraSchemaFactory', operand: { host: 'localhost', keyspace: 'twissandra' } }
use the connect string jdbc:calcite:schemaFactory=org.apache.calcite.adapter.cassandra.CassandraSchemaFactory; schema.host=localhost; schema.keyspace=twissandra
You can supply any operand supported by the adapter, as long as you prefix its name with "schema.".
Attachments
Issue Links
- depends upon
-
CALCITE-1263 Case-insensitive match and null default value for enum properties
- Closed
- is duplicated by
-
CALCITE-109 Add JDBC options so that you can connect to MongoDB without a model file
- Closed