Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskuzZ committed Oct 10, 2024
1 parent b4671b0 commit f2e7ab6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class ColumnInfo implements Serializable {
* Indicates whether the column is a virtual column.
*/
private boolean isVirtualCol;

private boolean isPartitionCol;

private ObjectInspector objectInspector;

Expand Down Expand Up @@ -117,6 +119,7 @@ public ColumnInfo(String internalName, ObjectInspector objectInspector, boolean
this.isVirtualCol = isVirtualCol;
this.isHiddenVirtualCol = isHiddenVirtualCol;
this.nullable = nullable;

setTypeName(getType().getTypeName());
}

Expand All @@ -126,6 +129,7 @@ public ColumnInfo(ColumnInfo columnInfo) {
this.isSkewedCol = columnInfo.isSkewedCol();
this.tabAlias = columnInfo.getTabAlias();
this.isVirtualCol = columnInfo.getIsVirtualCol();
this.isPartitionCol = columnInfo.getIsPartitionCol();
this.isHiddenVirtualCol = columnInfo.isHiddenVirtualCol();
this.nullable = columnInfo.nullable;
this.setType(columnInfo.getType());
Expand Down Expand Up @@ -166,9 +170,13 @@ public String getTabAlias() {
}

public boolean getIsVirtualCol() {
return isVirtualCol;
return isVirtualCol || isPartitionCol;
}

public boolean getIsPartitionCol() {
return isPartitionCol;
}

public boolean isHiddenVirtualCol() {
return isHiddenVirtualCol;
}
Expand Down Expand Up @@ -197,6 +205,10 @@ public void setVirtualCol(boolean isVirtualCol) {
this.isVirtualCol = isVirtualCol;
}

public void setPartitionCol(boolean isPartitionCol) {
this.isPartitionCol = isPartitionCol;
}

public void setHiddenVirtualCol(boolean isHiddenVirtualCol) {
this.isHiddenVirtualCol = isHiddenVirtualCol;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public static void setupNeededColumns(TableScanOperator scanOp, RowSchema inputR
continue;
}
referencedColumnNames.add(column);
if (colInfo.getIsVirtualCol()) {
if (colInfo.getIsVirtualCol() && !colInfo.getIsPartitionCol()) {
// part is also a virtual column, but part col should not in this
// list.
for (int j = 0; j < virtualCols.size(); j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11963,7 +11963,7 @@ private Operator genTablePlan(String alias, QB qb) throws SemanticException {
TypeInfoUtils.getTypeInfoFromObjectInspector(fields.get(i)
.getFieldObjectInspector()), alias, false);
if (partCols.contains(colInfo.getInternalName())) {
colInfo.setVirtualCol(true);
colInfo.setPartitionCol(true);
}
colInfo.setSkewedCol(isSkewedCol(alias, qb, fields.get(i).getFieldName()));
rwsch.put(alias, fields.get(i).getFieldName(), colInfo);
Expand Down

0 comments on commit f2e7ab6

Please sign in to comment.