{"action":"created","comment":{"url":"https://api.github.com/repos/apache/phoenix/pulls/comments/35459677","id":35459677,"diff_hunk":"@@ -0,0 +1,285 @@\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.phoenix.end2end;\n+\n+import java.sql.Connection;\n+import java.sql.DriverManager;\n+import java.sql.PreparedStatement;\n+import java.sql.ResultSet;\n+import java.sql.SQLException;\n+import java.util.Properties;\n+\n+import org.apache.phoenix.util.PropertiesUtil;\n+\n+import static org.apache.phoenix.util.TestUtil.TEST_PROPERTIES;\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertFalse;\n+import static org.junit.Assert.assertTrue;\n+\n+import org.junit.Test;\n+\n+public class JSONOperationT extends BaseHBaseManagedTimeIT{\n+\tprivate String json = \"{\\\"k1\\\":\\\"val\\\",\"\t\t+\"\\\"k2\\\":true,\"\t\t+\"\\\"k3\\\":2 ,\"\t\t+\"\\\"k4\\\":2.5 \"+\n+\t\t\t\t\",\\\"k5\\\":[1,\\\"val2\\\",false,3.5]\"+\n+\t\t\t\t\",\\\"k6\\\":{\\\"nestk1\\\":\\\"nestval\\\",\\\"nestk2\\\":77,\\\"nestk3\\\":2.1,\\\"nestk4\\\":[9,8.4,\\\"nestarrayval\\\"]}}\";\n+\t@Test\n+    public void testJsonPointAsElementForTypeInteger() throws Exception {\n+        String selectQuery = \"SELECT col1 FROM testJson WHERE col1 -> 'k3' = 2\";\n+        String pk = \"valueOne\";\n+        Connection conn = getConnection();\n+        try {\n+\n+            createTableAndUpsertRecord(json, pk, conn);\n+\n+            PreparedStatement stmt = conn.prepareStatement(selectQuery);\n+            ResultSet rs = stmt.executeQuery();\n+            assertTrue(rs.next());\n+            assertEquals(\"Json data read from DB is not as expected for query: <\" + selectQuery\n+                    + \">\", json, rs.getString(1));\n+            assertFalse(rs.next());\n+\n+        } finally {\n+            conn.close();\n+        }\n+    }\n+\t@Test\n+    public void testJsonPointAsElementForTypeFloat() throws Exception {\n+        String selectQuery = \"SELECT col1 FROM testJson WHERE col1 -> 'k4' = 2.5\";\n+        String pk = \"valueOne\";\n+        Connection conn = getConnection();\n+        try {\n+\n+            createTableAndUpsertRecord(json, pk, conn);\n+\n+            PreparedStatement stmt = conn.prepareStatement(selectQuery);\n+            ResultSet rs = stmt.executeQuery();\n+            assertTrue(rs.next());\n+            assertEquals(\"Json data read from DB is not as expected for query: <\" + selectQuery\n+                    + \">\", json, rs.getString(1));\n+            assertFalse(rs.next());\n+\n+        } finally {\n+            conn.close();\n+        }\n+    }\n+\t@Test\n+    public void testJsonPointAsElementForTypeVarchar() throws Exception {","path":"phoenix-core/src/it/java/org/apache/phoenix/end2end/JSONOperationT.java","position":82,"original_position":82,"commit_id":"fd4604cbb799600a87da0647671e8dbad6a8c6a7","original_commit_id":"fd4604cbb799600a87da0647671e8dbad6a8c6a7","user":{"login":"twdsilva","id":5653678,"avatar_url":"https://avatars.githubusercontent.com/u/5653678?v=3","gravatar_id":"","url":"https://api.github.com/users/twdsilva","html_url":"https://github.com/twdsilva","followers_url":"https://api.github.com/users/twdsilva/followers","following_url":"https://api.github.com/users/twdsilva/following{/other_user}","gists_url":"https://api.github.com/users/twdsilva/gists{/gist_id}","starred_url":"https://api.github.com/users/twdsilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twdsilva/subscriptions","organizations_url":"https://api.github.com/users/twdsilva/orgs","repos_url":"https://api.github.com/users/twdsilva/repos","events_url":"https://api.github.com/users/twdsilva/events{/privacy}","received_events_url":"https://api.github.com/users/twdsilva/received_events","type":"User","site_admin":false},"body":"Rename to testJsonGetVarcharFieldByKey","created_at":"2015-07-24T19:53:39Z","updated_at":"2015-07-24T19:53:39Z","html_url":"https://github.com/apache/phoenix/pull/101#discussion_r35459677","pull_request_url":"https://api.github.com/repos/apache/phoenix/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments/35459677"},"html":{"href":"https://github.com/apache/phoenix/pull/101#discussion_r35459677"},"pull_request":{"href":"https://api.github.com/repos/apache/phoenix/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/apache/phoenix/pulls/101","id":39881456,"html_url":"https://github.com/apache/phoenix/pull/101","diff_url":"https://github.com/apache/phoenix/pull/101.diff","patch_url":"https://github.com/apache/phoenix/pull/101.patch","issue_url":"https://api.github.com/repos/apache/phoenix/issues/101","number":101,"state":"open","locked":false,"title":"PHOENIX-1661 Implement built-in functions for JSON","user":{"login":"petercdc","id":12855669,"avatar_url":"https://avatars.githubusercontent.com/u/12855669?v=3","gravatar_id":"","url":"https://api.github.com/users/petercdc","html_url":"https://github.com/petercdc","followers_url":"https://api.github.com/users/petercdc/followers","following_url":"https://api.github.com/users/petercdc/following{/other_user}","gists_url":"https://api.github.com/users/petercdc/gists{/gist_id}","starred_url":"https://api.github.com/users/petercdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petercdc/subscriptions","organizations_url":"https://api.github.com/users/petercdc/orgs","repos_url":"https://api.github.com/users/petercdc/repos","events_url":"https://api.github.com/users/petercdc/events{/privacy}","received_events_url":"https://api.github.com/users/petercdc/received_events","type":"User","site_admin":false},"body":"1.Adding following JSON operators:\r\n&nbsp;&nbsp;JSON get data Operator : \"->\" \"->>\" \"#>\" \"#>>\"\r\n&nbsp;&nbsp;JSON Boolean Operactor : \"?\" \"?|\" \"?&\" \"<@\" \"@>\"\r\n\r\n2.add a unit test file: JSONOperationT.java\r\n\r\n3.Adding functions for some JSON operators in PhoenixJson.java \r\n\r\n","created_at":"2015-07-14T04:46:23Z","updated_at":"2015-07-24T19:53:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0963d3cece0275d50c53e5641cbb818663ad8307","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/phoenix/pulls/101/commits","review_comments_url":"https://api.github.com/repos/apache/phoenix/pulls/101/comments","review_comment_url":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/phoenix/issues/101/comments","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/fd4604cbb799600a87da0647671e8dbad6a8c6a7","head":{"label":"petercdc:jsoncdc","ref":"jsoncdc","sha":"fd4604cbb799600a87da0647671e8dbad6a8c6a7","user":{"login":"petercdc","id":12855669,"avatar_url":"https://avatars.githubusercontent.com/u/12855669?v=3","gravatar_id":"","url":"https://api.github.com/users/petercdc","html_url":"https://github.com/petercdc","followers_url":"https://api.github.com/users/petercdc/followers","following_url":"https://api.github.com/users/petercdc/following{/other_user}","gists_url":"https://api.github.com/users/petercdc/gists{/gist_id}","starred_url":"https://api.github.com/users/petercdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petercdc/subscriptions","organizations_url":"https://api.github.com/users/petercdc/orgs","repos_url":"https://api.github.com/users/petercdc/repos","events_url":"https://api.github.com/users/petercdc/events{/privacy}","received_events_url":"https://api.github.com/users/petercdc/received_events","type":"User","site_admin":false},"repo":{"id":37303212,"name":"phoenix","full_name":"petercdc/phoenix","owner":{"login":"petercdc","id":12855669,"avatar_url":"https://avatars.githubusercontent.com/u/12855669?v=3","gravatar_id":"","url":"https://api.github.com/users/petercdc","html_url":"https://github.com/petercdc","followers_url":"https://api.github.com/users/petercdc/followers","following_url":"https://api.github.com/users/petercdc/following{/other_user}","gists_url":"https://api.github.com/users/petercdc/gists{/gist_id}","starred_url":"https://api.github.com/users/petercdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petercdc/subscriptions","organizations_url":"https://api.github.com/users/petercdc/orgs","repos_url":"https://api.github.com/users/petercdc/repos","events_url":"https://api.github.com/users/petercdc/events{/privacy}","received_events_url":"https://api.github.com/users/petercdc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petercdc/phoenix","description":"Mirror of Apache Phoenix","fork":true,"url":"https://api.github.com/repos/petercdc/phoenix","forks_url":"https://api.github.com/repos/petercdc/phoenix/forks","keys_url":"https://api.github.com/repos/petercdc/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petercdc/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petercdc/phoenix/teams","hooks_url":"https://api.github.com/repos/petercdc/phoenix/hooks","issue_events_url":"https://api.github.com/repos/petercdc/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/petercdc/phoenix/events","assignees_url":"https://api.github.com/repos/petercdc/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/petercdc/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/petercdc/phoenix/tags","blobs_url":"https://api.github.com/repos/petercdc/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petercdc/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petercdc/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/petercdc/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petercdc/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/petercdc/phoenix/languages","stargazers_url":"https://api.github.com/repos/petercdc/phoenix/stargazers","contributors_url":"https://api.github.com/repos/petercdc/phoenix/contributors","subscribers_url":"https://api.github.com/repos/petercdc/phoenix/subscribers","subscription_url":"https://api.github.com/repos/petercdc/phoenix/subscription","commits_url":"https://api.github.com/repos/petercdc/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/petercdc/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/petercdc/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/petercdc/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/petercdc/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/petercdc/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petercdc/phoenix/merges","archive_url":"https://api.github.com/repos/petercdc/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petercdc/phoenix/downloads","issues_url":"https://api.github.com/repos/petercdc/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/petercdc/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/petercdc/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/petercdc/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petercdc/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/petercdc/phoenix/releases{/id}","created_at":"2015-06-12T05:10:26Z","updated_at":"2015-06-12T05:10:30Z","pushed_at":"2015-07-13T12:22:41Z","git_url":"git://github.com/petercdc/phoenix.git","ssh_url":"git@github.com:petercdc/phoenix.git","clone_url":"https://github.com/petercdc/phoenix.git","svn_url":"https://github.com/petercdc/phoenix","homepage":null,"size":15646,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:json","ref":"json","sha":"6ee28a5e25154556140c751c3040d9144cd86f67","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":20473418,"name":"phoenix","full_name":"apache/phoenix","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/phoenix","description":"Mirror of Apache Phoenix","fork":false,"url":"https://api.github.com/repos/apache/phoenix","forks_url":"https://api.github.com/repos/apache/phoenix/forks","keys_url":"https://api.github.com/repos/apache/phoenix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/phoenix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/phoenix/teams","hooks_url":"https://api.github.com/repos/apache/phoenix/hooks","issue_events_url":"https://api.github.com/repos/apache/phoenix/issues/events{/number}","events_url":"https://api.github.com/repos/apache/phoenix/events","assignees_url":"https://api.github.com/repos/apache/phoenix/assignees{/user}","branches_url":"https://api.github.com/repos/apache/phoenix/branches{/branch}","tags_url":"https://api.github.com/repos/apache/phoenix/tags","blobs_url":"https://api.github.com/repos/apache/phoenix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/phoenix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/phoenix/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/phoenix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/phoenix/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/phoenix/languages","stargazers_url":"https://api.github.com/repos/apache/phoenix/stargazers","contributors_url":"https://api.github.com/repos/apache/phoenix/contributors","subscribers_url":"https://api.github.com/repos/apache/phoenix/subscribers","subscription_url":"https://api.github.com/repos/apache/phoenix/subscription","commits_url":"https://api.github.com/repos/apache/phoenix/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/phoenix/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/phoenix/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/phoenix/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/phoenix/contents/{+path}","compare_url":"https://api.github.com/repos/apache/phoenix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/phoenix/merges","archive_url":"https://api.github.com/repos/apache/phoenix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/phoenix/downloads","issues_url":"https://api.github.com/repos/apache/phoenix/issues{/number}","pulls_url":"https://api.github.com/repos/apache/phoenix/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/phoenix/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/phoenix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/phoenix/labels{/name}","releases_url":"https://api.github.com/repos/apache/phoenix/releases{/id}","created_at":"2014-06-04T07:00:08Z","updated_at":"2015-07-22T03:44:56Z","pushed_at":"2015-07-24T18:56:00Z","git_url":"git://github.com/apache/phoenix.git","ssh_url":"git@github.com:apache/phoenix.git","clone_url":"https://github.com/apache/phoenix.git","svn_url":"https://github.com/apache/phoenix","homepage":null,"size":34137,"stargazers_count":83,"watchers_count":83,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":155,"mirror_url":"git://git.apache.org/phoenix.git","open_issues_count":57,"forks":155,"open_issues":57,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/phoenix/pulls/101"},"html":{"href":"https://github.com/apache/phoenix/pull/101"},"issue":{"href":"https://api.github.com/repos/apache/phoenix/issues/101"},"comments":{"href":"https://api.github.com/repos/apache/phoenix/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/phoenix/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/phoenix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/phoenix/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/apache/phoenix/statuses/fd4604cbb799600a87da0647671e8dbad6a8c6a7"}}}}