hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Ramadorai <jramado...@tripadvisor.com>
Subject Extract Create Table statement from Hive
Date Mon, 21 Feb 2011 23:42:55 GMT
Does anyone have a way of generating the create table statement for a table that is in Hive?
 I see a jira for this https://issues.apache.org/jira/browse/HIVE-967 and it appears that
Ed Capriolo might have a solution for this. Ed, are you able to share this solution? 

My goal is to copy a bunch of Hive tables from one cluster to another. What I'd like to do
is generate the DDL from one cluster and run it on the other, and then use DISTCP with lots
of mappers to parallel-copy the table-data between the clusters. FYI, my metadata is in Derby.
I could backup and restore the metadata directories but I dont want a copy of all the tables
from the source database, only a subset. 

I tried Sqooping the table out of Hive, but it runs into :
11/02/21 18:23:50 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException:
Method not supported
11/02/21 18:23:50 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
	at com.cloudera.sqoop.hive.TableDefWriter.getCreateTableStmt(TableDefWriter.java:133)

Apparently the Hive Thrift jdbc driver doesnt support extracting table metadata.

Please feel free to suggest alternative approaches. 

thanks
Jay


Mime
View raw message