com.cloudera.sqoop.hive
Class TableDefWriter
java.lang.Object
com.cloudera.sqoop.hive.TableDefWriter
public class TableDefWriter
- extends java.lang.Object
Creates (Hive-specific) SQL DDL statements to create tables to hold data
we're importing from another source.
After we import the database into HDFS, we can inject it into Hive using
the CREATE TABLE and LOAD DATA INPATH statements generated by this object.
Field Summary |
static org.apache.commons.logging.Log |
LOG
|
Constructor Summary |
TableDefWriter(SqoopOptions opts,
ConnManager connMgr,
java.lang.String inputTable,
java.lang.String outputTable,
org.apache.hadoop.conf.Configuration config,
boolean withComments)
Creates a new TableDefWriter to generate a Hive CREATE TABLE statement. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
public static final org.apache.commons.logging.Log LOG
TableDefWriter
public TableDefWriter(SqoopOptions opts,
ConnManager connMgr,
java.lang.String inputTable,
java.lang.String outputTable,
org.apache.hadoop.conf.Configuration config,
boolean withComments)
- Creates a new TableDefWriter to generate a Hive CREATE TABLE statement.
- Parameters:
opts
- program-wide optionsconnMgr
- the connection manager used to describe the table.inputTable
- the name of the table to load.outputTable
- the name of the Hive table to create.config
- the Hadoop configuration to use to connect to the dfswithComments
- if true, then tables will be created with a
timestamp comment.
getCreateTableStmt
public java.lang.String getCreateTableStmt()
throws java.io.IOException
- Returns:
- the CREATE TABLE statement for the table to load into hive.
- Throws:
java.io.IOException
getLoadDataStmt
public java.lang.String getLoadDataStmt()
throws java.io.IOException
- Returns:
- the LOAD DATA statement to import the data in HDFS into hive.
- Throws:
java.io.IOException
Copyright © 2010 Cloudera, Inc.