flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wuchong <...@git.apache.org>
Subject [GitHub] flink pull request #2169: [FLINK-3943] Add support for EXCEPT operator
Date Thu, 30 Jun 2016 03:40:08 GMT
Github user wuchong commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2169#discussion_r69065352
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/logical/operators.scala
---
    @@ -236,6 +236,32 @@ case class Aggregate(
       }
     }
     
    +case class SetMinus(left: LogicalNode, right: LogicalNode, all: Boolean) extends BinaryNode
{
    +  override def output: Seq[Attribute] = left.output
    +
    +  override protected[logical] def construct(relBuilder: RelBuilder): RelBuilder = {
    +    left.construct(relBuilder)
    +    right.construct(relBuilder)
    +    relBuilder.minus(all)
    +  }
    +
    +  override def validate(tableEnv: TableEnvironment): LogicalNode = {
    +    val resolvedMinus = super.validate(tableEnv).asInstanceOf[SetMinus]
    +    if (left.output.length != right.output.length) {
    +      failValidation(s"Set minus two table of different column sizes:" +
    +        s" ${left.output.size} and ${right.output.size}")
    +    }
    +    val sameSchema = left.output.zip(right.output).forall { case (l, r) =>
    +      l.resultType == r.resultType && l.name == r.name }
    --- End diff --
    
    Yes, I refer to the last case. I agree with @fhueske 's opinion, we can remove the check
of field names in `EXCEPT` and `INTERSECT` now, and remove the restriction in `UNION` in the
future. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message