BELUGABEHR commented on a change in pull request #530: HIVE-21240: JSON SerDe
Deserialize Re-Write
URL: https://github.com/apache/hive/pull/530#discussion_r277296726
##########
File path:
ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFJsonRead.java
##########
@@ -156,10 +158,8 @@ public void testUndeclaredStructField() throws Exception {
ObjectInspector[] arguments = buildArguments("struct<a:int>");
udf.initialize(arguments);
- Object res = udf.evaluate(evalArgs("{\"b\":null}"));
- assertTrue(res instanceof Object[]);
- Object o[] = (Object[]) res;
- assertEquals(null, o[0]);
+ // Invalid - should throw Exception
+ udf.evaluate(evalArgs("{\"b\":null}"));
Review comment:
Good question.
If you checkout the test method, it is annotated with `@Test(expected =
HiveException.class)`. This means that the test will fail if it does not
throw a HiveException. What causes it to throw the Exception is the call to
`udf.evaluate(evalArgs("{\"b\":null}"))` therefore, everything that comes
after it is dead code, so I simply removed it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]