Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1259

Allow connecting to a single schema without writing a model

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.0
    • Component/s: None
    • Labels:
      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.".

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.8.0 (2016-06-13).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.8.0 (2016-06-13).
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/80b05c2a .
          Hide
          julianhyde Julian Hyde added a comment -

          Thanks for the review, Michael Mior. I fixed the doc bug you found. I'll commit after CALCITE-1263 is in avatica.

          Show
          julianhyde Julian Hyde added a comment - Thanks for the review, Michael Mior . I fixed the doc bug you found. I'll commit after CALCITE-1263 is in avatica.
          Show
          julianhyde Julian Hyde added a comment - Please review https://github.com/julianhyde/calcite/commit/fe5b0009fdc03aeb255ee5ad86aff50978738a48 .

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development