Github user vdiravka commented on a diff in the pull request:

    https://github.com/apache/drill/pull/431#discussion_r56645171
  
    --- Diff: 
contrib/storage-hive/core/src/test/java/org/apache/drill/exec/fn/hive/TestInbuiltHiveUDFs.java
 ---
    @@ -43,4 +47,17 @@ public void testEncode() throws Exception {
             .baselineValues(new Object[] { null })
             .go();
       }
    +
    +   @Test // DRILL-4459
    +   public void testGetJsonObject() throws Exception {
    +        setColumnWidths(new int[]{260});
    +        String query = "select * from hive.simple_json where 
GET_JSON_OBJECT(simple_json.json, '$.DocId') = 'DocId2'";
    +        List<QueryDataBatch> results = testSqlWithResults(query);
    +        String expected = "json\n" + 
"{\"DocId\":\"DocId2\",\"User\":{\"Id\":122,\"Username\":\"larry122\",\"Name\":"
 +
    --- End diff --
    
    I've led this test to a common design. Thanks.
    @Test // DRILL-4459
        public void testGetJsonObject() throws Exception {
            testBuilder()
                .sqlQuery("select convert_from(json, 'json') as json from 
hive.simple_json " +
                    "where GET_JSON_OBJECT(simple_json.json, '$.employee_id') = 
'Emp2'")
                .ordered()
                .baselineColumns("json")
    
.baselineValues(mapOf("employee_id","2","full_name","Kamesh","first_name","Bh","last_name","Venkata","position","Store"))
                .go();
        }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to