Skip to content

Commit 831b9b2

Browse files
committed
corrected load, partition evolution tests
1 parent 8dc7809 commit 831b9b2

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AlterTableUtils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public static boolean isSchemaEvolutionEnabled(Table table, Configuration conf)
7575
}
7676

7777
public static boolean isFullPartitionSpec(Table table, Map<String, String> partitionSpec) {
78+
if (table.hasNonNativePartitionSupport()) {
79+
return true;
80+
}
7881
for (FieldSchema partitionCol : table.getPartCols()) {
7982
if (partitionSpec.get(partitionCol.getName()) == null) {
8083
return false;

ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3067,8 +3067,8 @@ private RelNode genTableLogicalPlan(String tableAlias, QB qb) throws SemanticExc
30673067
// 3.2 Add column info corresponding to partition columns
30683068
for (FieldSchema part_col : tabMetaData.getPartCols()) {
30693069
colName = part_col.getName();
3070-
if (alreadyAdded.contains(colName)) {
3071-
continue;
3070+
if (tabMetaData.hasNonNativePartitionSupport()) {
3071+
break;
30723072
}
30733073
colInfo = new ColumnInfo(colName,
30743074
TypeInfoFactory.getPrimitiveTypeInfo(part_col.getType()),

ql/src/java/org/apache/hadoop/hive/ql/parse/LoadSemanticAnalyzer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.net.URISyntaxException;
2424
import java.util.ArrayList;
2525
import java.util.Arrays;
26+
import java.util.Collections;
2627
import java.util.HashMap;
2728
import java.util.LinkedHashMap;
2829
import java.util.List;
@@ -511,7 +512,7 @@ private void reparseAndSuperAnalyze(Table table, URI fromURI) throws SemanticExc
511512

512513
// Partition spec was already validated by caller when create TableSpec object.
513514
// So, need not validate inpPartSpec here.
514-
List<FieldSchema> parts = table.getPartCols();
515+
List<FieldSchema> parts = table.hasNonNativePartitionSupport() ? Collections.emptyList() : table.getPartCols();
515516
if (tableTree.getChildCount() >= 2) {
516517
ASTNode partSpecNode = (ASTNode) tableTree.getChild(1);
517518
inpPartSpec = new HashMap<>(partSpecNode.getChildCount());
@@ -561,7 +562,7 @@ private void reparseAndSuperAnalyze(Table table, URI fromURI) throws SemanticExc
561562
}
562563

563564
rewrittenQueryStr.append(getFullTableNameForSQL((ASTNode)(tableTree.getChild(0))));
564-
addPartitionColsToInsert(table.getPartCols(), inpPartSpec, rewrittenQueryStr);
565+
addPartitionColsToInsert(parts, inpPartSpec, rewrittenQueryStr);
565566
rewrittenQueryStr.append(" select * from ");
566567
rewrittenQueryStr.append(tempTblName);
567568

0 commit comments

Comments
 (0)