flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2951] [Table API] add union operator to...
Date Wed, 04 Nov 2015 13:39:10 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1315#discussion_r43880555
  
    --- Diff: flink-staging/flink-table/src/main/scala/org/apache/flink/api/table/Table.scala
---
    @@ -243,5 +243,29 @@ case class Table(private[flink] val operation: PlanNode) {
         this.copy(operation = Join(operation, right.operation))
       }
     
    +  /**
    +   * Union two[[Table]]s. Similar to an SQL UNION ALL. The fields of the two union operations
    +   * must fully overlap.
    +   *
    +   * Example:
    +   *
    +   * {{{
    +   *   left.unionAll(right)
    +   * }}}
    +   */
    +  def unionAll(right: Table): Table = {
    +    val leftInputNames = operation.outputFields.map(_._1).toSet
    +    val rightInputNames = right.operation.outputFields.map(_._1).toSet
    +    if (!leftInputNames.equals(rightInputNames)) {
    --- End diff --
    
    I think checking the output names is not enough, the types must also be equal otherwise
we might get undesired behavior. You should remove the `map`s.


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