{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/68474420","id":68474420,"diff_hunk":"@@ -0,0 +1,108 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.apache.flink.api.scala.batch.sql\n+\n+import org.apache.flink.api.scala._\n+import org.apache.flink.api.scala.batch.utils.TableProgramsTestBase\n+import org.apache.flink.api.scala.batch.utils.TableProgramsTestBase.TableConfigMode\n+import org.apache.flink.api.scala.table._\n+import org.apache.flink.api.scala.util.CollectionDataSets\n+import org.apache.flink.api.table.{Row, TableEnvironment}\n+import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode\n+import org.apache.flink.test.util.TestBaseUtils\n+import org.junit._\n+import org.junit.runner.RunWith\n+import org.junit.runners.Parameterized\n+\n+import scala.collection.JavaConverters._\n+import scala.collection.mutable\n+import scala.util.Random\n+\n+@RunWith(classOf[Parameterized])\n+class IntersectITCase(\n+    mode: TestExecutionMode,\n+    configMode: TableConfigMode)\n+  extends TableProgramsTestBase(mode, configMode) {\n+\n+  @Test\n+  def testIntersect(): Unit = {","path":"flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/sql/IntersectITCase.scala","position":44,"original_position":44,"commit_id":"830d6824f6bec80ed8e1e0d3dfc023c7e21429f5","original_commit_id":"830d6824f6bec80ed8e1e0d3dfc023c7e21429f5","user":{"login":"fhueske","id":2388347,"avatar_url":"https://avatars.githubusercontent.com/u/2388347?v=3","gravatar_id":"","url":"https://api.github.com/users/fhueske","html_url":"https://github.com/fhueske","followers_url":"https://api.github.com/users/fhueske/followers","following_url":"https://api.github.com/users/fhueske/following{/other_user}","gists_url":"https://api.github.com/users/fhueske/gists{/gist_id}","starred_url":"https://api.github.com/users/fhueske/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fhueske/subscriptions","organizations_url":"https://api.github.com/users/fhueske/orgs","repos_url":"https://api.github.com/users/fhueske/repos","events_url":"https://api.github.com/users/fhueske/events{/privacy}","received_events_url":"https://api.github.com/users/fhueske/received_events","type":"User","site_admin":false},"body":"I think we need only this test to verify that intersect works correctly. However, for each test class (child of `TableProgramsTestBase`) a new test cluster is started which causes significant overhead. Can you add this test to `UnionITCase` and rename it to `SetOperatorsITCase`?","created_at":"2016-06-24T23:01:49Z","updated_at":"2016-06-24T23:01:49Z","html_url":"https://github.com/apache/flink/pull/2159#discussion_r68474420","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/2159","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/68474420"},"html":{"href":"https://github.com/apache/flink/pull/2159#discussion_r68474420"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/2159"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/2159","id":75108470,"html_url":"https://github.com/apache/flink/pull/2159","diff_url":"https://github.com/apache/flink/pull/2159.diff","patch_url":"https://github.com/apache/flink/pull/2159.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/2159","number":2159,"state":"open","locked":false,"title":"[FLINK-3942] [tableAPI] Add support for INTERSECT","user":{"login":"wuchong","id":5378924,"avatar_url":"https://avatars.githubusercontent.com/u/5378924?v=3","gravatar_id":"","url":"https://api.github.com/users/wuchong","html_url":"https://github.com/wuchong","followers_url":"https://api.github.com/users/wuchong/followers","following_url":"https://api.github.com/users/wuchong/following{/other_user}","gists_url":"https://api.github.com/users/wuchong/gists{/gist_id}","starred_url":"https://api.github.com/users/wuchong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuchong/subscriptions","organizations_url":"https://api.github.com/users/wuchong/orgs","repos_url":"https://api.github.com/users/wuchong/repos","events_url":"https://api.github.com/users/wuchong/events{/privacy}","received_events_url":"https://api.github.com/users/wuchong/received_events","type":"User","site_admin":false},"body":"Internally, I translate INTERSECT into a Join on all fields and then a distinct for removing duplicate records. \r\n\r\nAs Calcite SQL Parser doesn't support `INTERSECT ALL` , so I didn't add `intersectAll()` function to `Table`.\r\n\r\nI can add the corresponding documents if needed. ","created_at":"2016-06-24T12:44:32Z","updated_at":"2016-06-24T23:01:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2f0b40d3f11e5138dd1c7c5cdf9113bbeb10cea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/2159/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/2159/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/2159/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/830d6824f6bec80ed8e1e0d3dfc023c7e21429f5","head":{"label":"wuchong:INTERSECT","ref":"INTERSECT","sha":"830d6824f6bec80ed8e1e0d3dfc023c7e21429f5","user":{"login":"wuchong","id":5378924,"avatar_url":"https://avatars.githubusercontent.com/u/5378924?v=3","gravatar_id":"","url":"https://api.github.com/users/wuchong","html_url":"https://github.com/wuchong","followers_url":"https://api.github.com/users/wuchong/followers","following_url":"https://api.github.com/users/wuchong/following{/other_user}","gists_url":"https://api.github.com/users/wuchong/gists{/gist_id}","starred_url":"https://api.github.com/users/wuchong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuchong/subscriptions","organizations_url":"https://api.github.com/users/wuchong/orgs","repos_url":"https://api.github.com/users/wuchong/repos","events_url":"https://api.github.com/users/wuchong/events{/privacy}","received_events_url":"https://api.github.com/users/wuchong/received_events","type":"User","site_admin":false},"repo":{"id":52701676,"name":"flink","full_name":"wuchong/flink","owner":{"login":"wuchong","id":5378924,"avatar_url":"https://avatars.githubusercontent.com/u/5378924?v=3","gravatar_id":"","url":"https://api.github.com/users/wuchong","html_url":"https://github.com/wuchong","followers_url":"https://api.github.com/users/wuchong/followers","following_url":"https://api.github.com/users/wuchong/following{/other_user}","gists_url":"https://api.github.com/users/wuchong/gists{/gist_id}","starred_url":"https://api.github.com/users/wuchong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuchong/subscriptions","organizations_url":"https://api.github.com/users/wuchong/orgs","repos_url":"https://api.github.com/users/wuchong/repos","events_url":"https://api.github.com/users/wuchong/events{/privacy}","received_events_url":"https://api.github.com/users/wuchong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wuchong/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/wuchong/flink","forks_url":"https://api.github.com/repos/wuchong/flink/forks","keys_url":"https://api.github.com/repos/wuchong/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wuchong/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wuchong/flink/teams","hooks_url":"https://api.github.com/repos/wuchong/flink/hooks","issue_events_url":"https://api.github.com/repos/wuchong/flink/issues/events{/number}","events_url":"https://api.github.com/repos/wuchong/flink/events","assignees_url":"https://api.github.com/repos/wuchong/flink/assignees{/user}","branches_url":"https://api.github.com/repos/wuchong/flink/branches{/branch}","tags_url":"https://api.github.com/repos/wuchong/flink/tags","blobs_url":"https://api.github.com/repos/wuchong/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wuchong/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wuchong/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/wuchong/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wuchong/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/wuchong/flink/languages","stargazers_url":"https://api.github.com/repos/wuchong/flink/stargazers","contributors_url":"https://api.github.com/repos/wuchong/flink/contributors","subscribers_url":"https://api.github.com/repos/wuchong/flink/subscribers","subscription_url":"https://api.github.com/repos/wuchong/flink/subscription","commits_url":"https://api.github.com/repos/wuchong/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/wuchong/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/wuchong/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/wuchong/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/wuchong/flink/contents/{+path}","compare_url":"https://api.github.com/repos/wuchong/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wuchong/flink/merges","archive_url":"https://api.github.com/repos/wuchong/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wuchong/flink/downloads","issues_url":"https://api.github.com/repos/wuchong/flink/issues{/number}","pulls_url":"https://api.github.com/repos/wuchong/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/wuchong/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/wuchong/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wuchong/flink/labels{/name}","releases_url":"https://api.github.com/repos/wuchong/flink/releases{/id}","deployments_url":"https://api.github.com/repos/wuchong/flink/deployments","created_at":"2016-02-28T03:03:30Z","updated_at":"2016-02-28T03:03:48Z","pushed_at":"2016-06-24T13:02:54Z","git_url":"git://github.com/wuchong/flink.git","ssh_url":"git@github.com:wuchong/flink.git","clone_url":"https://github.com/wuchong/flink.git","svn_url":"https://github.com/wuchong/flink","homepage":null,"size":90917,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"6420c1c264ed3ce0c32ba164c2cdb85ccdccf265","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","deployments_url":"https://api.github.com/repos/apache/flink/deployments","created_at":"2014-06-07T07:00:10Z","updated_at":"2016-06-24T18:00:39Z","pushed_at":"2016-06-24T21:53:23Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":120099,"stargazers_count":1384,"watchers_count":1384,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":893,"mirror_url":"git://git.apache.org/flink.git","open_issues_count":116,"forks":893,"open_issues":116,"watchers":1384,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/2159"},"html":{"href":"https://github.com/apache/flink/pull/2159"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/2159"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/2159/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/2159/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/2159/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/830d6824f6bec80ed8e1e0d3dfc023c7e21429f5"}}}}
{"actor":{"display_login":"fhueske"}}