Skip to content

Commit 9878ee1

Browse files
committed
corrected bucket-map-join test
1 parent 565a2eb commit 9878ee1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,9 @@ private boolean isTableTypeSet() {
632632
}
633633

634634
public FieldSchema getPartColByName(String colName) {
635-
return getPartCols().stream()
636-
.filter(key -> key.getName().toLowerCase().equals(colName))
637-
.findFirst().orElse(null);
635+
return hasNonNativePartitionSupport() ? null : getPartCols().stream()
636+
.filter(key -> key.getName().toLowerCase().equals(colName))
637+
.findFirst().orElse(null);
638638
}
639639

640640
public List<String> getPartColNames() {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12001,6 +12001,8 @@ private Operator genTablePlan(String alias, QB qb) throws SemanticException {
1200112001
// Determine row schema for TSOP.
1200212002
// Include column names from SerDe, the partition and virtual columns.
1200312003
rwsch = new RowResolver();
12004+
Set<String> partCols = tab.hasNonNativePartitionSupport() ?
12005+
Sets.newHashSet(tab.getPartColNames()) : Collections.emptySet();
1200412006
try {
1200512007
// Including parameters passed in the query
1200612008
if (properties != null) {
@@ -12018,8 +12020,6 @@ private Operator genTablePlan(String alias, QB qb) throws SemanticException {
1201812020
deserializer.handleJobLevelConfiguration(conf);
1201912021
List<? extends StructField> fields = rowObjectInspector
1202012022
.getAllStructFieldRefs();
12021-
Set<String> partCols = tab.hasNonNativePartitionSupport() ?
12022-
Sets.newHashSet(tab.getPartColNames()) : Collections.emptySet();
1202312023
for (int i = 0; i < fields.size(); i++) {
1202412024
/**
1202512025
* if the column is a skewed column, use ColumnInfo accordingly
@@ -12039,6 +12039,9 @@ private Operator genTablePlan(String alias, QB qb) throws SemanticException {
1203912039
// Hack!! - refactor once the metadata APIs with types are ready
1204012040
// Finally add the partitioning columns
1204112041
for (FieldSchema part_col : tab.getPartCols()) {
12042+
if(partCols.contains(part_col.getName())){
12043+
break;
12044+
}
1204212045
LOG.trace("Adding partition col: " + part_col);
1204312046
rwsch.put(alias, part_col.getName(), new ColumnInfo(part_col.getName(),
1204412047
TypeInfoFactory.getPrimitiveTypeInfo(part_col.getType()), alias, true));

0 commit comments

Comments
 (0)