flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-2951) Add Union operator to Table API.
Date Wed, 04 Nov 2015 13:39:27 GMT

    [ https://issues.apache.org/jira/browse/FLINK-2951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14989532#comment-14989532
] 

ASF GitHub Bot commented on FLINK-2951:
---------------------------------------

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.


> Add Union operator to Table API.
> --------------------------------
>
>                 Key: FLINK-2951
>                 URL: https://issues.apache.org/jira/browse/FLINK-2951
>             Project: Flink
>          Issue Type: New Feature
>          Components: Documentation, Table API
>            Reporter: Chengxiang Li
>            Assignee: Chengxiang Li
>            Priority: Minor
>
> Currently, union operation is supported by DataSet/DataStream API, not available in Table
API. To union two tables, user has to transform the parameter input to DataSet/DataStream,
for example:
> {code:java}
> val unionDs = left.union(right.toDataSet[Row])
> {code}
> It should be more API friendly to user if add union operation to Table API, like:
> {code:java}
> val unionDs = left.union(right)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message