Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Name → local name to be able to reference the connector with. This name is shown in "show connectors" and will be used in connector DDLs like drop/alter and also in "create remote database .." statements.
  • TYPE → "HIVEJDBC" so Hive Metastore knows that Connector class to use.
  • URL → JDBC URL for the remote HiveServer instance.
  • DCPROPERTIES → This is a freeform list that contains other info like credentials and other optional properties. These properties will be passed onto the table definitions for the databases created using this connector.

How do I use it?

  1. Create a connector first.
        CREATE CONNECTOR hiveserver_connector TYPE 'hivejdbc' URL 'jdbc:hive2://<maskedhost>:10000' WITH DCPROPERTIES ("hive.sql.dbcp.username"="hive", "hive.sql.dbcp.password"="hive");

  2. Create a database of type REMOTE in hive using the connector from Step1.   This maps a remote database named "default" to a hive database named "hiveserver_remote" in hive.
         CREATE REMOTE DATABASE hiveserver_remote USING hiveserver_connector WITH DBPROPERTIES ("connector.remoteDbName"="default");

3. Use the tables in REMOTE database much like the JDBC-storagehandler based tables in hive. One big difference is that the metadata for these tables are never persisted in hive. Currently, create/alter/drop table DDLs are not supported in REMOTE databases.

        0: jdbc:hive2://localhost:10000> USE hiveserver_remote;

...