You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "George Chow (JIRA)" <ji...@apache.org> on 2014/04/30 07:05:14 UTC

[jira] [Created] (DRILL-604) INFORMATION_SCHEMA.SCHEMATA needs to expose the schema type

George Chow created DRILL-604:
---------------------------------

             Summary: INFORMATION_SCHEMA.SCHEMATA needs to expose the schema type
                 Key: DRILL-604
                 URL: https://issues.apache.org/jira/browse/DRILL-604
             Project: Apache Drill
          Issue Type: Bug
            Reporter: George Chow
            Priority: Minor


INFORMATION_SCHEMA.SCHEMATA looks like this currently:

0: jdbc:drill:schema=hivetg> select * from INFORMATION_SCHEMA.SCHEMATA;
+--------------+-------------+--------------+
| CATALOG_NAME | SCHEMA_NAME | SCHEMA_OWNER |
+--------------+-------------+--------------+
| DRILL        | hivestg.default | <owner>      |
| DRILL        | hivestg     | <owner>      |
| DRILL        | dfs.default | <owner>      |
| DRILL        | dfs         | <owner>      |
| DRILL        | cp.default  | <owner>      |
| DRILL        | cp          | <owner>      |
| DRILL        | INFORMATION_SCHEMA | <owner>      |
+--------------+-------------+--------------+
0: jdbc:drill:schema=hivetg> describe INFORMATION_SCHEMA.SCHEMATA;
+-------------+------------+-------------+
| COLUMN_NAME | DATA_TYPE  | IS_NULLABLE |
+-------------+------------+-------------+
| CATALOG_NAME | VARCHAR    | NO          |
| SCHEMA_NAME | VARCHAR    | NO          |
| SCHEMA_OWNER | VARCHAR    | NO          |
+-------------+------------+-------------+
3 rows selected (0.702 seconds)

The ODBC driver needs to get at the schema type from storage-plugins.json to enable the driver to determine how to operate with each schema (e.g., type "file" requires SHOW FILES; "hive" can be used verbatim)

For example, here's the default storage-plugins.json. Here "dfs" is tagged as of type "file" and "hive" is tagged as "hive".
{
  "storage":{
    dfs: {
      type: "file",
      connection: "file:///",
      formats: {
        "psv" : {
          type: "text",
          extensions: [ "tbl" ],
          delimiter: "|"
        },
        "csv" : {
          type: "text",
          extensions: [ "csv" ],
          delimiter: ","
        },
        "tsv" : {
          type: "text",
          extensions: [ "tsv" ],
          delimiter: "\t"
        },
        "parquet" : {
          type: "parquet"
        },
        "json" : {
          type: "json"
        }
      }
    },
    cp: {
      type: "file",
      connection: "classpath:///"
    },
    hivestg : {
        type:"hive",
        config :
          {
            "hive.metastore.uris" : "thrift://192.168.39.33:9083",
            "hive.metastore.sasl.enabled" : "false"
          }
    }

    /*,
    hive : {
        type:"hive",
        config :
          {
            "hive.metastore.uris" : "",
            "javax.jdo.option.ConnectionURL" : "jdbc:derby:;databaseName=../../sample-data/drill_hive_db;create=true",
            "hive.metastore.warehouse.dir" : "/tmp/drill_hive_wh",
            "fs.default.name" : "file:///",
            "hive.metastore.sasl.enabled" : "false"
          }
      }
      */
  }
}

A new column (name "type") added onto SCHEMATA would be sufficient.




--
This message was sent by Atlassian JIRA
(v6.2#6252)