Slackbot
11/06/2023, 12:29 PMJohn Kowtko
11/06/2023, 8:35 PMSwapnil Jokhakar
11/07/2023, 7:37 AMError: Resource limit exceeded exception. Currently TableA contains > 92 billion records and TableB contains > 1.5 million records and this will keep getting increased in future. So, considering the data volume of these two tables this approach does not look feasible to me.
• Could you please share your thoughts on this and suggest what can be done to fix this resource limit error without adding more performance overhead on the Druid cluster?
• Approach 3: Create 4 Druid Lookups to store 4 value fields and use these 4 Druid Looups in Druid query to fetch the data form TableA.
◦ For one Lookup, it will have 1:M relationship between key and the value field. With the following sample records, I am able to create the Druid Lookup but the generated Lookup is not storing all the records including key, values with 1:M relationship and just stores the last record with key, value combination. Could you please let me know whether is it possible to create a Druid Lookup with 1:M relation between key, value fields?
{
"1", "101",
"1", "102",
"2", "103",
"2", "104",
"3", "105"
}
Thanks.John Kowtko
11/07/2023, 1:05 PMresource limit exceeded error -- check maxSubQueryRows ... I think the default is 100k, but I've heard of it being bumped up to 1-2m and not running out of memory. Since this table is relatively slim that might be okay. However if Table B's size is going to increase in the future, then consider using MSQ SQL instead as it should not have this limit if you use sortMerge as the join method and the limit will not apply anymore: https://druid.apache.org/docs/latest/multi-stage-query/reference#sort-merge
For 1:M -- I do not think lookup tables support non-unique keys -- either it won't be allowed at ingest time, or at query time can produce erratic results. Someone else should clarify this.
Thanks. JohnSergio Ferragut
11/07/2023, 8:49 PMmaxSubQueryRows this means that the 1.5 million rows will be broadcast to each historical and each peon task involved in the query and be placed in their heap to then resolve the join. Depending on how many historicals/peons are involved this can be a significant data movement. This is why the default for this limit is smaller. With Druid 27.0 there is the alternative of maxSubQueryBytes instead of rows such that you are controlling the memory footprint of these join operations.
Have you considered approach X - pre-joining that data?
If the lookup data is static or its value at ingestion time is good for the analytics you want...(i.e. in retail analytics marital_status is useful to keep as it was at the time of the event).
While pre-joining uses more space, it can be a great tool for accelerating performance.
If you want to learn a lot more about how joins are processed in Druid, I recommend https://github.com/implydata/learn-druid. Have a look at the joins notebook <- this link will work once you have started the environment locally.Swapnil Jokhakar
11/17/2023, 3:19 PM"sqlJoinAlgorithm": "sortMerge" in query context with left join between TableA (with 88,000 records) and TableB (13,973 records) and the query was failed with the same Error: Resource limit exceeded Subquery generated results beyond maximum[100000] exception. Could you please let me know if I am doing something wrong here?Sergio Ferragut
11/17/2023, 6:16 PMSwapnil Jokhakar
11/20/2023, 9:18 AMSergio Ferragut
11/20/2023, 5:29 PMSwapnil Jokhakar
11/28/2023, 9:28 AMJohn Kowtko
11/28/2023, 4:43 PM"druid-multi-stage-query" to the Druid loadlist in the common.properties file and see if it shows up, as in the screenshot that Sergio posted.
Thanks. JohnSergio Ferragut
11/28/2023, 7:22 PMsimon mikolajek
12/19/2023, 11:02 AM