minwoo-jung opened a new issue, #12224: URL: https://github.com/apache/pinot/issues/12224
Hi, I am an open source [APM pinpoint](https://github.com/pinpoint-apm/pinpoint) developer. We are applying pinot to pinpoint and using it well to analyze our monitoring data. We will continue to actively use it a lot in the future. I am writing this because I have a problem while using the new features in 1.0.0. ## Problem I upgraded pinot to 1.0.0 to use the EXPR_MIN and EXPR_MAX functions. - [guide doc](https://docs.pinot.apache.org/configuration-reference/functions/arg_min-arg_max) I executed a very simple query in the console view of the controller and got the following error message. ``` SELECT EXPR_MAX(hostName, fieldValue, hostName) FROM systemMetricDouble ``` ``` Error Code: 200 QueryExecutionError: Query execution error on: PINOT_SERVER_COMPONENT_NAME_8098 org.apache.pinot.spi.exception.BadQueryRequestException: Invalid aggregation function: exprmax(hostName,fieldValue,hostName); Reason: Aggregation function: exprmax(hostName,fieldValue,hostName) is only supported in selection without alias. ``` -  Here is the code location where the problem occurred - https://github.com/apache/pinot/blob/b6bdf6c9686b286a149d2d1aea4a385ee98f3e79/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/AggregationFunctionFactory.java#L353 ## Analysis - After analyzing the problem, I realized that if you use EXPR_MIN and EXPR_MAX in the query, pinot changes the query to CHILD_EXPR_MIN and PARENT_EXPR_MIN. - [Reference test code](https://github.com/apache/pinot/blob/master/pinot-common/src/test/java/org/apache/pinot/sql/parsers/rewriter/ExprMinMaxRewriterTest.java) - The problem is that EXPR_MIN and EXPR_MAX are not changed through ExprMinMaxRewriter and passed to the server, so an exception is expected. - So do I need to do anything extra to make ExprMinMaxRewriter work, is there an option I need to add to enable it? - Analyzing the code, I think I need to add a value to the pinot.broker.query.rewriter.class.names setting. Do I need to add a separate setting to use EXPR_MIN, EXPR_MAX? - [ref BaseBrokerStarter code](https://github.com/apache/pinot/blob/a0a9b6bca6f07a4d490f41effe354b2616747697/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BaseBrokerStarter.java#L279) - There is nothing in the documentation about what you need to do to use EXPR_MIN and EXPR_MAX. - [guide doc](https://docs.pinot.apache.org/configuration-reference/functions/arg_min-arg_max) ## Conclusion&Question - I want to use EXPR_MIN and EXPR_MAX, but I get an error and it doesn't work. - Please let me know if there is any configuration or action required to use the feature. - If I need to add the pinot.broker.query.rewriter.class.names setting, do I need to add the following settings as well? For reference, I am running/deploying pinot through helm chart. - pinot.broker.result.rewriter.class.names - pinot.server.query.rewriter.class.names - pinot.controller.query.rewriter.class.names - pinot.minion.query.rewriter.class.names - If there are any settings you need to add, please let us know along with the key and value. - If I need to add pinot.broker.query.rewriter.class.names, where can I put the setting? -- 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.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