deniskuzZ commented on code in PR #4043:
URL: https://github.com/apache/hive/pull/4043#discussion_r1400802755
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/DynamicPartitionPruningOptimization.java:
##########
@@ -796,31 +787,29 @@ private void createFinalRsForSemiJoinOp(
ExprNodeDesc key, String keyBaseAlias, ExprNodeDesc colExpr,
boolean isHint) throws SemanticException {
ArrayList<String> gbOutputNames = new ArrayList<>();
- // One each for min, max and bloom filter
- gbOutputNames.add(SemanticAnalyzer.getColumnInternalName(0));
- gbOutputNames.add(SemanticAnalyzer.getColumnInternalName(1));
- gbOutputNames.add(SemanticAnalyzer.getColumnInternalName(2));
-
- int colPos = 0;
ArrayList<ExprNodeDesc> rsValueCols = new ArrayList<ExprNodeDesc>();
- for (int i = 0; i < gbOutputNames.size() - 1; i++) {
- ExprNodeColumnDesc expr = new ExprNodeColumnDesc(key.getTypeInfo(),
- gbOutputNames.get(colPos++), "", false);
- rsValueCols.add(expr);
+ Map<String, ExprNodeDesc> columnExprMap = new HashMap<String,
ExprNodeDesc>();
+ ArrayList<ColumnInfo> rsColInfos = new ArrayList<>();
+ List<ColumnInfo> gbySchema = gb.getSchema().getSignature();
+ for (int colPos = 0; colPos < gbySchema.size(); colPos++) {
Review Comment:
use for-each
````
Map<String, ExprNodeDesc> columnExprMap = new HashMap<>();
ArrayList<ColumnInfo> gbySchema = new ArrayList<>();
for (ColumnInfo rsColInfo : gb.getSchema().getSignature()) {
gbOutputNames.add(rsColInfo.getInternalName());
ExprNodeColumnDesc rsValExpr = new
ExprNodeColumnDesc(rsColInfo.getType(), rsColInfo.getInternalName(), "", false);
rsValueCols.add(rsValExpr);
String field = Utilities.ReduceField.VALUE.toString() + "." +
outputColName;
columnExprMap.put(field, rsValExpr);
rsColInfos.add(new ColumnInfo(field, rsColInfo.getType(), "", false));
}
````
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]