mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 01:31:04 +08:00
SQOOP-3438 Sqoop Import with create hcatalog table for ORC will not work with Hive3 as the table created would be a ACID table and transactional
Adding tests Change-Id: I03eb99c469e030deff84982c724a72f311a0f631
This commit is contained in:
parent
16db85f335
commit
ec707d0b38
@ -770,6 +770,29 @@ public void testTableCreation() throws Exception {
|
||||
null, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExternalTableCreation() throws Exception {
|
||||
final int TOTAL_RECORDS = 1 * 10;
|
||||
String table = getTableName().toUpperCase();
|
||||
ColumnGenerator[] cols = new ColumnGenerator[] {
|
||||
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(0),
|
||||
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING, 0, 0,
|
||||
new HiveVarchar("1", 20), "1", KeyType.STATIC_KEY),
|
||||
HCatalogTestUtils.colGenerator(HCatalogTestUtils.forIdx(1),
|
||||
"varchar(20)", Types.VARCHAR, HCatFieldSchema.Type.STRING, 0, 0,
|
||||
new HiveVarchar("2", 20), "2", KeyType.DYNAMIC_KEY),
|
||||
};
|
||||
List<String> addlArgsArray = new ArrayList<String>();
|
||||
addlArgsArray.add("--create-hcatalog-table");
|
||||
addlArgsArray.add("--hcatalog-external-table");
|
||||
addlArgsArray.add("--hcatalog-storage-stanza");
|
||||
addlArgsArray.add("\"stored as orc tblproperties (\"transactional\"=\"false\")\"");
|
||||
setExtraArgs(addlArgsArray);
|
||||
utils.dropHCatTableIfExists(table, SqoopHCatUtilities.DEFHCATDB);
|
||||
runHCatImport(addlArgsArray, TOTAL_RECORDS, table, cols,
|
||||
null, true, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTableCreationWithPartition() throws Exception {
|
||||
final int TOTAL_RECORDS = 1 * 10;
|
||||
|
Loading…
Reference in New Issue
Block a user