walterddr commented on a change in pull request #7485: URL: https://github.com/apache/pinot/pull/7485#discussion_r717009179
########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/function/InbuiltFunctionEvaluator.java ########## @@ -112,22 +113,37 @@ public Object evaluate(Object[] values) { @Override public Object execute(GenericRow row) { - int numArguments = _argumentNodes.length; - for (int i = 0; i < numArguments; i++) { - _arguments[i] = _argumentNodes[i].execute(row); + try { + int numArguments = _argumentNodes.length; + for (int i = 0; i < numArguments; i++) { + _arguments[i] = _argumentNodes[i].execute(row); + } + _functionInvoker.convertTypes(_arguments); + return _functionInvoker.invoke(_arguments); + } catch (Exception e) { + throw new RuntimeException( + "Caught exception while executing function: " + this, e); Review comment: ```suggestion throw new RuntimeException("Caught exception while executing function: " + this, e); ``` ########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/function/InbuiltFunctionEvaluator.java ########## @@ -112,22 +113,37 @@ public Object evaluate(Object[] values) { @Override public Object execute(GenericRow row) { - int numArguments = _argumentNodes.length; - for (int i = 0; i < numArguments; i++) { - _arguments[i] = _argumentNodes[i].execute(row); + try { + int numArguments = _argumentNodes.length; + for (int i = 0; i < numArguments; i++) { + _arguments[i] = _argumentNodes[i].execute(row); + } + _functionInvoker.convertTypes(_arguments); + return _functionInvoker.invoke(_arguments); + } catch (Exception e) { + throw new RuntimeException( + "Caught exception while executing function: " + this, e); } - _functionInvoker.convertTypes(_arguments); - return _functionInvoker.invoke(_arguments); } @Override public Object execute(Object[] values) { - int numArguments = _argumentNodes.length; - for (int i = 0; i < numArguments; i++) { - _arguments[i] = _argumentNodes[i].execute(values); + try { + int numArguments = _argumentNodes.length; + for (int i = 0; i < numArguments; i++) { + _arguments[i] = _argumentNodes[i].execute(values); + } + _functionInvoker.convertTypes(_arguments); + return _functionInvoker.invoke(_arguments); + } catch (Exception e) { + throw new RuntimeException( + "Caught exception while executing function: " + this, e); Review comment: ```suggestion throw new RuntimeException("Caught exception while executing function: " + this, e); ``` ########## File path: pinot-core/src/test/java/org/apache/pinot/core/data/function/InbuiltFunctionEvaluatorTest.java ########## @@ -26,6 +26,7 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; +import static org.testng.AssertJUnit.fail; Review comment: sounds good although we should really do these automatically. not a great use of any committer's time :-) -- 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