zabetak commented on code in PR #6720:
URL: https://github.com/apache/hive/pull/6720#discussion_r3895730945
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveRelJsonImpl.java:
##########
@@ -47,7 +48,7 @@ public HiveRelJsonImpl() {
try {
final Field fieldRelJson =
RelJsonWriter.class.getDeclaredField("relJson");
fieldRelJson.setAccessible(true);
- fieldRelJson.set(this, new HiveRelJson(jsonBuilder));
+ fieldRelJson.set(this, new RelJson(jsonBuilder));
} catch (IllegalAccessException | NoSuchFieldException e) {
throw new RuntimeException(e);
}
Review Comment:
Most likely this entire reflection hack can now go away.
##########
data/conf/hive-log4j2.properties:
##########
@@ -114,7 +114,7 @@ logger.CalcitePlanner.name =
org.apache.calcite.plan.RelOptPlanner
logger.CalcitePlanner.level = INFO
# Change logger level to DEBUG, to see all application of CBO rules and the
operators they produce
-logger.CBORuleLogger.name =
org.apache.hadoop.hive.ql.optimizer.calcite.RuleEventLogger
+logger.CBORuleLogger.name = org.apache.calcite.plan.RuleEventLogger
Review Comment:
I think its fine to keep all Calcite related stuff under the same logger. We
can still tune a bit the granularity via the `FULL_PLAN` marker. Possibly, we
can keep only the output from "RuleEventLogger" by changing the `onMismatch`
action (e.g., `DENY`?).
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -1539,7 +1539,7 @@ public RelNode apply(RelOptCluster cluster, RelOptSchema
relOptSchema, SchemaPlu
* recreate cluster, so that it picks up the additional traitDef
*/
RelOptPlanner planner = createPlanner(conf, statsSource,
ctx.isExplainPlan());
- final RexBuilder rexBuilder = new RexBuilder(new HiveTypeFactory());
+ final RexBuilder rexBuilder = new RexBuilder(new JavaTypeFactoryImpl(new
HiveTypeSystemImpl()));
Review Comment:
Previously this was:
```suggestion
final RexBuilder rexBuilder = cluster.getRexBuilder();
```
Maybe we can restore this simpler version.
--
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]