FrankChen021 commented on issue #11659:
URL: https://github.com/apache/druid/issues/11659#issuecomment-913269302


   I checked these two functions on user data source, they didn't work too. The 
exception shows 'Cannot create aggregator factory for type[STRING]', and the 
stack trace shows as follows.
   
   ```
   2021-09-06T01:10:26,329 WARN [sql[fb0c9409-8643-46c7-ac1f-ea1ef07b96e7]] 
org.apache.druid.sql.http.SqlResource - Failed to handle query: 
SqlQuery{query='SELECT
     
     min("user")
   FROM wikipedia
   ', resultFormat=array, header=true, context={sqlOuterLimit=101}, 
parameters=[]}
   java.lang.RuntimeException: Error while applying rule 
DruidQueryRule(AGGREGATE), args 
[rel#2586:LogicalAggregate.NONE.[](input=RelSubset#2577,group={},EXPR$0=MIN($19)),
 
rel#2587:DruidQueryRel.NONE.[](query={"queryType":"scan","dataSource":{"type":"table","name":"wikipedia"},"intervals":{"type":"intervals","intervals":["-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"]},"virtualColumns":[],"resultFormat":"compactedList","batchSize":20480,"order":"none","filter":null,"columns":["__time","added","channel","cityName","comment","countryIsoCode","countryName","deleted","delta","isAnonymous","isMinor","isNew","isRobot","isUnpatrolled","metroCode","namespace","page","regionIsoCode","regionName","user"],"legacy":false,"context":{"sqlOuterLimit":101,"sqlQueryId":"fb0c9409-8643-46c7-ac1f-ea1ef07b96e7"},"descending":false,"granularity":{"type":"all"}},signature={__time:LONG,
 added:LONG, channel:STRING, cityName:STRING, comment:STRING, 
countryIsoCode:STRING, countryName:STRING, de
 leted:LONG, delta:LONG, isAnonymous:STRING, isMinor:STRING, isNew:STRING, 
isRobot:STRING, isUnpatrolled:STRING, metroCode:STRING, namespace:STRING, 
page:STRING, regionIsoCode:STRING, regionName:STRING, user:STRING})]
        at 
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:235)
 ~[calcite-core-1.21.0.jar:1.21.0]
        at 
org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:631)
 ~[calcite-core-1.21.0.jar:1.21.0]
        at 
org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:327) 
~[calcite-core-1.21.0.jar:1.21.0]
        at 
org.apache.calcite.tools.Programs$SequenceProgram.run(Programs.java:346) 
~[calcite-core-1.21.0.jar:1.21.0]
        at 
org.apache.calcite.prepare.PlannerImpl.transform(PlannerImpl.java:357) 
~[calcite-core-1.21.0.jar:1.21.0]
        at 
org.apache.druid.sql.calcite.planner.DruidPlanner.planWithDruidConvention(DruidPlanner.java:243)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.planner.DruidPlanner.plan(DruidPlanner.java:186) 
~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at org.apache.druid.sql.SqlLifecycle.plan(SqlLifecycle.java:313) 
~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at org.apache.druid.sql.http.SqlResource.doPost(SqlResource.java:101) 
~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) ~[?:?]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_292-internal]
        at java.lang.reflect.Method.invoke(Method.java:498) 
~[?:1.8.0_292-internal]
        at 
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
 ~[jersey-server-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
 ~[jersey-servlet-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
 ~[jersey-servlet-1.19.3.jar:1.19.3]
        at 
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)
 ~[jersey-servlet-1.19.3.jar:1.19.3]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 
~[javax.servlet-api-3.1.0.jar:3.1.0]
        at 
com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
 ~[guice-servlet-4.1.0.jar:?]
        at 
com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
 ~[guice-servlet-4.1.0.jar:?]
        at 
com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181) 
~[guice-servlet-4.1.0.jar:?]
        at 
com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
 ~[guice-servlet-4.1.0.jar:?]
        at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
 ~[guice-servlet-4.1.0.jar:?]
        at 
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
 ~[guice-servlet-4.1.0.jar:?]
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135) 
~[guice-servlet-4.1.0.jar:?]
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
 ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.apache.druid.server.security.PreResponseAuthorizationCheckFilter.doFilter(PreResponseAuthorizationCheckFilter.java:82)
 ~[druid-server-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
 ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.apache.druid.server.security.AllowHttpMethodsResourceFilter.doFilter(AllowHttpMethodsResourceFilter.java:78)
 ~[druid-server-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
 ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.apache.druid.server.security.AllowOptionsResourceFilter.doFilter(AllowOptionsResourceFilter.java:75)
 ~[druid-server-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
 ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.apache.druid.server.security.AllowAllAuthenticator$1.doFilter(AllowAllAuthenticator.java:84)
 ~[druid-server-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.server.security.AuthenticationWrappingFilter.doFilter(AuthenticationWrappingFilter.java:59)
 ~[druid-server-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
 ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.apache.druid.server.security.SecuritySanityCheckFilter.doFilter(SecuritySanityCheckFilter.java:77)
 ~[druid-server-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601)
 ~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1435)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) 
~[jetty-servlet-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1350)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) 
~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:763) 
~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59) 
~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:179)
 ~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) 
~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.server.Server.handle(Server.java:516) 
~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) 
~[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) 
[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) 
[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) 
[jetty-server-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
 [jetty-io-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) 
[jetty-io-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) 
[jetty-io-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:383)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:882)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1036)
 [jetty-util-9.4.40.v20210413.jar:9.4.40.v20210413]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292-internal]
   Caused by: org.apache.druid.java.util.common.ISE: Cannot create aggregator 
factory for type[STRING]
        at 
org.apache.druid.sql.calcite.aggregation.builtin.MinSqlAggregator.createMinAggregatorFactory(MinSqlAggregator.java:72)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.aggregation.builtin.MinSqlAggregator.getAggregation(MinSqlAggregator.java:53)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.aggregation.builtin.SimpleSqlAggregator.toDruidAggregation(SimpleSqlAggregator.java:91)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rule.GroupByRules.translateAggregateCall(GroupByRules.java:130)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.DruidQuery.computeAggregations(DruidQuery.java:498)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.DruidQuery.computeGrouping(DruidQuery.java:326)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.DruidQuery.fromPartialQuery(DruidQuery.java:194)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.PartialDruidQuery.build(PartialDruidQuery.java:307)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.DruidQueryRel.toDruidQuery(DruidQueryRel.java:105)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.DruidQueryRel.toDruidQueryForExplaining(DruidQueryRel.java:117)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rel.DruidRel.isValidDruidQuery(DruidRel.java:55) 
~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.druid.sql.calcite.rule.DruidRules$DruidQueryRule.onMatch(DruidRules.java:137)
 ~[druid-sql-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
        at 
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:208)
 ~[calcite-core-1.21.0.jar:1.21.0]
   ```


-- 
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