GitHub PullRequestReviewCommentEvent at 2014-11-10 18:08:16
Repository: spark
Actor: scwf
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Huawei-Spark/spark/pulls/comments/20099967","id":20099967,"diff_hunk":"@@ -0,0 +1,103 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * 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.spark.sql.hbase\n+\n+import org.apache.hadoop.hbase.util.Bytes\n+import org.apache.spark.sql.catalyst.types._\n+\n+import scala.collection.mutable.ArrayBuffer\n+\n+object HBaseKVHelper {\n+\n+  /**\n+   * create row key based on key columns information\n+   * @param rawKeyColumns sequence of byte array representing the key columns\n+   * @return array of bytes\n+   */\n+  def encodingRawKeyColumns(rawKeyColumns: Seq[(HBaseRawType, DataType)]): HBaseRawType = {\n+    var buffer = ArrayBuffer[Byte]()\n+    val delimiter: Byte = 0\n+    for (rawKeyColumn <- rawKeyColumns) {\n+      buffer = buffer ++ rawKeyColumn._1\n+      if (rawKeyColumn._2 == StringType) {\n+        buffer += delimiter\n+      }\n+    }\n+    buffer.toArray\n+  }\n+\n+  /**\n+   * get the sequence of key columns from the byte array\n+   * @param rowKey array of bytes\n+   * @return sequence of byte array\n+   */\n+  def decodingRawKeyColumns(rowKey: HBaseRawType, keyColumns: Seq[KeyColumn]): Seq[HBaseRawType] = {","path":"sql/hbase/src/main/scala/org/apache/spark/sql/hbase/HBaseKVHelper.scala","position":49,"original_position":49,"commit_id":"88955edd7651b14b430ebe8eb5ad05d60cd5a1d6","original_commit_id":"88955edd7651b14b430ebe8eb5ad05d60cd5a1d6","user":{"login":"scwf","id":7018048,"avatar_url":"https://avatars.githubusercontent.com/u/7018048?v=3","gravatar_id":"","url":"https://api.github.com/users/scwf","html_url":"https://github.com/scwf","followers_url":"https://api.github.com/users/scwf/followers","following_url":"https://api.github.com/users/scwf/following{/other_user}","gists_url":"https://api.github.com/users/scwf/gists{/gist_id}","starred_url":"https://api.github.com/users/scwf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scwf/subscriptions","organizations_url":"https://api.github.com/users/scwf/orgs","repos_url":"https://api.github.com/users/scwf/repos","events_url":"https://api.github.com/users/scwf/events{/privacy}","received_events_url":"https://api.github.com/users/scwf/received_events","type":"User","site_admin":false},"body":"actually i think use Seq[DataType] instead Seq[KeyColumn]","created_at":"2014-11-10T18:08:16Z","updated_at":"2014-11-10T18:08:16Z","html_url":"https://github.com/Huawei-Spark/spark/pull/21#discussion_r20099967","pull_request_url":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/Huawei-Spark/spark/pulls/comments/20099967"},"html":{"href":"https://github.com/Huawei-Spark/spark/pull/21#discussion_r20099967"},"pull_request":{"href":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21","id":24133645,"html_url":"https://github.com/Huawei-Spark/spark/pull/21","diff_url":"https://github.com/Huawei-Spark/spark/pull/21.diff","patch_url":"https://github.com/Huawei-Spark/spark/pull/21.patch","issue_url":"https://api.github.com/repos/Huawei-Spark/spark/issues/21","number":21,"state":"open","locked":false,"title":"refactory to add HBaseKVHelper","user":{"login":"jackylk","id":6500698,"avatar_url":"https://avatars.githubusercontent.com/u/6500698?v=3","gravatar_id":"","url":"https://api.github.com/users/jackylk","html_url":"https://github.com/jackylk","followers_url":"https://api.github.com/users/jackylk/followers","following_url":"https://api.github.com/users/jackylk/following{/other_user}","gists_url":"https://api.github.com/users/jackylk/gists{/gist_id}","starred_url":"https://api.github.com/users/jackylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackylk/subscriptions","organizations_url":"https://api.github.com/users/jackylk/orgs","repos_url":"https://api.github.com/users/jackylk/repos","events_url":"https://api.github.com/users/jackylk/events{/privacy}","received_events_url":"https://api.github.com/users/jackylk/received_events","type":"User","site_admin":false},"body":"Since multiple places need to use encodingRawKeyColumns, so refactory it into a new helper object","created_at":"2014-11-10T08:58:44Z","updated_at":"2014-11-10T18:08:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25d98433b44676d46b8c4190fb30d4e29fda1acd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21/commits","review_comments_url":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21/comments","review_comment_url":"https://api.github.com/repos/Huawei-Spark/spark/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Huawei-Spark/spark/issues/21/comments","statuses_url":"https://api.github.com/repos/Huawei-Spark/spark/statuses/88955edd7651b14b430ebe8eb5ad05d60cd5a1d6","head":{"label":"jackylk:refactory-helper","ref":"refactory-helper","sha":"88955edd7651b14b430ebe8eb5ad05d60cd5a1d6","user":{"login":"jackylk","id":6500698,"avatar_url":"https://avatars.githubusercontent.com/u/6500698?v=3","gravatar_id":"","url":"https://api.github.com/users/jackylk","html_url":"https://github.com/jackylk","followers_url":"https://api.github.com/users/jackylk/followers","following_url":"https://api.github.com/users/jackylk/following{/other_user}","gists_url":"https://api.github.com/users/jackylk/gists{/gist_id}","starred_url":"https://api.github.com/users/jackylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackylk/subscriptions","organizations_url":"https://api.github.com/users/jackylk/orgs","repos_url":"https://api.github.com/users/jackylk/repos","events_url":"https://api.github.com/users/jackylk/events{/privacy}","received_events_url":"https://api.github.com/users/jackylk/received_events","type":"User","site_admin":false},"repo":{"id":24837242,"name":"spark","full_name":"jackylk/spark","owner":{"login":"jackylk","id":6500698,"avatar_url":"https://avatars.githubusercontent.com/u/6500698?v=3","gravatar_id":"","url":"https://api.github.com/users/jackylk","html_url":"https://github.com/jackylk","followers_url":"https://api.github.com/users/jackylk/followers","following_url":"https://api.github.com/users/jackylk/following{/other_user}","gists_url":"https://api.github.com/users/jackylk/gists{/gist_id}","starred_url":"https://api.github.com/users/jackylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackylk/subscriptions","organizations_url":"https://api.github.com/users/jackylk/orgs","repos_url":"https://api.github.com/users/jackylk/repos","events_url":"https://api.github.com/users/jackylk/events{/privacy}","received_events_url":"https://api.github.com/users/jackylk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jackylk/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/jackylk/spark","forks_url":"https://api.github.com/repos/jackylk/spark/forks","keys_url":"https://api.github.com/repos/jackylk/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jackylk/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jackylk/spark/teams","hooks_url":"https://api.github.com/repos/jackylk/spark/hooks","issue_events_url":"https://api.github.com/repos/jackylk/spark/issues/events{/number}","events_url":"https://api.github.com/repos/jackylk/spark/events","assignees_url":"https://api.github.com/repos/jackylk/spark/assignees{/user}","branches_url":"https://api.github.com/repos/jackylk/spark/branches{/branch}","tags_url":"https://api.github.com/repos/jackylk/spark/tags","blobs_url":"https://api.github.com/repos/jackylk/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jackylk/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jackylk/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/jackylk/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jackylk/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/jackylk/spark/languages","stargazers_url":"https://api.github.com/repos/jackylk/spark/stargazers","contributors_url":"https://api.github.com/repos/jackylk/spark/contributors","subscribers_url":"https://api.github.com/repos/jackylk/spark/subscribers","subscription_url":"https://api.github.com/repos/jackylk/spark/subscription","commits_url":"https://api.github.com/repos/jackylk/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/jackylk/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/jackylk/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/jackylk/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/jackylk/spark/contents/{+path}","compare_url":"https://api.github.com/repos/jackylk/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jackylk/spark/merges","archive_url":"https://api.github.com/repos/jackylk/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jackylk/spark/downloads","issues_url":"https://api.github.com/repos/jackylk/spark/issues{/number}","pulls_url":"https://api.github.com/repos/jackylk/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/jackylk/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/jackylk/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jackylk/spark/labels{/name}","releases_url":"https://api.github.com/repos/jackylk/spark/releases{/id}","created_at":"2014-10-06T07:29:40Z","updated_at":"2014-10-20T09:35:05Z","pushed_at":"2014-11-10T08:54:58Z","git_url":"git://github.com/jackylk/spark.git","ssh_url":"git@github.com:jackylk/spark.git","clone_url":"https://github.com/jackylk/spark.git","svn_url":"https://github.com/jackylk/spark","homepage":null,"size":84184,"stargazers_count":1,"watchers_count":1,"language":"Scala","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":1,"default_branch":"master"}},"base":{"label":"Huawei-Spark:hbase","ref":"hbase","sha":"5f5ba9bcaec44ddcd249f01ff5a6920a66722057","user":{"login":"Huawei-Spark","id":8421689,"avatar_url":"https://avatars.githubusercontent.com/u/8421689?v=3","gravatar_id":"","url":"https://api.github.com/users/Huawei-Spark","html_url":"https://github.com/Huawei-Spark","followers_url":"https://api.github.com/users/Huawei-Spark/followers","following_url":"https://api.github.com/users/Huawei-Spark/following{/other_user}","gists_url":"https://api.github.com/users/Huawei-Spark/gists{/gist_id}","starred_url":"https://api.github.com/users/Huawei-Spark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huawei-Spark/subscriptions","organizations_url":"https://api.github.com/users/Huawei-Spark/orgs","repos_url":"https://api.github.com/users/Huawei-Spark/repos","events_url":"https://api.github.com/users/Huawei-Spark/events{/privacy}","received_events_url":"https://api.github.com/users/Huawei-Spark/received_events","type":"Organization","site_admin":false},"repo":{"id":22938010,"name":"spark","full_name":"Huawei-Spark/spark","owner":{"login":"Huawei-Spark","id":8421689,"avatar_url":"https://avatars.githubusercontent.com/u/8421689?v=3","gravatar_id":"","url":"https://api.github.com/users/Huawei-Spark","html_url":"https://github.com/Huawei-Spark","followers_url":"https://api.github.com/users/Huawei-Spark/followers","following_url":"https://api.github.com/users/Huawei-Spark/following{/other_user}","gists_url":"https://api.github.com/users/Huawei-Spark/gists{/gist_id}","starred_url":"https://api.github.com/users/Huawei-Spark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Huawei-Spark/subscriptions","organizations_url":"https://api.github.com/users/Huawei-Spark/orgs","repos_url":"https://api.github.com/users/Huawei-Spark/repos","events_url":"https://api.github.com/users/Huawei-Spark/events{/privacy}","received_events_url":"https://api.github.com/users/Huawei-Spark/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Huawei-Spark/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/Huawei-Spark/spark","forks_url":"https://api.github.com/repos/Huawei-Spark/spark/forks","keys_url":"https://api.github.com/repos/Huawei-Spark/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Huawei-Spark/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Huawei-Spark/spark/teams","hooks_url":"https://api.github.com/repos/Huawei-Spark/spark/hooks","issue_events_url":"https://api.github.com/repos/Huawei-Spark/spark/issues/events{/number}","events_url":"https://api.github.com/repos/Huawei-Spark/spark/events","assignees_url":"https://api.github.com/repos/Huawei-Spark/spark/assignees{/user}","branches_url":"https://api.github.com/repos/Huawei-Spark/spark/branches{/branch}","tags_url":"https://api.github.com/repos/Huawei-Spark/spark/tags","blobs_url":"https://api.github.com/repos/Huawei-Spark/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Huawei-Spark/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Huawei-Spark/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/Huawei-Spark/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Huawei-Spark/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/Huawei-Spark/spark/languages","stargazers_url":"https://api.github.com/repos/Huawei-Spark/spark/stargazers","contributors_url":"https://api.github.com/repos/Huawei-Spark/spark/contributors","subscribers_url":"https://api.github.com/repos/Huawei-Spark/spark/subscribers","subscription_url":"https://api.github.com/repos/Huawei-Spark/spark/subscription","commits_url":"https://api.github.com/repos/Huawei-Spark/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/Huawei-Spark/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/Huawei-Spark/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/Huawei-Spark/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/Huawei-Spark/spark/contents/{+path}","compare_url":"https://api.github.com/repos/Huawei-Spark/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Huawei-Spark/spark/merges","archive_url":"https://api.github.com/repos/Huawei-Spark/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Huawei-Spark/spark/downloads","issues_url":"https://api.github.com/repos/Huawei-Spark/spark/issues{/number}","pulls_url":"https://api.github.com/repos/Huawei-Spark/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/Huawei-Spark/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/Huawei-Spark/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Huawei-Spark/spark/labels{/name}","releases_url":"https://api.github.com/repos/Huawei-Spark/spark/releases{/id}","created_at":"2014-08-14T02:06:44Z","updated_at":"2014-08-14T23:26:45Z","pushed_at":"2014-11-10T07:57:27Z","git_url":"git://github.com/Huawei-Spark/spark.git","ssh_url":"git@github.com:Huawei-Spark/spark.git","clone_url":"https://github.com/Huawei-Spark/spark.git","svn_url":"https://github.com/Huawei-Spark/spark","homepage":null,"size":82701,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"hbase"}},"_links":{"self":{"href":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21"},"html":{"href":"https://github.com/Huawei-Spark/spark/pull/21"},"issue":{"href":"https://api.github.com/repos/Huawei-Spark/spark/issues/21"},"comments":{"href":"https://api.github.com/repos/Huawei-Spark/spark/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/Huawei-Spark/spark/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Huawei-Spark/spark/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/Huawei-Spark/spark/statuses/88955edd7651b14b430ebe8eb5ad05d60cd5a1d6"}}}}