Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3791#discussion_r114063055
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/logical/LogicalNode.scala
 ---
    @@ -79,15 +79,21 @@ abstract class LogicalNode extends 
TreeNode[LogicalNode] {
       protected[logical] def construct(relBuilder: RelBuilder): RelBuilder
     
       def validate(tableEnv: TableEnvironment): LogicalNode = {
    -    val resolvedNode = resolveExpressions(tableEnv)
    -    resolvedNode.expressionPostOrderTransform {
    -      case a: Attribute if !a.valid =>
    -        val from = children.flatMap(_.output).map(_.name).mkString(", ")
    -        failValidation(s"Cannot resolve [${a.name}] given input [$from].")
    -
    -      case e: Expression if e.validateInput().isFailure =>
    -        failValidation(s"Expression $e failed on input check: " +
    -          s"${e.validateInput().asInstanceOf[ValidationFailure].message}")
    +    // A tableFunction may not contain the tableEnv when created by scala 
user
    +    // We do not validate operators (select, as etc.)
    +    // if they are applied on such TableFunction with empty tableEnv.
    +    if (tableEnv == null) this
    --- End diff --
    
    This looks like a potentially problematic condition which relies on the 
fact that `tableEnv` may only be `null` in case of a `TableFunction`. It would 
be much better if we could avoid such special casing in method which are called 
from many different places.


---
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.
---

Reply via email to