本文整理匯總了Java中com.cloudera.sqoop.tool.CreateHiveTableTool類的典型用法代碼示例。如果您正苦於以下問題:Java CreateHiveTableTool類的具體用法?Java CreateHiveTableTool怎麽用?Java CreateHiveTableTool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CreateHiveTableTool類屬於com.cloudera.sqoop.tool包,在下文中一共展示了CreateHiveTableTool類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testCreateOverwriteHiveImport
import com.cloudera.sqoop.tool.CreateHiveTableTool; //導入依賴的package包/類
/**
* Test that table is created in hive and replaces the existing table if
* any.
*/
@Test
public void testCreateOverwriteHiveImport() throws IOException {
final String TABLE_NAME = "CREATE_OVERWRITE_HIVE_IMPORT";
setCurTableName(TABLE_NAME);
setNumCols(3);
String [] types = { "VARCHAR(32)", "INTEGER", "CHAR(64)" };
String [] vals = { "'test'", "42", "'somestring'" };
String [] extraArgs = {"--hive-overwrite", "--create-hive-table"};
runImportTest(TABLE_NAME, types, vals,
"createOverwriteImport.q", getCreateHiveTableArgs(extraArgs),
new CreateHiveTableTool());
runImportTest(TABLE_NAME, types, vals,
"createOverwriteImport.q", getCreateHiveTableArgs(extraArgs),
new CreateHiveTableTool());
}
示例2: testCreateOnlyHiveImport
import com.cloudera.sqoop.tool.CreateHiveTableTool; //導入依賴的package包/類
/** Test that table is created in hive with no data import. */
@Test
public void testCreateOnlyHiveImport() throws IOException {
final String TABLE_NAME = "CREATE_ONLY_HIVE_IMPORT";
setCurTableName(TABLE_NAME);
setNumCols(3);
String [] types = { "VARCHAR(32)", "INTEGER", "CHAR(64)" };
String [] vals = { "'test'", "42", "'somestring'" };
runImportTest(TABLE_NAME, types, vals,
"createOnlyImport.q", getCreateHiveTableArgs(null),
new CreateHiveTableTool());
}
示例3: testCreateOverwriteHiveImport
import com.cloudera.sqoop.tool.CreateHiveTableTool; //導入依賴的package包/類
/**
* Test that table is created in hive and replaces the existing table if
* any.
*/
@Test
public void testCreateOverwriteHiveImport() throws IOException {
final String TABLE_NAME = "CREATE_OVERWRITE_HIVE_IMPORT";
setCurTableName(TABLE_NAME);
setNumCols(3);
String [] types = { "VARCHAR(32)", "INTEGER", "CHAR(64)" };
String [] vals = { "'test'", "42", "'somestring'" };
String [] extraArgs = {"--hive-overwrite", "--create-hive-table"};
runImportTest(TABLE_NAME, types, vals,
"createOverwriteImport.q", getCreateHiveTableArgs(extraArgs),
new CreateHiveTableTool());
}