Github user beyond1920 commented on a diff in the pull request:
https://github.com/apache/flink/pull/3559#discussion_r106797445
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/calcite/FlinkPlannerImpl.scala
---
@@ -100,6 +101,7 @@ class FlinkPlannerImpl(
assert(validatedSqlNode != null)
val rexBuilder: RexBuilder = createRexBuilder
val cluster: RelOptCluster = RelOptCluster.create(planner,
rexBuilder)
+ cluster.setMetadataProvider(FlinkDefaultRelMetadataProvider.INSTANCE)
--- End diff --
Because this logic is called in
org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery, which like
`RelMetadataQuery.THREAD_PROVIDERS.set(
JaninoRelMetadataProvider.of(cluster.getMetadataProvider()));`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---