danny0405 commented on a change in pull request #8859:
[FLINK-12905][table-planner] Enable querying CatalogViews in legacy planner
URL: https://github.com/apache/flink/pull/8859#discussion_r351073829
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/calcite/FlinkRelBuilder.scala
##########
@@ -167,19 +165,9 @@ object FlinkRelBuilder {
def proto(context: Context): RelBuilderFactory = new RelBuilderFactory() {
def create(cluster: RelOptCluster, schema: RelOptSchema): RelBuilder = {
+ val clusterContext =
cluster.getPlanner.getContext.unwrap(classOf[FlinkContext])
+ val mergedContext = Contexts.chain(clusterContext, context)
Review comment:
The `ChainContext#unwap` is easy to use but a little hard to understand,
just like you said, the context returned is very relevant with the sequence of
the contexts(for same class contexts), which is not that intuitive. I'm not
against to use `ChainContext`, we just need to be caution with the usage.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services