You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Sadystio Ilmatunt <ur...@gmail.com> on 2014/08/01 00:01:09 UTC

Getting metadata of a SELECT statement without executing it.

Hi,

In my company, we are working on creating hadoop-hive connector that
allows to run query on hive and import its result ( query result ).
Before we run the query on hive, we need to understand what output
schema it would generate.
Is there anyway to do that using any of hive clients ? (Thrift/JDBC etc) ?
If such feature is not available, how difficult is it to implement ?

JDBC API provides such feature. See below for information about oracle
db implementation of PreparedStatement.getMetaData() JDBC API. It
appears hive does not implement it.
We are ok even if it is not implemented in JDBC but available through
Thrift client.

--
>From Oracle release notes:
-

PreparedStatement.getMetaData() Method
Starting from Oracle Database 11g Release 2 (11.2), JDBC drivers
support obtaining the metadata of a SELECT statement without executing
the PreparedStatement. This feature works even with the earlier
database releases. For more information, please refer to "Interface
oracle.jdbc.OraclePreparedStatement".

At this link:
http://docs.oracle.com/cd/E11882_01/java.112/e16548/whatsnew.htm#JJDBC28019