adnanhamdussalam opened a new issue, #1900:
URL: https://github.com/apache/cloudberry/issues/1900

   Hi,
   
   I am facing segmentation fault on below query: 
   
   create table applied_ai_dev.vm_revenue_report_movers_crm as^M
   with max_date as (^M
           select max(call_date)::date as max_call_date from 
applied_ai_afiniti.vm_vaca_rollup^M
   ), cte as (^M
   SELECT call_date AS date, 'CableMovers' as aggregation_type,^M
           queue_ucic as dispsplit,^M
           sum(case WHEN on_off = 1 THEN 1 ELSE NULL::integer END) AS 
on_calls,^M
           sum(case WHEN on_off = 0 THEN 1 ELSE NULL::integer END) AS 
off_calls,^M
           sum(case WHEN on_off = 1 then delta_metric_movers ELSE NULL::numeric 
END) AS on_cancels,^M
           sum(case WHEN on_off = 0 then delta_metric_movers ELSE NULL::numeric 
END) AS off_cancels^M
   FROM applied_ai_afiniti.vm_vaca_rollup^M
   WHERE queue_ucic::text = 'CableMovers'^M
           and call_date >= (select max(call_date)::date - 185 from 
applied_ai_afiniti.vm_vaca_rollup)^M
   GROUP BY 1,2,3^M
   ), cte1 as (^M
   select *,^M
           round(on_calls::numeric/nullif(on_calls + off_calls,0)*100,2) as 
on_perc,^M
           (on_cancels/NULLIF(on_calls, 0)::numeric - off_cancels / 
NULLIF(off_calls, 0)::numeric)*on_calls::numeric AS inc_otc^M
   from cte^M
   ),cte2 as
   
   
   \dSt applied_ai_afiniti.vm_vaca_rollup
                              Table "applied_ai_afiniti.vm_vaca_rollup"
                Column             |            Type             | Collation | 
Nullable | Default
   
--------------------------------+-----------------------------+-----------+----------+---------
    engineid                       | text                        |           |  
        |
    programid                      | text                        |           |  
        |
    customgroup                    | text                        |           |  
        |
    switch                         | text                        |           |  
        |
    queue_ucic                     | character varying           |           |  
        |
    call_date                      | date                        |           |  
        |
    callid_ucic                    | text                        |           | 
not null |
    rule_ucic                      | text                        |           |  
        |
    on_off                         | integer                     |           |  
        |
    first_contactid                | text                        |           |  
        |
    callid                         | text                        |           |  
        |
    on_off_agg                     | text                        |           |  
        |
    on_off_ucic_agg                | text                        |           |  
        |
    contactid_agg                  | text                        |           |  
        |
    contactid_ucic_agg             | text                        |           |  
        |
    queue_agg                      | text                        |           |  
        |
    tier_agg                       | text                        |           |  
        |
    queue_ucic_agg                 | text                        |           |  
        |
    tier_ucic_agg                  | text                        |           |  
        |
    aht                            | numeric                     |           |  
        |
    mature_call                    | integer                     |           |  
        |
    gpls_join_rule                 | text                        |           |  
        |
    gpls_join_step                 | integer                     |           |  
        |
    gpls_only_rev                  | numeric                     |           |  
        |
    gpls_only_rev_mt               | numeric                     |           |  
        |
    otc_delta_revenue              | numeric                     |           |  
        |
    matured_rev                    | numeric                     |           |  
        |
    matured_rev_mt                 | numeric                     |           |  
        |
    otc_cancel                     | bigint                      |           |  
        |
    day0_matured_rev_ucic          | numeric                     |           |  
        |
    day1_matured_rev_ucic          | numeric                     |           |  
        |
    day3_matured_rev_ucic          | numeric                     |           |  
        |
    day7_matured_rev_ucic          | numeric                     |           |  
        |
    day10_matured_rev_ucic         | numeric                     |           |  
        |
    day14_matured_rev_ucic         | numeric                     |           |  
        |
    day0_matured_cancel_ucic       | integer                     |           |  
        |
    day1_matured_cancel_ucic       | integer                     |           |  
        |
    day3_matured_cancel_ucic       | integer                     |           |  
        |
    day7_matured_cancel_ucic       | integer                     |           |  
        |
    day10_matured_cancel_ucic      | integer                     |           |  
        |
    day14_matured_cancel_ucic      | integer                     |           |  
        |
    delta_metric_movers            | numeric                     |           |  
        |
    post_revenue_movers            | numeric                     |           |  
        |
    otc_delta_revenue_movers       | numeric                     |           |  
        |
    otc_delta_revenue_wo_in_movers | numeric                     |           |  
        |
    otc_delta_revenue_in_movers    | numeric                     |           |  
        |
    is_move_movers                 | integer                     |           |  
        |
    otc_cancel_movers              | bigint                      |           |  
        |
    is_success_movers              | integer                     |           |  
        |
    nagent                         | integer                     |           |  
        |
    ncustomers                     | integer                     |           |  
        |
    isrelevant                     | integer                     |           |  
        |
    evalalgoused                   | text                        |           |  
        |
    skill                          | text                        |           |  
        |
    calltime                       | timestamp without time zone |           |  
        |
    answtime                       | timestamp without time zone |           |  
        |
    wrapendtime                    | timestamp without time zone |           |  
        |
    disptime                       | timestamp without time zone |           |  
        |
    wrapstime                      | timestamp without time zone |           |  
        |
    agentid                        | text                        |           |  
        |
   Indexes:
       "vm_vaca_rollup_pkey" PRIMARY KEY, btree (callid_ucic)
   Distributed by: (callid_ucic)
   
   Apache Cloudberry 2.1.0-incubating build bdf90c5518f
   
   <img width="1753" height="442" alt="Image" 
src="https://github.com/user-attachments/assets/916473fb-d1b9-4afc-9843-606bcd9078f0";
 />


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