Reputation: 2238
I sort of expected this to be there in place, but apparantly not. Hive doesnt expose its own metadata within its environment. For example, like Oracle does, it allows you to use "user_tables" for tables you created.
I understand and appreciate the fact that hive metadata is stored externally in an RDBMS, but as a user building different kinds of queries, its useful to have access to the contextual metadata of the environment i m working in.
Since HCatalog exposes the metadata to anyone willing, why cant hive engine pick up the same and allow it to be visible !
I know some of the challenges which might come along the way to implement this, but what i m asking is, "whether there is any work stream active to achieve something similar to this?"
As a user, I do need it.
Upvotes: 0
Views: 221
Reputation: 110
Hive Version 3.0.0 introduced the information_schema database itself in hive. Where we can explore the basic Hive metadata. As well as there is another database called sys and it have all metadata related information.
You can refer the following link for this.
https://issues.apache.org/jira/browse/HIVE-1010
Upvotes: 3
Reputation: 38335
You wrote: "I understand and appreciate the fact that hive metadata is stored externally in an RDBMS". Then try JDBC storage handler: https://github.com/qubole/Hive-JDBC-Storage-Handler
You can create table in Hive like in this example and query it like any other native Hive table:
DROP TABLE HiveTable;
CREATE EXTERNAL TABLE HiveTable(
id INT,
id_double DOUBLE,
names STRING,
test INT
)
STORED BY 'org.apache.hadoop.hive.jdbc.storagehandler.JdbcStorageHandler'
TBLPROPERTIES (
"mapred.jdbc.driver.class"="com.mysql.jdbc.Driver",
"mapred.jdbc.url"="jdbc:mysql://localhost:3306/rstore",
"mapred.jdbc.username"="root",
"mapred.jdbc.input.table.name"="JDBCTable",
"mapred.jdbc.output.table.name"="JDBCTable",
"mapred.jdbc.password"="",
"mapred.jdbc.hive.lazy.split"= "false"
);
Upvotes: 0