This message was deleted.
# troubleshooting
s
This message was deleted.
đź‘€ 1
l
Tried running this query on the latest master (whose behavior should be similar to the upcoming 24.0.0 release) and it shows the desired result for me. I will checkout the behavior in 0.22.1 as well.
s
i tried on 0.23.0 also , seeing same error SELECT LATEST(channel,10),cityName FROM "wikipedia" WHERE (comment IN( 'added project') ) and (comment NOT IN ('added project' )) GROUP BY cityName
l
Able to reproduce the issue on a 0.22.1 cluster. Unfortunately I was running into some troubles while trying to run the cluster from IDE (due to some newer artefacts not being cleaned up) therefore I wasn’t able to debug it thoroughly. But from what it seems, the issue is due to incorrect parsing of the SQL query in the broker. Will try to run it on 0.23.0 as well.
I was thinking https://github.com/apache/druid/pull/11949, might have fixed it in the later versions, however since this commit is pre 0.23.0 I might be incorrect. Hopefully I am able to debug that one. In any case, once 24.0.0 is out, upgrade to that should help alleviate this problem.
s
Thanks @Laksh Singla Any idea when 0.24 will be out? Some fix would help for 0.22 or 0.23
l
No idea on an exact date, but it shouldn’t be long since AFAIK the release process for the same has started.
A temp workaround can be to run the native version of the query in 0.22.1/0.23.0. I will try to figure out the patch where it might have been fixed.
s
Thanks @Laksh Singla
a
24.0 will be out this week
s
Hi Team With druid 24.0 also this issue is reproducible however on 0.21.1 this query paases @Laksh Singla can you please let me know what steps you are following to not get the issue getting the following stacktrace for this query SELECT LATEST(channel,10),cityName FROM "wikipedia" WHERE (comment IN( 'added project') ) and (comment NOT IN ('added project' )) GROUP BY cityName 2022-09-19T051700,916 WARN [sql[4e54d4ab-e32b-4ec2-88b1-a1b8f7dd505b]] org.apache.druid.sql.http.SqlResource - Failed to handle query: SqlQuery{query='SELECT LATEST(channel,10),cityName FROM "wikipedia" WHERE (comment IN( 'added project') ) and (comment NOT IN ('added project' )) GROUP BY cityName', resultFormat=array, header=true, typesHeader=true, sqlTypesHeader=true, context={sqlOuterLimit=1001, sqlQueryId=4e54d4ab-e32b-4ec2-88b1-a1b8f7dd505b}, parameters=[]} java.lang.AssertionError: not a literal: $2 at org.apache.calcite.rex.RexLiteral.findValue(RexLiteral.java:1124) ~[calcite-core-1.21.0.jar:1.21.0] at org.apache.calcite.rex.RexLiteral.intValue(RexLiteral.java:1099) ~[calcite-core-1.21.0.jar:1.21.0] at org.apache.druid.sql.calcite.aggregation.builtin.EarliestLatestAnySqlAggregator.toDruidAggregation(EarliestLatestAnySqlAggregator.java:210) ~[druid-sql-24.0.0.jar:24.0.0] at org.apache.druid.sql.calcite.rule.GroupByRules.translateAggregateCall(GroupByRules.java:130) ~[druid-sql-24.0.0.jar:24.0.0]
l
🤔 Thanks for trying it out in the latest Druid version. Last I tried, it did work on the master build. I will test it out again later in the day. Can you also please share if you are setting any flags in the query context. (They are visible in the ST above)
s
Hi Laksh.. thanks for the quick reply i am not giving any specific settings in query context.
Updated in git issues also I think this change is causing the issue i found this when checking the druid code hope this is helpful In DruidPlanner.java -> plan() we have 2 functions planWithDruidConvention() -> this is for normal tables/datasources planWithBindableConvention() -> this is for bindable tables i.e. metadata table
SELECT LATEST(channel,10),cityName FROM "wikipedia" WHERE (comment IN( 'added project') ) and (comment NOT IN ('added project' )) GROUP BY cityName
for the above query In 0.21.1 • the plan fails in planWithDruidConvention() with the follwoing exception and goes to planWithBindableConvention() as a fallback
org.apache.calcite.plan.RelOptPlanner$CannotPlanException: There are not enough rules to produce a node with desired properties: convention=DRUID, sort=[].
In 24.0 • I can see changes in decision path(
if (!bindableTables.isEmpty()) { }
). • the plan goes to planWithDruidConvention() and it fails , there is no fallback
l
This is the output on my latest debug version. While it’s not exactly 24.0.0, it’s behavior should be similar
Thanks for debugging the issue. IMO planWithDruidConvention should not fail in the first part. I think the issue that we are seeing is in the aggregator and how it picks up the second parameter in the Latest/Earliest function.
s
@Laksh Singla in 24.0 released version.. the issue is reproducible… right?
Do you have some changes in code in your debug environment? Can that be released as a minor
l
I don’t have any changes pertaining to this in my env. Let me try to reproduce it in 24.0.0. Wondering if it could be due to a certain config set in my IDE. Are you running any custom configs or are they same as the quickstart?
s
Same as quick start Just inserting the wikipedia datasource then running the query
Is there any luck on this issue?
l
Hey, I didn’t get around to it after our last exchange. Apologies for the late response. Thanks for updating the Github Issue with the findings, will take a look at it in sometime.
🆒 1