{"action":"created","comment":{"url":"https://api.github.com/repos/beyond1920/flink/pulls/comments/102876941","pull_request_review_id":23646949,"id":102876941,"diff_hunk":"@@ -0,0 +1,164 @@\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.table.plan.catalog\n+\n+import java.util\n+\n+import org.apache.calcite.linq4j.tree.Expression\n+import org.apache.calcite.schema._\n+import org.apache.flink.table.api.{DatabaseNotExistException, TableNotExistException}\n+import org.slf4j.{Logger, LoggerFactory}\n+\n+import scala.collection.JavaConverters._\n+\n+/**\n+  * This class is responsible for connect external catalog to calcite catalog.\n+  * In this way, it is possible to look-up and access tables in SQL queries without registering tables in advance.\n+  * The databases in the external catalog registers as calcite sub-Schemas of current schema.\n+  * The tables in a given database registers as calcite tables of the [[FlinkCatalogDatabaseSchema]].\n+  *\n+  * @param CatalogIdentifier external catalog name\n+  * @param catalog           external catalog\n+  */\n+class FlinkExternalCatalogSchema(","path":"flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/catalog/FlinkExternalCatalogSchema.scala","position":39,"original_position":39,"commit_id":"908de22823d44a7dbbcddb78548d8bf918091526","original_commit_id":"908de22823d44a7dbbcddb78548d8bf918091526","user":{"login":"beyond1920","id":1525333,"avatar_url":"https://avatars.githubusercontent.com/u/1525333?v=3","gravatar_id":"","url":"https://api.github.com/users/beyond1920","html_url":"https://github.com/beyond1920","followers_url":"https://api.github.com/users/beyond1920/followers","following_url":"https://api.github.com/users/beyond1920/following{/other_user}","gists_url":"https://api.github.com/users/beyond1920/gists{/gist_id}","starred_url":"https://api.github.com/users/beyond1920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyond1920/subscriptions","organizations_url":"https://api.github.com/users/beyond1920/orgs","repos_url":"https://api.github.com/users/beyond1920/repos","events_url":"https://api.github.com/users/beyond1920/events{/privacy}","received_events_url":"https://api.github.com/users/beyond1920/received_events","type":"User","site_admin":false},"body":"done","created_at":"2017-02-24T04:16:27Z","updated_at":"2017-02-24T04:16:27Z","html_url":"https://github.com/beyond1920/flink/pull/2#discussion_r102876941","pull_request_url":"https://api.github.com/repos/beyond1920/flink/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/beyond1920/flink/pulls/comments/102876941"},"html":{"href":"https://github.com/beyond1920/flink/pull/2#discussion_r102876941"},"pull_request":{"href":"https://api.github.com/repos/beyond1920/flink/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/beyond1920/flink/pulls/2","id":107391119,"html_url":"https://github.com/beyond1920/flink/pull/2","diff_url":"https://github.com/beyond1920/flink/pull/2.diff","patch_url":"https://github.com/beyond1920/flink/pull/2.patch","issue_url":"https://api.github.com/repos/beyond1920/flink/issues/2","number":2,"state":"open","locked":false,"title":"[flink-5568] [Table API & SQL]Introduce interface for catalog, and provide an in-memory implementation. Integrate external catalog with calcite catalog.","user":{"login":"beyond1920","id":1525333,"avatar_url":"https://avatars.githubusercontent.com/u/1525333?v=3","gravatar_id":"","url":"https://api.github.com/users/beyond1920","html_url":"https://github.com/beyond1920","followers_url":"https://api.github.com/users/beyond1920/followers","following_url":"https://api.github.com/users/beyond1920/following{/other_user}","gists_url":"https://api.github.com/users/beyond1920/gists{/gist_id}","starred_url":"https://api.github.com/users/beyond1920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyond1920/subscriptions","organizations_url":"https://api.github.com/users/beyond1920/orgs","repos_url":"https://api.github.com/users/beyond1920/repos","events_url":"https://api.github.com/users/beyond1920/events{/privacy}","received_events_url":"https://api.github.com/users/beyond1920/received_events","type":"User","site_admin":false},"body":"This pr aims to Introduce interface for catalog, and provide an in-memory implementation for test and develop,  finally integrate external catalog with calcite catalog.\r\nThe main change including:\r\n1. Introduce FlinkExternalCatalog abstraction. Besides introduce ExternalCatalogDatabase as database in catalog  and ExternalCatalogTable as table in catalog.\r\n2. Provide an in-memory implementation for test and develop.\r\n3. Introduce FlinkExternalCatalogSchema which is an implementation of Calcite Schema interface. It registers database at FlinkExternalCatalog as calcite Schemas, and tables in a database as Calcite table.\r\n4. Add ExternalCatalogCompatible annotation. The TableSource with this annotation represents it could be converted to or from externalCatalogTable.  ExternalCatalogTable2TableSourceConverter is the converter between externalCatalogTable and tableSource.","created_at":"2017-02-22T11:52:43Z","updated_at":"2017-02-24T04:16:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"005b2dae76da8056e716f6e07a5bf2164f5322e5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/beyond1920/flink/pulls/2/commits","review_comments_url":"https://api.github.com/repos/beyond1920/flink/pulls/2/comments","review_comment_url":"https://api.github.com/repos/beyond1920/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/beyond1920/flink/issues/2/comments","statuses_url":"https://api.github.com/repos/beyond1920/flink/statuses/908de22823d44a7dbbcddb78548d8bf918091526","head":{"label":"alibaba:dev","ref":"dev","sha":"908de22823d44a7dbbcddb78548d8bf918091526","user":{"login":"alibaba","id":1961952,"avatar_url":"https://avatars.githubusercontent.com/u/1961952?v=3","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"repo":{"id":65431038,"name":"flink","full_name":"alibaba/flink","owner":{"login":"alibaba","id":1961952,"avatar_url":"https://avatars.githubusercontent.com/u/1961952?v=3","gravatar_id":"","url":"https://api.github.com/users/alibaba","html_url":"https://github.com/alibaba","followers_url":"https://api.github.com/users/alibaba/followers","following_url":"https://api.github.com/users/alibaba/following{/other_user}","gists_url":"https://api.github.com/users/alibaba/gists{/gist_id}","starred_url":"https://api.github.com/users/alibaba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alibaba/subscriptions","organizations_url":"https://api.github.com/users/alibaba/orgs","repos_url":"https://api.github.com/users/alibaba/repos","events_url":"https://api.github.com/users/alibaba/events{/privacy}","received_events_url":"https://api.github.com/users/alibaba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alibaba/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/alibaba/flink","forks_url":"https://api.github.com/repos/alibaba/flink/forks","keys_url":"https://api.github.com/repos/alibaba/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alibaba/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alibaba/flink/teams","hooks_url":"https://api.github.com/repos/alibaba/flink/hooks","issue_events_url":"https://api.github.com/repos/alibaba/flink/issues/events{/number}","events_url":"https://api.github.com/repos/alibaba/flink/events","assignees_url":"https://api.github.com/repos/alibaba/flink/assignees{/user}","branches_url":"https://api.github.com/repos/alibaba/flink/branches{/branch}","tags_url":"https://api.github.com/repos/alibaba/flink/tags","blobs_url":"https://api.github.com/repos/alibaba/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alibaba/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alibaba/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/alibaba/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alibaba/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/alibaba/flink/languages","stargazers_url":"https://api.github.com/repos/alibaba/flink/stargazers","contributors_url":"https://api.github.com/repos/alibaba/flink/contributors","subscribers_url":"https://api.github.com/repos/alibaba/flink/subscribers","subscription_url":"https://api.github.com/repos/alibaba/flink/subscription","commits_url":"https://api.github.com/repos/alibaba/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/alibaba/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/alibaba/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/alibaba/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/alibaba/flink/contents/{+path}","compare_url":"https://api.github.com/repos/alibaba/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alibaba/flink/merges","archive_url":"https://api.github.com/repos/alibaba/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alibaba/flink/downloads","issues_url":"https://api.github.com/repos/alibaba/flink/issues{/number}","pulls_url":"https://api.github.com/repos/alibaba/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/alibaba/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/alibaba/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alibaba/flink/labels{/name}","releases_url":"https://api.github.com/repos/alibaba/flink/releases{/id}","deployments_url":"https://api.github.com/repos/alibaba/flink/deployments","created_at":"2016-08-11T02:17:59Z","updated_at":"2016-12-23T04:13:57Z","pushed_at":"2017-02-23T09:27:15Z","git_url":"git://github.com/alibaba/flink.git","ssh_url":"git@github.com:alibaba/flink.git","clone_url":"https://github.com/alibaba/flink.git","svn_url":"https://github.com/alibaba/flink","homepage":null,"size":115746,"stargazers_count":9,"watchers_count":9,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":0,"forks":8,"open_issues":0,"watchers":9,"default_branch":"master"}},"base":{"label":"beyond1920:master","ref":"master","sha":"45e01cf2321dda58f572d8b9dbe64947c6725ad1","user":{"login":"beyond1920","id":1525333,"avatar_url":"https://avatars.githubusercontent.com/u/1525333?v=3","gravatar_id":"","url":"https://api.github.com/users/beyond1920","html_url":"https://github.com/beyond1920","followers_url":"https://api.github.com/users/beyond1920/followers","following_url":"https://api.github.com/users/beyond1920/following{/other_user}","gists_url":"https://api.github.com/users/beyond1920/gists{/gist_id}","starred_url":"https://api.github.com/users/beyond1920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyond1920/subscriptions","organizations_url":"https://api.github.com/users/beyond1920/orgs","repos_url":"https://api.github.com/users/beyond1920/repos","events_url":"https://api.github.com/users/beyond1920/events{/privacy}","received_events_url":"https://api.github.com/users/beyond1920/received_events","type":"User","site_admin":false},"repo":{"id":65457753,"name":"flink","full_name":"beyond1920/flink","owner":{"login":"beyond1920","id":1525333,"avatar_url":"https://avatars.githubusercontent.com/u/1525333?v=3","gravatar_id":"","url":"https://api.github.com/users/beyond1920","html_url":"https://github.com/beyond1920","followers_url":"https://api.github.com/users/beyond1920/followers","following_url":"https://api.github.com/users/beyond1920/following{/other_user}","gists_url":"https://api.github.com/users/beyond1920/gists{/gist_id}","starred_url":"https://api.github.com/users/beyond1920/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beyond1920/subscriptions","organizations_url":"https://api.github.com/users/beyond1920/orgs","repos_url":"https://api.github.com/users/beyond1920/repos","events_url":"https://api.github.com/users/beyond1920/events{/privacy}","received_events_url":"https://api.github.com/users/beyond1920/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beyond1920/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/beyond1920/flink","forks_url":"https://api.github.com/repos/beyond1920/flink/forks","keys_url":"https://api.github.com/repos/beyond1920/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beyond1920/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beyond1920/flink/teams","hooks_url":"https://api.github.com/repos/beyond1920/flink/hooks","issue_events_url":"https://api.github.com/repos/beyond1920/flink/issues/events{/number}","events_url":"https://api.github.com/repos/beyond1920/flink/events","assignees_url":"https://api.github.com/repos/beyond1920/flink/assignees{/user}","branches_url":"https://api.github.com/repos/beyond1920/flink/branches{/branch}","tags_url":"https://api.github.com/repos/beyond1920/flink/tags","blobs_url":"https://api.github.com/repos/beyond1920/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beyond1920/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beyond1920/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/beyond1920/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beyond1920/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/beyond1920/flink/languages","stargazers_url":"https://api.github.com/repos/beyond1920/flink/stargazers","contributors_url":"https://api.github.com/repos/beyond1920/flink/contributors","subscribers_url":"https://api.github.com/repos/beyond1920/flink/subscribers","subscription_url":"https://api.github.com/repos/beyond1920/flink/subscription","commits_url":"https://api.github.com/repos/beyond1920/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/beyond1920/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/beyond1920/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/beyond1920/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/beyond1920/flink/contents/{+path}","compare_url":"https://api.github.com/repos/beyond1920/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beyond1920/flink/merges","archive_url":"https://api.github.com/repos/beyond1920/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beyond1920/flink/downloads","issues_url":"https://api.github.com/repos/beyond1920/flink/issues{/number}","pulls_url":"https://api.github.com/repos/beyond1920/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/beyond1920/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/beyond1920/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beyond1920/flink/labels{/name}","releases_url":"https://api.github.com/repos/beyond1920/flink/releases{/id}","deployments_url":"https://api.github.com/repos/beyond1920/flink/deployments","created_at":"2016-08-11T09:39:16Z","updated_at":"2016-08-11T09:39:40Z","pushed_at":"2017-02-23T09:27:19Z","git_url":"git://github.com/beyond1920/flink.git","ssh_url":"git@github.com:beyond1920/flink.git","clone_url":"https://github.com/beyond1920/flink.git","svn_url":"https://github.com/beyond1920/flink","homepage":null,"size":115221,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/beyond1920/flink/pulls/2"},"html":{"href":"https://github.com/beyond1920/flink/pull/2"},"issue":{"href":"https://api.github.com/repos/beyond1920/flink/issues/2"},"comments":{"href":"https://api.github.com/repos/beyond1920/flink/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/beyond1920/flink/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/beyond1920/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/beyond1920/flink/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/beyond1920/flink/statuses/908de22823d44a7dbbcddb78548d8bf918091526"}}}}
{"actor":{"display_login":"beyond1920"}}