{"action":"created","comment":{"url":"https://api.github.com/repos/apache/carbondata/pulls/comments/240206699","pull_request_review_id":183181392,"id":240206699,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDIwNjY5OQ==","diff_hunk":"@@ -0,0 +1,132 @@\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.carbondata.core.datastore.compression;\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.ByteArrayOutputStream;\n+import java.io.IOException;\n+\n+import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;\n+import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;\n+\n+/**\n+ * Codec Class for performing Gzip Compression\n+ */\n+public class GzipCompressor extends AbstractCompressor {\n+\n+  @Override public String getName() {\n+    return \"gzip\";\n+  }\n+\n+  /**\n+   * This method takes the Byte Array data and Compresses in gzip format\n+   *\n+   * @param data Data Byte Array passed for compression\n+   * @return Compressed Byte Array\n+   */\n+  private byte[] compressData(byte[] data) {\n+    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n+    try {\n+      GzipCompressorOutputStream gzipCompressorOutputStream =\n+          new GzipCompressorOutputStream(byteArrayOutputStream);\n+      try {\n+        /**\n+         * Below api will write bytes from specified byte array to the gzipCompressorOutputStream\n+         * The output stream will compress the given byte array.\n+         */\n+        gzipCompressorOutputStream.write(data);\n+      } catch (IOException e) {\n+        throw new RuntimeException(\"Error during Compression writing step \", e);\n+      } finally {\n+        gzipCompressorOutputStream.close();\n+      }\n+    } catch (IOException e) {\n+      throw new RuntimeException(\"Error during Compression step \", e);\n+    }\n+    return byteArrayOutputStream.toByteArray();\n+  }\n+\n+  /**\n+   * This method takes the Byte Array data and Decompresses in gzip format\n+   *\n+   * @param data   Data Byte Array for Compression\n+   * @param offset Start value of Data Byte Array\n+   * @param length Size of Byte Array\n+   * @return\n+   */\n+  private byte[] decompressData(byte[] data, int offset, int length) {\n+    ByteArrayInputStream byteArrayOutputStream = new ByteArrayInputStream(data, offset, length);\n+    ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();\n+    try {\n+      GzipCompressorInputStream gzipCompressorInputStream =\n+          new GzipCompressorInputStream(byteArrayOutputStream);\n+      byte[] buffer = new byte[1024];","path":"core/src/main/java/org/apache/carbondata/core/datastore/compression/GzipCompressor.java","position":78,"original_position":78,"commit_id":"935f8bf4f24a2a2d28f5237695f407aad320633f","original_commit_id":"935f8bf4f24a2a2d28f5237695f407aad320633f","user":{"login":"KanakaKumar","id":30794714,"node_id":"MDQ6VXNlcjMwNzk0NzE0","avatar_url":"https://avatars3.githubusercontent.com/u/30794714?v=4","gravatar_id":"","url":"https://api.github.com/users/KanakaKumar","html_url":"https://github.com/KanakaKumar","followers_url":"https://api.github.com/users/KanakaKumar/followers","following_url":"https://api.github.com/users/KanakaKumar/following{/other_user}","gists_url":"https://api.github.com/users/KanakaKumar/gists{/gist_id}","starred_url":"https://api.github.com/users/KanakaKumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KanakaKumar/subscriptions","organizations_url":"https://api.github.com/users/KanakaKumar/orgs","repos_url":"https://api.github.com/users/KanakaKumar/repos","events_url":"https://api.github.com/users/KanakaKumar/events{/privacy}","received_events_url":"https://api.github.com/users/KanakaKumar/received_events","type":"User","site_admin":false},"body":"Instead of fixed 1024, can you observe what is the blocksize (bytes size) gzip operates and use the same value ?","created_at":"2018-12-10T13:24:03Z","updated_at":"2018-12-10T13:32:06Z","html_url":"https://github.com/apache/carbondata/pull/2847#discussion_r240206699","pull_request_url":"https://api.github.com/repos/apache/carbondata/pulls/2847","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/carbondata/pulls/comments/240206699"},"html":{"href":"https://github.com/apache/carbondata/pull/2847#discussion_r240206699"},"pull_request":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2847"}}},"pull_request":{"url":"https://api.github.com/repos/apache/carbondata/pulls/2847","id":225018443,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MDE4NDQz","html_url":"https://github.com/apache/carbondata/pull/2847","diff_url":"https://github.com/apache/carbondata/pull/2847.diff","patch_url":"https://github.com/apache/carbondata/pull/2847.patch","issue_url":"https://api.github.com/repos/apache/carbondata/issues/2847","number":2847,"state":"open","locked":false,"title":"[CARBONDATA-3005]Support Gzip as column compressor","user":{"login":"shardul-cr7","id":13481398,"node_id":"MDQ6VXNlcjEzNDgxMzk4","avatar_url":"https://avatars2.githubusercontent.com/u/13481398?v=4","gravatar_id":"","url":"https://api.github.com/users/shardul-cr7","html_url":"https://github.com/shardul-cr7","followers_url":"https://api.github.com/users/shardul-cr7/followers","following_url":"https://api.github.com/users/shardul-cr7/following{/other_user}","gists_url":"https://api.github.com/users/shardul-cr7/gists{/gist_id}","starred_url":"https://api.github.com/users/shardul-cr7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shardul-cr7/subscriptions","organizations_url":"https://api.github.com/users/shardul-cr7/orgs","repos_url":"https://api.github.com/users/shardul-cr7/repos","events_url":"https://api.github.com/users/shardul-cr7/events{/privacy}","received_events_url":"https://api.github.com/users/shardul-cr7/received_events","type":"User","site_admin":false},"body":"Gzip compressed file size is less than that of snappy but takes more time.\r\n\r\nData generated by tpch-dbgen(lineitem)\r\n\r\n**Load Performance Comparisons (Compression)**\r\n\r\n*Test Case 1*\r\n*File Size 3.9G*\r\n*Records ~30M*\r\n\r\n| Codec Used | Load Time | File Size After Load | \r\n| ------ | ------ | ------ |\r\n| Snappy | 387s| 1.1G\r\n| Zstd| 459s | 848M\r\n| Gzip| 464s| 830M\r\n\r\n*Test Case 2*\r\n*File Size 7.8G*\r\n*Records ~60M*\r\n\r\n| Codec Used | Load Time | File Size After Load | \r\n| ------ | ------ | ------ |\r\n| Snappy | 771s| 2.2G\r\n| Zstd| 764s| 1.8G\r\n| Gzip| 986s| 1.7G\r\n\r\n**Query Performance (Decompression)**\r\n\r\n*Test Case 1*\r\n\r\n| Codec Used | Full Scan Time  \r\n| ------ | ------ \r\n| Snappy | 36.99s\r\n| Zstd| 39.275s\r\n| Gzip| 45.601s\r\n\r\n*Test Case 2*\r\n\r\n| Codec Used | Full Scan Time  \r\n| ------ | ------ \r\n| Snappy | 73.114s\r\n| Zstd| 77.360s\r\n| Gzip| 88.510s\r\n\r\nBe sure to do all of the following checklist to help us incorporate \r\nyour contribution quickly and easily:\r\n\r\n - [ ] Any interfaces changed?\r\n \r\n - [ ] Any backward compatibility impacted?\r\n \r\n - [ ] Document update required?\r\n\r\n - [x] Testing done\r\n      added some testcases\r\n       \r\n - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. \r\n\r\n","created_at":"2018-10-23T12:29:02Z","updated_at":"2018-12-10T13:32:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed8e9850be17c21bb2ba4797ab5dbf62b6167636","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/carbondata/pulls/2847/commits","review_comments_url":"https://api.github.com/repos/apache/carbondata/pulls/2847/comments","review_comment_url":"https://api.github.com/repos/apache/carbondata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/carbondata/issues/2847/comments","statuses_url":"https://api.github.com/repos/apache/carbondata/statuses/935f8bf4f24a2a2d28f5237695f407aad320633f","head":{"label":"shardul-cr7:b010","ref":"b010","sha":"935f8bf4f24a2a2d28f5237695f407aad320633f","user":{"login":"shardul-cr7","id":13481398,"node_id":"MDQ6VXNlcjEzNDgxMzk4","avatar_url":"https://avatars2.githubusercontent.com/u/13481398?v=4","gravatar_id":"","url":"https://api.github.com/users/shardul-cr7","html_url":"https://github.com/shardul-cr7","followers_url":"https://api.github.com/users/shardul-cr7/followers","following_url":"https://api.github.com/users/shardul-cr7/following{/other_user}","gists_url":"https://api.github.com/users/shardul-cr7/gists{/gist_id}","starred_url":"https://api.github.com/users/shardul-cr7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shardul-cr7/subscriptions","organizations_url":"https://api.github.com/users/shardul-cr7/orgs","repos_url":"https://api.github.com/users/shardul-cr7/repos","events_url":"https://api.github.com/users/shardul-cr7/events{/privacy}","received_events_url":"https://api.github.com/users/shardul-cr7/received_events","type":"User","site_admin":false},"repo":{"id":143402382,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM0MDIzODI=","name":"carbondata","full_name":"shardul-cr7/carbondata","private":false,"owner":{"login":"shardul-cr7","id":13481398,"node_id":"MDQ6VXNlcjEzNDgxMzk4","avatar_url":"https://avatars2.githubusercontent.com/u/13481398?v=4","gravatar_id":"","url":"https://api.github.com/users/shardul-cr7","html_url":"https://github.com/shardul-cr7","followers_url":"https://api.github.com/users/shardul-cr7/followers","following_url":"https://api.github.com/users/shardul-cr7/following{/other_user}","gists_url":"https://api.github.com/users/shardul-cr7/gists{/gist_id}","starred_url":"https://api.github.com/users/shardul-cr7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shardul-cr7/subscriptions","organizations_url":"https://api.github.com/users/shardul-cr7/orgs","repos_url":"https://api.github.com/users/shardul-cr7/repos","events_url":"https://api.github.com/users/shardul-cr7/events{/privacy}","received_events_url":"https://api.github.com/users/shardul-cr7/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shardul-cr7/carbondata","description":"Mirror of Apache CarbonData","fork":true,"url":"https://api.github.com/repos/shardul-cr7/carbondata","forks_url":"https://api.github.com/repos/shardul-cr7/carbondata/forks","keys_url":"https://api.github.com/repos/shardul-cr7/carbondata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shardul-cr7/carbondata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shardul-cr7/carbondata/teams","hooks_url":"https://api.github.com/repos/shardul-cr7/carbondata/hooks","issue_events_url":"https://api.github.com/repos/shardul-cr7/carbondata/issues/events{/number}","events_url":"https://api.github.com/repos/shardul-cr7/carbondata/events","assignees_url":"https://api.github.com/repos/shardul-cr7/carbondata/assignees{/user}","branches_url":"https://api.github.com/repos/shardul-cr7/carbondata/branches{/branch}","tags_url":"https://api.github.com/repos/shardul-cr7/carbondata/tags","blobs_url":"https://api.github.com/repos/shardul-cr7/carbondata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shardul-cr7/carbondata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shardul-cr7/carbondata/git/refs{/sha}","trees_url":"https://api.github.com/repos/shardul-cr7/carbondata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shardul-cr7/carbondata/statuses/{sha}","languages_url":"https://api.github.com/repos/shardul-cr7/carbondata/languages","stargazers_url":"https://api.github.com/repos/shardul-cr7/carbondata/stargazers","contributors_url":"https://api.github.com/repos/shardul-cr7/carbondata/contributors","subscribers_url":"https://api.github.com/repos/shardul-cr7/carbondata/subscribers","subscription_url":"https://api.github.com/repos/shardul-cr7/carbondata/subscription","commits_url":"https://api.github.com/repos/shardul-cr7/carbondata/commits{/sha}","git_commits_url":"https://api.github.com/repos/shardul-cr7/carbondata/git/commits{/sha}","comments_url":"https://api.github.com/repos/shardul-cr7/carbondata/comments{/number}","issue_comment_url":"https://api.github.com/repos/shardul-cr7/carbondata/issues/comments{/number}","contents_url":"https://api.github.com/repos/shardul-cr7/carbondata/contents/{+path}","compare_url":"https://api.github.com/repos/shardul-cr7/carbondata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shardul-cr7/carbondata/merges","archive_url":"https://api.github.com/repos/shardul-cr7/carbondata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shardul-cr7/carbondata/downloads","issues_url":"https://api.github.com/repos/shardul-cr7/carbondata/issues{/number}","pulls_url":"https://api.github.com/repos/shardul-cr7/carbondata/pulls{/number}","milestones_url":"https://api.github.com/repos/shardul-cr7/carbondata/milestones{/number}","notifications_url":"https://api.github.com/repos/shardul-cr7/carbondata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shardul-cr7/carbondata/labels{/name}","releases_url":"https://api.github.com/repos/shardul-cr7/carbondata/releases{/id}","deployments_url":"https://api.github.com/repos/shardul-cr7/carbondata/deployments","created_at":"2018-08-03T08:43:22Z","updated_at":"2018-09-11T13:06:34Z","pushed_at":"2018-12-10T10:30:14Z","git_url":"git://github.com/shardul-cr7/carbondata.git","ssh_url":"git@github.com:shardul-cr7/carbondata.git","clone_url":"https://github.com/shardul-cr7/carbondata.git","svn_url":"https://github.com/shardul-cr7/carbondata","homepage":"","size":200398,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"d9f1a81154a0b917d16bde8ffba7cf013cc3cf2f","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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":62117818,"node_id":"MDEwOlJlcG9zaXRvcnk2MjExNzgxOA==","name":"carbondata","full_name":"apache/carbondata","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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},"html_url":"https://github.com/apache/carbondata","description":"Mirror of Apache CarbonData","fork":false,"url":"https://api.github.com/repos/apache/carbondata","forks_url":"https://api.github.com/repos/apache/carbondata/forks","keys_url":"https://api.github.com/repos/apache/carbondata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/carbondata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/carbondata/teams","hooks_url":"https://api.github.com/repos/apache/carbondata/hooks","issue_events_url":"https://api.github.com/repos/apache/carbondata/issues/events{/number}","events_url":"https://api.github.com/repos/apache/carbondata/events","assignees_url":"https://api.github.com/repos/apache/carbondata/assignees{/user}","branches_url":"https://api.github.com/repos/apache/carbondata/branches{/branch}","tags_url":"https://api.github.com/repos/apache/carbondata/tags","blobs_url":"https://api.github.com/repos/apache/carbondata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/carbondata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/carbondata/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/carbondata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/carbondata/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/carbondata/languages","stargazers_url":"https://api.github.com/repos/apache/carbondata/stargazers","contributors_url":"https://api.github.com/repos/apache/carbondata/contributors","subscribers_url":"https://api.github.com/repos/apache/carbondata/subscribers","subscription_url":"https://api.github.com/repos/apache/carbondata/subscription","commits_url":"https://api.github.com/repos/apache/carbondata/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/carbondata/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/carbondata/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/carbondata/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/carbondata/contents/{+path}","compare_url":"https://api.github.com/repos/apache/carbondata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/carbondata/merges","archive_url":"https://api.github.com/repos/apache/carbondata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/carbondata/downloads","issues_url":"https://api.github.com/repos/apache/carbondata/issues{/number}","pulls_url":"https://api.github.com/repos/apache/carbondata/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/carbondata/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/carbondata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/carbondata/labels{/name}","releases_url":"https://api.github.com/repos/apache/carbondata/releases{/id}","deployments_url":"https://api.github.com/repos/apache/carbondata/deployments","created_at":"2016-06-28T07:00:06Z","updated_at":"2018-12-10T03:23:32Z","pushed_at":"2018-12-10T13:13:56Z","git_url":"git://github.com/apache/carbondata.git","ssh_url":"git@github.com:apache/carbondata.git","clone_url":"https://github.com/apache/carbondata.git","svn_url":"https://github.com/apache/carbondata","homepage":"","size":65700,"stargazers_count":813,"watchers_count":813,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":489,"mirror_url":null,"archived":false,"open_issues_count":114,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":489,"open_issues":114,"watchers":813,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2847"},"html":{"href":"https://github.com/apache/carbondata/pull/2847"},"issue":{"href":"https://api.github.com/repos/apache/carbondata/issues/2847"},"comments":{"href":"https://api.github.com/repos/apache/carbondata/issues/2847/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2847/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/carbondata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/carbondata/pulls/2847/commits"},"statuses":{"href":"https://api.github.com/repos/apache/carbondata/statuses/935f8bf4f24a2a2d28f5237695f407aad320633f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"KanakaKumar"}}