walterddr commented on a change in pull request #7485: URL: https://github.com/apache/pinot/pull/7485#discussion_r716050726
########## File path: pinot-core/src/test/java/org/apache/pinot/core/data/function/InbuiltFunctionEvaluatorTest.java ########## @@ -120,10 +128,27 @@ public void testStateSharedBetweenRowsForExecution() assertEquals(evaluator.evaluate(row), "test test test "); } + @Test + public void testExceptionDuringInbuiltFunctionEvaluator() + throws Exception { + String expression = "fromDateTime('2020-01-01T00:00:00Z', \"invalid_identifier\")"; + InbuiltFunctionEvaluator evaluator = new InbuiltFunctionEvaluator(expression); + assertEquals(1, evaluator.getArguments().size()); + GenericRow row = new GenericRow(); + try { + evaluator.evaluate(row); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RuntimeException); + assertTrue(e.getCause() instanceof IllegalStateException); + } + } + private static class MyFunc { String _baseString = ""; String appendToStringAndReturn(String addedString) { + Preconditions.checkNotNull(addedString); Review comment: yeah sorry I was planning to use MyFunc, will revert this -- 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. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org