Jackie-Jiang commented on code in PR #15483:
URL: https://github.com/apache/pinot/pull/15483#discussion_r2033972227


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/function/GroovyFunctionEvaluator.java:
##########
@@ -83,7 +83,12 @@ public GroovyFunctionEvaluator(String closure) {
     _numArguments = _arguments.size();
     _binding = new Binding();
     String scriptText = matcher.group(SCRIPT_GROUP_NAME);
-    _script = createSafeShell(_binding).parse(scriptText);
+    try {
+      _script = createSafeShell(_binding).parse(scriptText);
+    } catch (Exception e) {
+      LOGGER.error("Groovy compilation error: " + closure, e);

Review Comment:
   We don't usually log error if exception is thrown out, especially for user 
error



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/function/FunctionEvaluatorFactory.java:
##########
@@ -62,7 +62,7 @@ public static FunctionEvaluator 
getExpressionEvaluator(FieldSpec fieldSpec) {
       } catch (Exception e) {
         throw new IllegalStateException(
             "Caught exception while constructing expression evaluator for 
transform expression:" + transformExpression
-                + ", of column:" + columnName);
+                + ", of column:" + columnName + e.getMessage(), e);

Review Comment:
   ```suggestion
                   + ", of column: " + columnName + ", exception: " + 
e.getMessage(), e);
   ```



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -538,7 +538,8 @@ public static void validateIngestionConfig(TableConfig 
tableConfig, Schema schem
             expressionEvaluator = 
FunctionEvaluatorFactory.getExpressionEvaluator(transformFunction);
           } catch (Exception e) {
             throw new IllegalStateException(
-                "Invalid transform function '" + transformFunction + "' for 
column '" + columnName + "'", e);
+                "Invalid transform function '" + transformFunction + "' for 
column '" + columnName
+                    + "'" + e.getMessage(), e);

Review Comment:
   ```suggestion
                       + "', exception: " + e.getMessage(), e);
   ```



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -377,7 +377,7 @@ public static void validateIngestionConfig(TableConfig 
tableConfig, Schema schem
           try {
             FunctionEvaluatorFactory.getExpressionEvaluator(filterFunction);
           } catch (Exception e) {
-            throw new IllegalStateException("Invalid filter function " + 
filterFunction, e);
+            throw new IllegalStateException("Invalid filter function " + 
filterFunction + e.getMessage(), e);

Review Comment:
   ```suggestion
               throw new IllegalStateException("Invalid filter function: " + 
filterFunction + ", exception: " + e.getMessage(), e);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to