You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/12/08 13:09:38 UTC
[GitHub] [hive] kasakrisz commented on a diff in pull request #3843: HIVE-26817: Set column names in result schema when plan has Values root
kasakrisz commented on code in PR #3843:
URL: https://github.com/apache/hive/pull/3843#discussion_r1043335467
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveValues.java:
##########
@@ -43,4 +45,18 @@ public HiveValues(RelOptCluster cluster, RelDataType rowType, ImmutableList<Immu
public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) {
return new HiveValues(getCluster(), getRowType(), tuples, getTraitSet());
}
+
+ public RelNode copy(List<String> newColumnNames) throws CalciteSemanticException {
+ if (newColumnNames.size() != getRowType().getFieldCount()) {
+ throw new CalciteSemanticException("The number of new column names and columns in the schema does not match!");
+ }
+
+ RelDataTypeFactory.Builder builder = getCluster().getTypeFactory().builder();
Review Comment:
Refactored this to use `RelDataTypeFactory.Builder.uniquify()`. Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org