Hikamare opened a new issue, #14088:
URL: https://github.com/apache/druid/issues/14088

   ### Affected Version
   
   The Druid version where the problem was encountered: 25.0.0
   
   ### Description
   
   When doing a series of group by queries I have noticed that having more than 
one nested group by query results in data from join to be "lost".
   
   Given the following query:
   ```json
   {
       "queryType": "groupBy",
       "dimensions": ["related_object_id", "r.category_id"],
       "dataSource":
       {
           "type": "query",
           "query":
           {
               "queryType": "groupBy",
               "dimensions": ["related_object_id","r.category_id"],
               "intervals": "2020-03-20/2020-03-21",
               "dataSource":
               {
                   "type": "join",
                   "left":
                   {
                       "type": "inline",
                       "name": "DRUID_INLINE_DATASOURCE",
                       "columnNames":
                       [
                           "__time",
                           "related_object_id"
                       ],
                       "rows":
                       [
                           [1584662400000,"3229"],
                           [1584662400000,"4510"]
                       ]
                   },
                   "right":
                   {
                       "type": "inline",
                       "columnNames":
                       ["related_object_id","category_id"],
                       "rows":
                       [
                           ["3229", 2985],
                           ["4510", 2985]
                       ]
                   },
                   "rightPrefix": "r.",
                   "condition": "related_object_id == \"r.related_object_id\"",
                   "joinType": "LEFT"
               },
               "granularity": "day",
               "filter":
               {
                   "type": "in",
                   "dimension": "related_object_id",
                   "values":
                   [
                       "3229",
                       "4510"
                   ]
               }
           }
       },
       "intervals": "2020-03-20/2020-03-21",
       "granularity": "all",
       "aggregations":
       [],
       "postAggregations":
       []
   }
   ```
   
   **Expected results** (works with Druid 24.0.0):
   | related_object_id | r.category_id |
   | ------------------------|-----------------|
   | 3229 | 2985 |
   | 4510 | 2985 |
   
   **Results** per Druid 25.0.0:
   | related_object_id | r.category_id |
   | ------------------------|-----------------|
   | 3229 | _null_ |
   | 4510 | _null_ |
   
   Furthermore, querying just the inner query:
   ```json
   {
        "queryType": "groupBy",
        "dimensions": [
                "related_object_id",
                "r.category_id"
        ],
        "intervals": "2020-03-20/2020-03-21",
        "dataSource": {
                "type": "join",
                "left": {
                        "type": "inline",
                        "name": "DRUID_INLINE_DATASOURCE",
                        "columnNames": [
                                "__time",
                                "collection_time",
                                "related_object_id",
                                "comments"
                        ],
                        "rows": [
                                [
                                        1584662400000,
                                        1584662400000,
                                        "3229",
                                        10
                                ],
                                [
                                        1584662400000,
                                        1584662400000,
                                        "4510",
                                        20
                                ]
                        ]
                },
                "right": {
                        "type": "inline",
                        "columnNames": [
                                "related_object_id",
                                "category_id"
                        ],
                        "rows": [
                                [
                                        "3229",
                                        2985
                                ],
                                [
                                        "4510",
                                        2985
                                ]
                        ]
                },
                "rightPrefix": "r.",
                "condition": "related_object_id == \"r.related_object_id\"",
                "joinType": "LEFT"
        },
        "granularity": "day",
        "filter": {
                "type": "in",
                "dimension": "related_object_id",
                "values": [
                        "3229",
                        "4510"
                ]
        }
   }
   ```
   
   Yields the correct and expected results continuously. 
   ```


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