dang-stripe commented on issue #15121:
URL: https://github.com/apache/pinot/issues/15121#issuecomment-2702270791

   Here's the smaller version of the query that reproduces it. The window 
function isn't necessary.
   
   ```
   WITH "simple_data" AS (
     SELECT "user_id",
       "value",
       "date"
     FROM "events_table"
     WHERE "account_id" = 'acct_sample123'
     LIMIT 500
   )
   SELECT "date",
     SUM(
       CASE
         WHEN "value" > 0 THEN 1
         ELSE 0
       END
     ) AS "count_positive"
   FROM "simple_data"
   GROUP BY 1
   LIMIT 10
   ```
   
   Explain plan
   ```
   Execution Plan
   LogicalSort(offset=[0], fetch=[10])
     PinotLogicalSortExchange(distribution=[hash], collation=[[]], 
isSortOnSender=[false], isSortOnReceiver=[false])
       LogicalSort(fetch=[10])
         PinotLogicalAggregate(group=[{0}], agg#0=[COUNT($1)])
           PinotLogicalExchange(distribution=[hash[0]])
             PinotLogicalAggregate(group=[{0}], agg#0=[COUNT() FILTER $1])
               LogicalProject(date=[$1], $f2=[>($0, 0)])
                 LogicalSort(offset=[0], fetch=[500])
                   PinotLogicalSortExchange(distribution=[hash], 
collation=[[]], isSortOnSender=[false], isSortOnReceiver=[false])
                     LogicalSort(fetch=[500])
                       LogicalProject(value=[$12], date=[$9])
                         LogicalFilter(condition=[=($3, 
_UTF-8'acct_sample123')])
                           LogicalTableScan(table=[[default, events_table]])
   ```


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

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

Reply via email to