Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 23ECC18912 for ; Wed, 4 Nov 2015 13:39:28 +0000 (UTC) Received: (qmail 57814 invoked by uid 500); 4 Nov 2015 13:39:28 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 57694 invoked by uid 500); 4 Nov 2015 13:39:27 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 57674 invoked by uid 99); 4 Nov 2015 13:39:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2015 13:39:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B10C02C1F5E for ; Wed, 4 Nov 2015 13:39:27 +0000 (UTC) Date: Wed, 4 Nov 2015 13:39:27 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-2951) Add Union operator to Table API. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)