...
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;
0: jdbc:hive2://localhost:10000> describe formatted test_emr_tbl;
INFO : Compiling command(queryId=ngangam_20240129181838_56b888dd-a0ba-4bde-a66a-97bba48f6435): describe formatted test_emr_tbl
INFO : Semantic Analysis Completed (retrial = false)
INFO : Created Hive schema: Schema(fieldSchemas:[FieldSchema(name:col_name, type:string, comment:from deserializer), FieldSchema(name:data_type, type:string, comment:from deserializer), FieldSchema(name:comment, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=ngangam_20240129181838_56b888dd-a0ba-4bde-a66a-97bba48f6435); Time taken: 5.234 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=ngangam_20240129181838_56b888dd-a0ba-4bde-a66a-97bba48f6435): describe formatted test_emr_tbl
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=ngangam_20240129181838_56b888dd-a0ba-4bde-a66a-97bba48f6435); Time taken: 0.815 seconds
INFO : OK
+-------------------------------+-------------------------------------------------+----------------------------------------------------+
| col_name | data_type | comment |
+-------------------------------+-------------------------------------------------+----------------------------------------------------+
| tblkey | int | from deserializer |
| descr | string | from deserializer |
| | NULL | NULL |
| # Detailed Table Information | NULL | NULL |
| Database: | emr_db | NULL |
| OwnerType: | USER | NULL |
| Owner: | null | NULL |
| CreateTime: | UNKNOWN | NULL |
| LastAccessTime: | UNKNOWN | NULL |
| Retention: | 0 | NULL |
| Location: | file:/tmp/hive/warehouse/external/test_emr_tbl | NULL |
| Table Type: | EXTERNAL_TABLE | NULL |
| Table Parameters: | NULL | NULL |
| | EXTERNAL | TRUE |
| | hive.sql.database.type | HIVE |
| | hive.sql.dbcp.password | |
| | hive.sql.dbcp.username | hive |
| | hive.sql.jdbc.driver | org.apache.hive.jdbc.HiveDriver |
| | hive.sql.jdbc.url | jdbc:hive2://<maskedIP>.compute-1.amazonaws.com:10000 |
| | hive.sql.schema | default |
| | hive.sql.table | test_emr_tbl |
| | storage_handler | org.apache.hive.storage.jdbc.JdbcStorageHandler |
| | NULL | NULL |
| # Storage Information | NULL | NULL |
| SerDe Library: | org.apache.hive.storage.jdbc.JdbcSerDe | NULL |
| InputFormat: | org.apache.hive.storage.jdbc.JdbcInputFormat | NULL |
| OutputFormat: | org.apache.hive.storage.jdbc.JdbcOutputFormat | NULL |
| Compressed: | No | NULL |
| Num Buckets: | 0 | NULL |
| Bucket Columns: | [] | NULL |
| Sort Columns: | [] | NULL |
| Storage Desc Params: | NULL | NULL |
| | serialization.format | 1 |
+-------------------------------+-------------------------------------------------+----------------------------------------------------+
...