korlov42 commented on a change in pull request #9369:
URL: https://github.com/apache/ignite/pull/9369#discussion_r702893823
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/Commons.java
##########
@@ -174,24 +177,22 @@ public static IgniteTypeFactory typeFactory(RelOptCluster
cluster) {
}
/**
- * Extracts planner context.
+ * Extracts query context.
*/
- public static PlanningContext context(RelNode rel) {
+ public static BaseQueryContext context(RelNode rel) {
return context(rel.getCluster());
}
/**
- * Extracts planner context.
+ * Extracts query context.
*/
- public static PlanningContext context(RelOptCluster cluster) {
- return context(cluster.getPlanner().getContext());
- }
-
- /**
- * Extracts planner context.
- */
- public static PlanningContext context(Context ctx) {
- return Objects.requireNonNull(ctx.unwrap(PlanningContext.class));
+ public static BaseQueryContext context(RelOptCluster cluster) {
+ try {
+ return
Objects.requireNonNull((cluster.getPlanner().getContext().unwrap(BaseQueryContext.class)));
+ }
+ catch (NullPointerException e) {
+ throw e;
+ }
Review comment:
```suggestion
return
Objects.requireNonNull(cluster.getPlanner().getContext().unwrap(BaseQueryContext.class));
```
--
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]