{"action":"created","comment":{"url":"https://api.github.com/repos/apache/apex-malhar/pulls/comments/84258246","pull_request_review_id":5045808,"id":84258246,"diff_hunk":"@@ -0,0 +1,134 @@\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,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package org.apache.apex.malhar.sql.table;\n+\n+import java.util.Map;\n+import java.util.Properties;\n+\n+import org.apache.apex.malhar.kafka.KafkaSinglePortInputOperator;\n+import org.apache.apex.malhar.kafka.KafkaSinglePortOutputOperator;\n+import org.apache.apex.malhar.sql.operators.OperatorUtils;\n+import org.apache.apex.malhar.sql.planner.RelInfo;\n+import org.apache.calcite.adapter.java.JavaTypeFactory;\n+import org.apache.calcite.rel.type.RelDataType;\n+import org.apache.calcite.rel.type.RelDataTypeFactory;\n+import org.apache.kafka.clients.consumer.ConsumerConfig;\n+import org.apache.kafka.clients.producer.ProducerConfig;\n+\n+import com.google.common.collect.ImmutableMap;\n+import com.google.common.collect.Lists;\n+\n+import com.datatorrent.api.DAG;\n+import com.datatorrent.api.Operator;\n+\n+/**\n+ * This is an implementation of {@link Endpoint} which defined how data should be read/written from kafka messaging system\n+ */\n+public class KafkaEndpoint implements Endpoint\n+{\n+  public static final String KEY_DESERIALIZER = \"org.apache.kafka.common.serialization.StringDeserializer\";\n+  public static final String VALUE_DESERIALIZER = \"org.apache.kafka.common.serialization.StringDeserializer\";\n+  public static final String KEY_SERIALIZER = \"org.apache.kafka.common.serialization.StringSerializer\";\n+  public static final String VALUE_SERIALIZER = \"org.apache.kafka.common.serialization.StringSerializer\";\n+\n+\n+  public static final String KAFKA_SERVERS = \"servers\";\n+  public static final String KAFKA_TOPICS = \"topics\";\n+\n+  private MessageFormat messageFormat;\n+\n+  private Map<String, Object> operands;\n+\n+  public KafkaEndpoint()\n+  {\n+  }\n+\n+  public KafkaEndpoint(String kafkaServers, String topics, MessageFormat messageFormat)\n+  {\n+    this.messageFormat = messageFormat;\n+    this.operands = ImmutableMap.<String, Object>of(KAFKA_SERVERS, kafkaServers, KAFKA_TOPICS, topics);\n+  }\n+\n+  @Override\n+  public EndpointType getTargetType()\n+  {\n+    return EndpointType.KAFKA;\n+  }\n+\n+  @Override\n+  public void setEndpointOperands(Map<String, Object> operands)\n+  {\n+    this.operands = operands;\n+  }\n+\n+  @Override\n+  public void setMessageFormat(MessageFormat messageFormat)\n+  {\n+    this.messageFormat = messageFormat;\n+  }\n+\n+  @Override\n+  public RelInfo populateInputDAG(DAG dag, JavaTypeFactory typeFactory)\n+  {\n+    KafkaSinglePortInputOperator kafkaInput = dag.addOperator(OperatorUtils.getUniqueOperatorName(\"KafkaInput\"),\n+        KafkaSinglePortInputOperator.class);\n+    kafkaInput.setTopics((String)operands.get(KAFKA_TOPICS));","path":"sql/src/main/java/org/apache/apex/malhar/sql/table/KafkaEndpoint.java","position":93,"original_position":91,"commit_id":"bde3a6b9cc3550b742abf62d8f360b0b9c755089","original_commit_id":"0571f6b6bfd09034b18ae1d20a52e0f618fda164","user":{"login":"chinmaykolhatkar","id":12393897,"avatar_url":"https://avatars.githubusercontent.com/u/12393897?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmaykolhatkar","html_url":"https://github.com/chinmaykolhatkar","followers_url":"https://api.github.com/users/chinmaykolhatkar/followers","following_url":"https://api.github.com/users/chinmaykolhatkar/following{/other_user}","gists_url":"https://api.github.com/users/chinmaykolhatkar/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmaykolhatkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmaykolhatkar/subscriptions","organizations_url":"https://api.github.com/users/chinmaykolhatkar/orgs","repos_url":"https://api.github.com/users/chinmaykolhatkar/repos","events_url":"https://api.github.com/users/chinmaykolhatkar/events{/privacy}","received_events_url":"https://api.github.com/users/chinmaykolhatkar/received_events","type":"User","site_admin":false},"body":"https://issues.apache.org/jira/browse/APEXMALHAR-2311 as a follow up task should take care of this.","created_at":"2016-10-20T10:56:27Z","updated_at":"2016-10-20T10:56:27Z","html_url":"https://github.com/apache/apex-malhar/pull/432#discussion_r84258246","pull_request_url":"https://api.github.com/repos/apache/apex-malhar/pulls/432","_links":{"self":{"href":"https://api.github.com/repos/apache/apex-malhar/pulls/comments/84258246"},"html":{"href":"https://github.com/apache/apex-malhar/pull/432#discussion_r84258246"},"pull_request":{"href":"https://api.github.com/repos/apache/apex-malhar/pulls/432"}}},"pull_request":{"url":"https://api.github.com/repos/apache/apex-malhar/pulls/432","id":87142387,"html_url":"https://github.com/apache/apex-malhar/pull/432","diff_url":"https://github.com/apache/apex-malhar/pull/432.diff","patch_url":"https://github.com/apache/apex-malhar/pull/432.patch","issue_url":"https://api.github.com/repos/apache/apex-malhar/issues/432","number":432,"state":"open","locked":false,"title":"[Review Only] APEXMALHAR-1818 SQL Support for converting given SQL statement to APEX DAG","user":{"login":"chinmaykolhatkar","id":12393897,"avatar_url":"https://avatars.githubusercontent.com/u/12393897?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmaykolhatkar","html_url":"https://github.com/chinmaykolhatkar","followers_url":"https://api.github.com/users/chinmaykolhatkar/followers","following_url":"https://api.github.com/users/chinmaykolhatkar/following{/other_user}","gists_url":"https://api.github.com/users/chinmaykolhatkar/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmaykolhatkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmaykolhatkar/subscriptions","organizations_url":"https://api.github.com/users/chinmaykolhatkar/orgs","repos_url":"https://api.github.com/users/chinmaykolhatkar/repos","events_url":"https://api.github.com/users/chinmaykolhatkar/events{/privacy}","received_events_url":"https://api.github.com/users/chinmaykolhatkar/received_events","type":"User","site_admin":false},"body":"Features implemented are:\r\n1. SELECT STATEMENT\r\n2. INSERT STATEMENT\r\n3. INNER JOIN with non-empty equi join condition\r\n4. WHERE clause\r\n5. SCALAR functions implemented in calcite are ready to use\r\n6. Custom scalar functions can be registered.\r\n7. Endpoint can be File OR Kafka OR Streaming Port for both input and output\r\n8. CSV Data Format implemented for both input and output side.\r\n9. Static loading of calcite JDBC driver.\r\n10. Testing on local as well as cluster mode.","created_at":"2016-09-28T15:22:49Z","updated_at":"2016-10-20T10:56:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d1e53ee2742a4783d41a527839195a70a613e314","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/apex-malhar/pulls/432/commits","review_comments_url":"https://api.github.com/repos/apache/apex-malhar/pulls/432/comments","review_comment_url":"https://api.github.com/repos/apache/apex-malhar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/apex-malhar/issues/432/comments","statuses_url":"https://api.github.com/repos/apache/apex-malhar/statuses/bde3a6b9cc3550b742abf62d8f360b0b9c755089","head":{"label":"chinmaykolhatkar:calcite","ref":"calcite","sha":"bde3a6b9cc3550b742abf62d8f360b0b9c755089","user":{"login":"chinmaykolhatkar","id":12393897,"avatar_url":"https://avatars.githubusercontent.com/u/12393897?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmaykolhatkar","html_url":"https://github.com/chinmaykolhatkar","followers_url":"https://api.github.com/users/chinmaykolhatkar/followers","following_url":"https://api.github.com/users/chinmaykolhatkar/following{/other_user}","gists_url":"https://api.github.com/users/chinmaykolhatkar/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmaykolhatkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmaykolhatkar/subscriptions","organizations_url":"https://api.github.com/users/chinmaykolhatkar/orgs","repos_url":"https://api.github.com/users/chinmaykolhatkar/repos","events_url":"https://api.github.com/users/chinmaykolhatkar/events{/privacy}","received_events_url":"https://api.github.com/users/chinmaykolhatkar/received_events","type":"User","site_admin":false},"repo":{"id":43486479,"name":"apex-malhar","full_name":"chinmaykolhatkar/apex-malhar","owner":{"login":"chinmaykolhatkar","id":12393897,"avatar_url":"https://avatars.githubusercontent.com/u/12393897?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmaykolhatkar","html_url":"https://github.com/chinmaykolhatkar","followers_url":"https://api.github.com/users/chinmaykolhatkar/followers","following_url":"https://api.github.com/users/chinmaykolhatkar/following{/other_user}","gists_url":"https://api.github.com/users/chinmaykolhatkar/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmaykolhatkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmaykolhatkar/subscriptions","organizations_url":"https://api.github.com/users/chinmaykolhatkar/orgs","repos_url":"https://api.github.com/users/chinmaykolhatkar/repos","events_url":"https://api.github.com/users/chinmaykolhatkar/events{/privacy}","received_events_url":"https://api.github.com/users/chinmaykolhatkar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chinmaykolhatkar/apex-malhar","description":"Mirror of Apache Apex malhar (Incubating)","fork":true,"url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar","forks_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/forks","keys_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/teams","hooks_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/hooks","issue_events_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/issues/events{/number}","events_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/events","assignees_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/assignees{/user}","branches_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/branches{/branch}","tags_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/tags","blobs_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/git/refs{/sha}","trees_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/statuses/{sha}","languages_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/languages","stargazers_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/stargazers","contributors_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/contributors","subscribers_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/subscribers","subscription_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/subscription","commits_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/commits{/sha}","git_commits_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/git/commits{/sha}","comments_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/comments{/number}","issue_comment_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/issues/comments{/number}","contents_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/contents/{+path}","compare_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/merges","archive_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/downloads","issues_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/issues{/number}","pulls_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/pulls{/number}","milestones_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/milestones{/number}","notifications_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/labels{/name}","releases_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/releases{/id}","deployments_url":"https://api.github.com/repos/chinmaykolhatkar/apex-malhar/deployments","created_at":"2015-10-01T08:43:18Z","updated_at":"2016-06-07T18:33:11Z","pushed_at":"2016-10-19T10:52:58Z","git_url":"git://github.com/chinmaykolhatkar/apex-malhar.git","ssh_url":"git@github.com:chinmaykolhatkar/apex-malhar.git","clone_url":"https://github.com/chinmaykolhatkar/apex-malhar.git","svn_url":"https://github.com/chinmaykolhatkar/apex-malhar","homepage":null,"size":87507,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"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":"2f308aa21dacff082f854d583df6dff9d1ec30ec","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":41348334,"name":"apex-malhar","full_name":"apache/apex-malhar","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/apex-malhar","description":"Mirror of Apache Apex malhar","fork":false,"url":"https://api.github.com/repos/apache/apex-malhar","forks_url":"https://api.github.com/repos/apache/apex-malhar/forks","keys_url":"https://api.github.com/repos/apache/apex-malhar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/apex-malhar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/apex-malhar/teams","hooks_url":"https://api.github.com/repos/apache/apex-malhar/hooks","issue_events_url":"https://api.github.com/repos/apache/apex-malhar/issues/events{/number}","events_url":"https://api.github.com/repos/apache/apex-malhar/events","assignees_url":"https://api.github.com/repos/apache/apex-malhar/assignees{/user}","branches_url":"https://api.github.com/repos/apache/apex-malhar/branches{/branch}","tags_url":"https://api.github.com/repos/apache/apex-malhar/tags","blobs_url":"https://api.github.com/repos/apache/apex-malhar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/apex-malhar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/apex-malhar/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/apex-malhar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/apex-malhar/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/apex-malhar/languages","stargazers_url":"https://api.github.com/repos/apache/apex-malhar/stargazers","contributors_url":"https://api.github.com/repos/apache/apex-malhar/contributors","subscribers_url":"https://api.github.com/repos/apache/apex-malhar/subscribers","subscription_url":"https://api.github.com/repos/apache/apex-malhar/subscription","commits_url":"https://api.github.com/repos/apache/apex-malhar/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/apex-malhar/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/apex-malhar/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/apex-malhar/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/apex-malhar/contents/{+path}","compare_url":"https://api.github.com/repos/apache/apex-malhar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/apex-malhar/merges","archive_url":"https://api.github.com/repos/apache/apex-malhar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/apex-malhar/downloads","issues_url":"https://api.github.com/repos/apache/apex-malhar/issues{/number}","pulls_url":"https://api.github.com/repos/apache/apex-malhar/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/apex-malhar/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/apex-malhar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/apex-malhar/labels{/name}","releases_url":"https://api.github.com/repos/apache/apex-malhar/releases{/id}","deployments_url":"https://api.github.com/repos/apache/apex-malhar/deployments","created_at":"2015-08-25T07:00:05Z","updated_at":"2016-10-19T06:47:32Z","pushed_at":"2016-10-20T08:19:21Z","git_url":"git://github.com/apache/apex-malhar.git","ssh_url":"git@github.com:apache/apex-malhar.git","clone_url":"https://github.com/apache/apex-malhar.git","svn_url":"https://github.com/apache/apex-malhar","homepage":"","size":98770,"stargazers_count":62,"watchers_count":62,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":101,"mirror_url":"git://git.apache.org/incubator-apex-malhar.git","open_issues_count":30,"forks":101,"open_issues":30,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/apex-malhar/pulls/432"},"html":{"href":"https://github.com/apache/apex-malhar/pull/432"},"issue":{"href":"https://api.github.com/repos/apache/apex-malhar/issues/432"},"comments":{"href":"https://api.github.com/repos/apache/apex-malhar/issues/432/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/apex-malhar/pulls/432/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/apex-malhar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/apex-malhar/pulls/432/commits"},"statuses":{"href":"https://api.github.com/repos/apache/apex-malhar/statuses/bde3a6b9cc3550b742abf62d8f360b0b9c755089"}}}}
{"actor":{"display_login":"chinmaykolhatkar"}}