{"action":"created","comment":{"url":"https://api.github.com/repos/apache/drill/pulls/comments/93133495","pull_request_review_id":13655738,"id":93133495,"diff_hunk":"@@ -172,48 +172,35 @@ public static JBlock getDrillObject(JCodeModel m, ObjectInspector oi,\n             booleanJC._then().assign(returnValueHolder.ref(\"value\"), JExpr.lit(1));\n             booleanJC._else().assign(returnValueHolder.ref(\"value\"), JExpr.lit(0));\n \n-          <#elseif entry.hiveType == \"VARCHAR\">\n-            JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n-              castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue)\n+          <#elseif entry.hiveType == \"VARCHAR\" || entry.hiveType == \"CHAR\" || entry.hiveType == \"STRING\" || entry.hiveType == \"BINARY\">\n+            <#if entry.hiveType == \"VARCHAR\">\n+              JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n+                  castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue)\n                       .invoke(\"getValue\")\n                       .invoke(\"getBytes\"));\n-\n-            jc._else().add(returnValueHolder.ref(\"buffer\")\n-              .invoke(\"setBytes\").arg(JExpr.lit(0)).arg(data));\n-\n-\n-            jc._else().assign(returnValueHolder.ref(\"start\"), JExpr.lit(0));\n-            jc._else().assign(returnValueHolder.ref(\"end\"), data.ref(\"length\"));\n-\n             <#elseif entry.hiveType == \"CHAR\">\n                 JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n-                castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue)\n-                    .invoke(\"getStrippedValue\")\n-                    .invoke(\"getBytes\"));\n-\n-            jc._else().add(returnValueHolder.ref(\"buffer\")\n-                .invoke(\"setBytes\").arg(JExpr.lit(0)).arg(data));\n-\n-\n-            jc._else().assign(returnValueHolder.ref(\"start\"), JExpr.lit(0));\n-            jc._else().assign(returnValueHolder.ref(\"end\"), data.ref(\"length\"));\n-\n-          <#elseif entry.hiveType == \"STRING\">\n-            JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n-              castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue)\n+                    castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue)\n+                        .invoke(\"getStrippedValue\")\n+                        .invoke(\"getBytes\"));\n+            <#elseif entry.hiveType == \"STRING\">\n+              JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n+                  castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue)\n                       .invoke(\"getBytes\"));\n-            jc._else().add(returnValueHolder.ref(\"buffer\")\n-              .invoke(\"setBytes\").arg(JExpr.lit(0)).arg(data));\n-            jc._else().assign(returnValueHolder.ref(\"start\"), JExpr.lit(0));\n-            jc._else().assign(returnValueHolder.ref(\"end\"), data.ref(\"length\"));\n-          <#elseif entry.hiveType == \"BINARY\">\n+            <#elseif entry.hiveType == \"BINARY\">\n+                JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n+                    castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue));\n+            </#if>\n \n-            JVar data = jc._else().decl(m.directClass(byte[].class.getCanonicalName()), \"data\",\n-              castedOI.invoke(\"getPrimitiveJavaObject\").arg(returnValue));\n-            jc._else().add(returnValueHolder.ref(\"buffer\")\n+            JConditional jnullif = jc._else()._if(data.eq(JExpr._null()));\n+            jnullif._then().assign(returnValueHolder.ref(\"isSet\"), JExpr.lit(0));","path":"contrib/storage-hive/core/src/main/codegen/templates/ObjectInspectorHelper.java","position":58,"original_position":58,"commit_id":"54334558b63c4f15e66bbb88f639911d56e04cb9","original_commit_id":"54334558b63c4f15e66bbb88f639911d56e04cb9","user":{"login":"bitblender","id":430469,"avatar_url":"https://avatars.githubusercontent.com/u/430469?v=3","gravatar_id":"","url":"https://api.github.com/users/bitblender","html_url":"https://github.com/bitblender","followers_url":"https://api.github.com/users/bitblender/followers","following_url":"https://api.github.com/users/bitblender/following{/other_user}","gists_url":"https://api.github.com/users/bitblender/gists{/gist_id}","starred_url":"https://api.github.com/users/bitblender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitblender/subscriptions","organizations_url":"https://api.github.com/users/bitblender/orgs","repos_url":"https://api.github.com/users/bitblender/repos","events_url":"https://api.github.com/users/bitblender/events{/privacy}","received_events_url":"https://api.github.com/users/bitblender/received_events","type":"User","site_admin":false},"body":"Why is isSet set to 0 here ?","created_at":"2016-12-19T22:26:28Z","updated_at":"2016-12-19T22:26:28Z","html_url":"https://github.com/apache/drill/pull/695#discussion_r93133495","pull_request_url":"https://api.github.com/repos/apache/drill/pulls/695","_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/comments/93133495"},"html":{"href":"https://github.com/apache/drill/pull/695#discussion_r93133495"},"pull_request":{"href":"https://api.github.com/repos/apache/drill/pulls/695"}}},"pull_request":{"url":"https://api.github.com/repos/apache/drill/pulls/695","id":97869364,"html_url":"https://github.com/apache/drill/pull/695","diff_url":"https://github.com/apache/drill/pull/695.diff","patch_url":"https://github.com/apache/drill/pull/695.patch","issue_url":"https://api.github.com/repos/apache/drill/issues/695","number":695,"state":"open","locked":false,"title":"DRILL-4868: fix how hive function set DrillBuf.","user":{"login":"chunhui-shi","id":9878787,"avatar_url":"https://avatars.githubusercontent.com/u/9878787?v=3","gravatar_id":"","url":"https://api.github.com/users/chunhui-shi","html_url":"https://github.com/chunhui-shi","followers_url":"https://api.github.com/users/chunhui-shi/followers","following_url":"https://api.github.com/users/chunhui-shi/following{/other_user}","gists_url":"https://api.github.com/users/chunhui-shi/gists{/gist_id}","starred_url":"https://api.github.com/users/chunhui-shi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chunhui-shi/subscriptions","organizations_url":"https://api.github.com/users/chunhui-shi/orgs","repos_url":"https://api.github.com/users/chunhui-shi/repos","events_url":"https://api.github.com/users/chunhui-shi/events{/privacy}","received_events_url":"https://api.github.com/users/chunhui-shi/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-14T01:11:16Z","updated_at":"2016-12-19T22:26:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"796bf28a9a182675d323aebbc899fa37a63376f3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/drill/pulls/695/commits","review_comments_url":"https://api.github.com/repos/apache/drill/pulls/695/comments","review_comment_url":"https://api.github.com/repos/apache/drill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/drill/issues/695/comments","statuses_url":"https://api.github.com/repos/apache/drill/statuses/54334558b63c4f15e66bbb88f639911d56e04cb9","head":{"label":"chunhui-shi:DRILL-4868","ref":"DRILL-4868","sha":"54334558b63c4f15e66bbb88f639911d56e04cb9","user":{"login":"chunhui-shi","id":9878787,"avatar_url":"https://avatars.githubusercontent.com/u/9878787?v=3","gravatar_id":"","url":"https://api.github.com/users/chunhui-shi","html_url":"https://github.com/chunhui-shi","followers_url":"https://api.github.com/users/chunhui-shi/followers","following_url":"https://api.github.com/users/chunhui-shi/following{/other_user}","gists_url":"https://api.github.com/users/chunhui-shi/gists{/gist_id}","starred_url":"https://api.github.com/users/chunhui-shi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chunhui-shi/subscriptions","organizations_url":"https://api.github.com/users/chunhui-shi/orgs","repos_url":"https://api.github.com/users/chunhui-shi/repos","events_url":"https://api.github.com/users/chunhui-shi/events{/privacy}","received_events_url":"https://api.github.com/users/chunhui-shi/received_events","type":"User","site_admin":false},"repo":{"id":53957525,"name":"drill","full_name":"chunhui-shi/drill","owner":{"login":"chunhui-shi","id":9878787,"avatar_url":"https://avatars.githubusercontent.com/u/9878787?v=3","gravatar_id":"","url":"https://api.github.com/users/chunhui-shi","html_url":"https://github.com/chunhui-shi","followers_url":"https://api.github.com/users/chunhui-shi/followers","following_url":"https://api.github.com/users/chunhui-shi/following{/other_user}","gists_url":"https://api.github.com/users/chunhui-shi/gists{/gist_id}","starred_url":"https://api.github.com/users/chunhui-shi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chunhui-shi/subscriptions","organizations_url":"https://api.github.com/users/chunhui-shi/orgs","repos_url":"https://api.github.com/users/chunhui-shi/repos","events_url":"https://api.github.com/users/chunhui-shi/events{/privacy}","received_events_url":"https://api.github.com/users/chunhui-shi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chunhui-shi/drill","description":"Mirror of Apache Drill","fork":true,"url":"https://api.github.com/repos/chunhui-shi/drill","forks_url":"https://api.github.com/repos/chunhui-shi/drill/forks","keys_url":"https://api.github.com/repos/chunhui-shi/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chunhui-shi/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chunhui-shi/drill/teams","hooks_url":"https://api.github.com/repos/chunhui-shi/drill/hooks","issue_events_url":"https://api.github.com/repos/chunhui-shi/drill/issues/events{/number}","events_url":"https://api.github.com/repos/chunhui-shi/drill/events","assignees_url":"https://api.github.com/repos/chunhui-shi/drill/assignees{/user}","branches_url":"https://api.github.com/repos/chunhui-shi/drill/branches{/branch}","tags_url":"https://api.github.com/repos/chunhui-shi/drill/tags","blobs_url":"https://api.github.com/repos/chunhui-shi/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chunhui-shi/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chunhui-shi/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/chunhui-shi/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chunhui-shi/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/chunhui-shi/drill/languages","stargazers_url":"https://api.github.com/repos/chunhui-shi/drill/stargazers","contributors_url":"https://api.github.com/repos/chunhui-shi/drill/contributors","subscribers_url":"https://api.github.com/repos/chunhui-shi/drill/subscribers","subscription_url":"https://api.github.com/repos/chunhui-shi/drill/subscription","commits_url":"https://api.github.com/repos/chunhui-shi/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/chunhui-shi/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/chunhui-shi/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/chunhui-shi/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/chunhui-shi/drill/contents/{+path}","compare_url":"https://api.github.com/repos/chunhui-shi/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chunhui-shi/drill/merges","archive_url":"https://api.github.com/repos/chunhui-shi/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chunhui-shi/drill/downloads","issues_url":"https://api.github.com/repos/chunhui-shi/drill/issues{/number}","pulls_url":"https://api.github.com/repos/chunhui-shi/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/chunhui-shi/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/chunhui-shi/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chunhui-shi/drill/labels{/name}","releases_url":"https://api.github.com/repos/chunhui-shi/drill/releases{/id}","deployments_url":"https://api.github.com/repos/chunhui-shi/drill/deployments","created_at":"2016-03-15T15:45:33Z","updated_at":"2016-12-07T01:17:58Z","pushed_at":"2016-12-18T08:28:46Z","git_url":"git://github.com/chunhui-shi/drill.git","ssh_url":"git@github.com:chunhui-shi/drill.git","clone_url":"https://github.com/chunhui-shi/drill.git","svn_url":"https://github.com/chunhui-shi/drill","homepage":"","size":43696,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"cf2b7c70ea47e604364ccb5e8076bbd7eae310c3","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":5683653,"name":"drill","full_name":"apache/drill","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/drill","description":"Mirror of Apache Drill","fork":false,"url":"https://api.github.com/repos/apache/drill","forks_url":"https://api.github.com/repos/apache/drill/forks","keys_url":"https://api.github.com/repos/apache/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/drill/teams","hooks_url":"https://api.github.com/repos/apache/drill/hooks","issue_events_url":"https://api.github.com/repos/apache/drill/issues/events{/number}","events_url":"https://api.github.com/repos/apache/drill/events","assignees_url":"https://api.github.com/repos/apache/drill/assignees{/user}","branches_url":"https://api.github.com/repos/apache/drill/branches{/branch}","tags_url":"https://api.github.com/repos/apache/drill/tags","blobs_url":"https://api.github.com/repos/apache/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/drill/languages","stargazers_url":"https://api.github.com/repos/apache/drill/stargazers","contributors_url":"https://api.github.com/repos/apache/drill/contributors","subscribers_url":"https://api.github.com/repos/apache/drill/subscribers","subscription_url":"https://api.github.com/repos/apache/drill/subscription","commits_url":"https://api.github.com/repos/apache/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/drill/contents/{+path}","compare_url":"https://api.github.com/repos/apache/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/drill/merges","archive_url":"https://api.github.com/repos/apache/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/drill/downloads","issues_url":"https://api.github.com/repos/apache/drill/issues{/number}","pulls_url":"https://api.github.com/repos/apache/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/drill/labels{/name}","releases_url":"https://api.github.com/repos/apache/drill/releases{/id}","deployments_url":"https://api.github.com/repos/apache/drill/deployments","created_at":"2012-09-05T07:00:26Z","updated_at":"2016-12-19T09:33:45Z","pushed_at":"2016-12-19T21:46:29Z","git_url":"git://github.com/apache/drill.git","ssh_url":"git@github.com:apache/drill.git","clone_url":"https://github.com/apache/drill.git","svn_url":"https://github.com/apache/drill","homepage":"","size":53800,"stargazers_count":729,"watchers_count":729,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":501,"mirror_url":"git://git.apache.org/drill.git","open_issues_count":128,"forks":501,"open_issues":128,"watchers":729,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/695"},"html":{"href":"https://github.com/apache/drill/pull/695"},"issue":{"href":"https://api.github.com/repos/apache/drill/issues/695"},"comments":{"href":"https://api.github.com/repos/apache/drill/issues/695/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/drill/pulls/695/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/drill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/drill/pulls/695/commits"},"statuses":{"href":"https://api.github.com/repos/apache/drill/statuses/54334558b63c4f15e66bbb88f639911d56e04cb9"}}}}
{"actor":{"display_login":"bitblender"}}