Anonymous Coward (816) has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21961 )

Change subject: IMPALA-13468: Fix various aggregation issues in aggregation.test
......................................................................


Patch Set 5:

tpcds: Q45
select ca_zip, ca_city, sum(ws_sales_price)
 from web_sales, customer, customer_address, date_dim, item
 where ws_bill_customer_sk = c_customer_sk
  and c_current_addr_sk = ca_address_sk
  and ws_item_sk = i_item_sk
  and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475', 
'85392', '85460', '80348', '81792')
        or
        i_item_id in (select i_item_id
                             from item
                             where i_item_sk in (2, 3, 5, 7, 11, 13, 17, 19, 
23, 29)
                             )
      )
  and ws_sold_date_sk = d_date_sk
  and d_qoy = 2 and d_year = 2001
 group by ca_zip, ca_city
 order by ca_zip, ca_city
 limit 100;

I1023 17:30:41.255332 1989386 CalciteOptimizer.java:184] 
be4f13e954b3bb20:c1e975fe00000000] [Impala plan]
LogicalSort(sort0=[$0], sort1=[$1], dir0=[ASC], dir1=[ASC], fetch=[100]), id = 
444
  LogicalAggregate(group=[{0, 1}], EXPR$2=[SUM($2)]), id = 443
    LogicalProject(CA_ZIP=[$60], CA_CITY=[$57], ws_sales_price=[$20]), id = 442
      LogicalProject(ws_sold_date_sk=[$0], ws_ship_date_sk=[$1], 
ws_item_sk=[$2], ws_bill_customer_sk=[$3], ws_bill_cdemo_sk=[$4], 
ws_bill_hdemo_sk=[$5], ws_bill_addr_sk=[$6], ws_ship_customer_sk=[$7], 
ws_ship_cdemo_sk=[$8], ws_ship_hdemo_sk=[$9], ws_ship_addr_sk=[$10], 
ws_web_page_sk=[$11], ws_web_site_sk=[$12], ws_ship_mode_sk=[$13], 
ws_warehouse_sk=[$14], ws_promo_sk=[$15], ws_order_number=[$16], 
ws_quantity=[$17], ws_wholesale_cost=[$18], ws_list_price=[$19], 
ws_sales_price=[$20], ws_ext_discount_amt=[$21], ws_ext_sales_price=[$22], 
ws_ext_wholesale_cost=[$23], ws_ext_list_price=[$24], ws_ext_tax=[$25], 
ws_coupon_amt=[$26], ws_ext_ship_cost=[$27], ws_net_paid=[$28], 
ws_net_paid_inc_tax=[$29], ws_net_paid_inc_ship=[$30], 
ws_net_paid_inc_ship_tax=[$31], ws_net_profit=[$32], c_customer_sk=[$33], 
c_customer_id=[$34], c_current_cdemo_sk=[$35], c_current_hdemo_sk=[$36], 
c_current_addr_sk=[$37], c_first_shipto_date_sk=[$38], 
c_first_sales_date_sk=[$39], c_salutation=[$40], c_first_name=[$41], 
c_last_name=[$42], c_preferred_cust_flag=[$43], c_birth_day=[$44], 
c_birth_month=[$45], c_birth_year=[$46], c_birth_country=[$47], c_login=[$48], 
c_email_address=[$49], c_last_review_date_sk=[$50], ca_address_sk=[$51], 
ca_address_id=[$52], ca_street_number=[$53], ca_street_name=[$54], 
ca_street_type=[$55], ca_suite_number=[$56], ca_city=[$57], ca_county=[$58], 
ca_state=[$59], ca_zip=[$60], ca_country=[$61], ca_gmt_offset=[$62], 
ca_location_type=[$63], d_date_sk=[$64], d_date_id=[$65], d_date=[$66], 
d_month_seq=[$67], d_week_seq=[$68], d_quarter_seq=[$69], d_year=[$70], 
d_dow=[$71], d_moy=[$72], d_dom=[$73], d_qoy=[$74], d_fy_year=[$75], 
d_fy_quarter_seq=[$76], d_fy_week_seq=[$77], d_day_name=[$78], 
d_quarter_name=[$79], d_holiday=[$80], d_weekend=[$81], 
d_following_holiday=[$82], d_first_dom=[$83], d_last_dom=[$84], 
d_same_day_ly=[$85], d_same_day_lq=[$86], d_current_day=[$87], 
d_current_week=[$88], d_current_month=[$89], d_current_quarter=[$90], 
d_current_year=[$91], i_item_sk=[$92], i_item_id=[$93], i_rec_start_date=[$94], 
i_rec_end_date=[$95], i_item_desc=[$96], i_current_price=[$97], 
i_wholesale_cost=[$98], i_brand_id=[$99], i_brand=[$100], i_class_id=[$101], 
i_class=[$102], i_category_id=[$103], i_category=[$104], i_manufact_id=[$105], 
i_manufact=[$106], i_size=[$107], i_formulation=[$108], i_color=[$109], 
i_units=[$110], i_container=[$111], i_manager_id=[$112], 
i_product_name=[$113]), id = 441
        LogicalProject(ws_sold_date_sk=[$24], ws_ship_date_sk=[$25], 
ws_item_sk=[$26], ws_bill_customer_sk=[$27], ws_bill_cdemo_sk=[$28], 
ws_bill_hdemo_sk=[$29], ws_bill_addr_sk=[$30], ws_ship_customer_sk=[$31], 
ws_ship_cdemo_sk=[$32], ws_ship_hdemo_sk=[$33], ws_ship_addr_sk=[$34], 
ws_web_page_sk=[$35], ws_web_site_sk=[$36], ws_ship_mode_sk=[$37], 
ws_warehouse_sk=[$38], ws_promo_sk=[$39], ws_order_number=[$40], 
ws_quantity=[$41], ws_wholesale_cost=[$42], ws_list_price=[$43], 
ws_sales_price=[$44], ws_ext_discount_amt=[$45], ws_ext_sales_price=[$46], 
ws_ext_wholesale_cost=[$47], ws_ext_list_price=[$48], ws_ext_tax=[$49], 
ws_coupon_amt=[$50], ws_ext_ship_cost=[$51], ws_net_paid=[$52], 
ws_net_paid_inc_tax=[$53], ws_net_paid_inc_ship=[$54], 
ws_net_paid_inc_ship_tax=[$55], ws_net_profit=[$56], c_customer_sk=[$85], 
c_customer_id=[$86], c_current_cdemo_sk=[$87], c_current_hdemo_sk=[$88], 
c_current_addr_sk=[$89], c_first_shipto_date_sk=[$90], 
c_first_sales_date_sk=[$91], c_salutation=[$92], c_first_name=[$93], 
c_last_name=[$94], c_preferred_cust_flag=[$95], c_birth_day=[$96], 
c_birth_month=[$97], c_birth_year=[$98], c_birth_country=[$99], c_login=[$100], 
c_email_address=[$101], c_last_review_date_sk=[$102], ca_address_sk=[$105], 
ca_address_id=[$106], ca_street_number=[$107], ca_street_name=[$108], 
ca_street_type=[$109], ca_suite_number=[$110], ca_city=[$111], 
ca_county=[$112], ca_state=[$113], ca_zip=[$114], ca_country=[$115], 
ca_gmt_offset=[$116], ca_location_type=[$117], d_date_sk=[$57], 
d_date_id=[$58], d_date=[$59], d_month_seq=[$60], d_week_seq=[$61], 
d_quarter_seq=[$62], d_year=[$63], d_dow=[$64], d_moy=[$65], d_dom=[$66], 
d_qoy=[$67], d_fy_year=[$68], d_fy_quarter_seq=[$69], d_fy_week_seq=[$70], 
d_day_name=[$71], d_quarter_name=[$72], d_holiday=[$73], d_weekend=[$74], 
d_following_holiday=[$75], d_first_dom=[$76], d_last_dom=[$77], 
d_same_day_ly=[$78], d_same_day_lq=[$79], d_current_day=[$80], 
d_current_week=[$81], d_current_month=[$82], d_current_quarter=[$83], 
d_current_year=[$84], i_item_sk=[$0], i_item_id=[$1], i_rec_start_date=[$2], 
i_rec_end_date=[$3], i_item_desc=[$4], i_current_price=[$5], 
i_wholesale_cost=[$6], i_brand_id=[$7], i_brand=[$8], i_class_id=[$9], 
i_class=[$10], i_category_id=[$11], i_category=[$12], i_manufact_id=[$13], 
i_manufact=[$14], i_size=[$15], i_formulation=[$16], i_color=[$17], 
i_units=[$18], i_container=[$19], i_manager_id=[$20], i_product_name=[$21], 
c=[$103], ck=[$104], I_ITEM_ID0=[$22], i=[$23]), id = 440
          LogicalFilter(condition=[OR(=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('85669':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('86197':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('88274':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('83405':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('86475':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('85392':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('85460':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('80348':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('81792':VARCHAR(2147483647)):VARCHAR(2147483647)), IS NOT NULL($23))]), id 
= 439
            LogicalJoin(condition=[AND(=($27, $85), OR(=(SUBSTR($114, 1:BIGINT, 
5:BIGINT), CAST('85669':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('86197':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('88274':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('83405':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('86475':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('85392':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('85460':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($114, 1:BIGINT, 5:BIGINT), 
CAST('80348':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($114, 
1:BIGINT, 5:BIGINT), CAST('81792':VARCHAR(2147483647)):VARCHAR(2147483647)), IS 
NOT NULL($1)))], joinType=[inner]), id = 438
              LogicalJoin(condition=[=($26, $0)], joinType=[inner]), id = 432
                LogicalJoin(condition=[=($1, $22)], joinType=[left]), id = 429
                  LogicalTableScan(table=[[tpcds, item]]), id = 15
                  LogicalProject(I_ITEM_ID=[$0], i=[true]), id = 428
                    LogicalAggregate(group=[{0}]), id = 427
                      LogicalProject(I_ITEM_ID=[$1]), id = 426
                        LogicalFilter(condition=[OR(=($0, 2), =($0, 3), =($0, 
5), =($0, 7), =($0, 11), =($0, 13), =($0, 17), =($0, 19), =($0, 23), =($0, 
29))]), id = 425
                          LogicalTableScan(table=[[tpcds, item]]), id = 15
                LogicalJoin(condition=[=($0, $33)], joinType=[inner]), id = 431
                  LogicalTableScan(table=[[tpcds, web_sales]]), id = 1
                  LogicalFilter(condition=[AND(=($10, 2), =($6, 2001))]), id = 
430
                    LogicalTableScan(table=[[tpcds, date_dim]]), id = 11
              LogicalJoin(condition=[AND(=($4, $20), OR(=(SUBSTR($29, 1:BIGINT, 
5:BIGINT), CAST('85669':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($29, 1:BIGINT, 5:BIGINT), 
CAST('86197':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($29, 1:BIGINT, 
5:BIGINT), CAST('88274':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($29, 1:BIGINT, 5:BIGINT), 
CAST('83405':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($29, 1:BIGINT, 
5:BIGINT), CAST('86475':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($29, 1:BIGINT, 5:BIGINT), 
CAST('85392':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($29, 1:BIGINT, 
5:BIGINT), CAST('85460':VARCHAR(2147483647)):VARCHAR(2147483647)), 
=(SUBSTR($29, 1:BIGINT, 5:BIGINT), 
CAST('80348':VARCHAR(2147483647)):VARCHAR(2147483647)), =(SUBSTR($29, 1:BIGINT, 
5:BIGINT), CAST('81792':VARCHAR(2147483647)):VARCHAR(2147483647)), <>($18, 
0)))], joinType=[inner]), id = 437
                LogicalJoin(condition=[true], joinType=[inner]), id = 436
                  LogicalTableScan(table=[[tpcds, customer]]), id = 3
                  LogicalAggregate(group=[{}], c=[COUNT()], ck=[COUNT($0)]), id 
= 435
                    LogicalProject(I_ITEM_ID=[$1]), id = 434
                      LogicalFilter(condition=[OR(=($0, 2), =($0, 3), =($0, 5), 
=($0, 7), =($0, 11), =($0, 13), =($0, 17), =($0, 19), =($0, 23), =($0, 29))]), 
id = 433
                        LogicalTableScan(table=[[tpcds, item]]), id = 15
                LogicalTableScan(table=[[tpcds, customer_address]]), id = 7
I1023 17:30:41.280493 1989386 CalciteJniFrontend.java:174] 
be4f13e954b3bb20:c1e975fe00000000] Optimized logical plan


I1023 17:30:41.280606 1989386 CalciteMetadataHandler.java:202] 
be4f13e954b3bb20:c1e975fe00000000] Loaded tables: customer, customer_address, 
web_sales, item, date_dim
I1023 17:30:41.281163 1989386 AuthorizationUtil.java:100] 
be4f13e954b3bb20:c1e975fe00000000] Authorization is 'DISABLED'.
I1023 17:30:41.393934 1989386 FunctionResolver.java:159] 
be4f13e954b3bb20:c1e975fe00000000] Failed to find function count
I1023 17:30:41.394062 1989386 CalciteJniFrontend.java:123] 
be4f13e954b3bb20:c1e975fe00000000] Calcite planner failed.
I1023 17:30:41.394093 1989386 CalciteJniFrontend.java:124] 
be4f13e954b3bb20:c1e975fe00000000] Exception: java.lang.IllegalStateException: 
Could not find the Impala function for COUNT
I1023 17:30:41.394269 1989386 CalciteJniFrontend.java:126] 
be4f13e954b3bb20:c1e975fe00000000] Stack Trace:java.lang.IllegalStateException: 
Could not find the Impala function for COUNT
        at 
com.google.common.base.Preconditions.checkState(Preconditions.java:502)
        at 
org.apache.impala.calcite.rel.node.ImpalaAggRel.getAggregateExprs(ImpalaAggRel.java:259)
        at 
org.apache.impala.calcite.rel.node.ImpalaAggRel.getPlanNode(ImpalaAggRel.java:87)
        at 
org.apache.impala.calcite.rel.node.ImpalaJoinRel.getChildPlanNode(ImpalaJoinRel.java:146)
        at 
org.apache.impala.calcite.rel.node.ImpalaJoinRel.getPlanNode(ImpalaJoinRel.java:80)
        at 
org.apache.impala.calcite.rel.node.ImpalaJoinRel.getChildPlanNode(ImpalaJoinRel.java:146)
        at 
org.apache.impala.calcite.rel.node.ImpalaJoinRel.getPlanNode(ImpalaJoinRel.java:79)
        at 
org.apache.impala.calcite.rel.node.ImpalaJoinRel.getChildPlanNode(ImpalaJoinRel.java:146)
        at 
org.apache.impala.calcite.rel.node.ImpalaJoinRel.getPlanNode(ImpalaJoinRel.java:80)
        at 
org.apache.impala.calcite.rel.node.ImpalaFilterRel.getChildPlanNode(ImpalaFilterRel.java:73)
        at 
org.apache.impala.calcite.rel.node.ImpalaFilterRel.getPlanNode(ImpalaFilterRel.java:50)
        at 
org.apache.impala.calcite.rel.node.ImpalaProjectRel.getChildPlanNode(ImpalaProjectRel.java:117)
        at 
org.apache.impala.calcite.rel.node.ImpalaProjectRel.getPlanNode(ImpalaProjectRel.java:62)
        at 
org.apache.impala.calcite.rel.node.ImpalaProjectRel.getChildPlanNode(ImpalaProjectRel.java:117)
        at 
org.apache.impala.calcite.rel.node.ImpalaProjectRel.getPlanNode(ImpalaProjectRel.java:62)
        at 
org.apache.impala.calcite.rel.node.ImpalaProjectRel.getChildPlanNode(ImpalaProjectRel.java:117)
        at 
org.apache.impala.calcite.rel.node.ImpalaProjectRel.getPlanNode(ImpalaProjectRel.java:62)
        at 
org.apache.impala.calcite.rel.node.ImpalaAggRel.getChildPlanNode(ImpalaAggRel.java:138)
        at 
org.apache.impala.calcite.rel.node.ImpalaAggRel.getPlanNode(ImpalaAggRel.java:75)
        at 
org.apache.impala.calcite.rel.node.ImpalaSortRel.getChildPlanNode(ImpalaSortRel.java:141)
        at 
org.apache.impala.calcite.rel.node.ImpalaSortRel.getPlanNode(ImpalaSortRel.java:84)
        at 
org.apache.impala.calcite.service.CalcitePhysPlanCreator.create(CalcitePhysPlanCreator.java:51)
        at 
org.apache.impala.calcite.service.CalciteJniFrontend.createExecRequest(CalciteJniFrontend.java:108)
I1023 17:30:41.394397 1989386 jni-util.cc:288] 
be4f13e954b3bb20:c1e975fe00000000] org.apache.impala.common.InternalException: 
Could not find the Impala function for COUNT
        at 
org.apache.impala.calcite.service.CalciteJniFrontend.createExecRequest(CalciteJniFrontend.java:127)


--
To view, visit http://gerrit.cloudera.org:8080/21961
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I038127d6a2f228ae8d263e983b1906e99ae05f77
Gerrit-Change-Number: 21961
Gerrit-PatchSet: 5
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Anonymous Coward (816)
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Wed, 23 Oct 2024 10:58:14 +0000
Gerrit-HasComments: No

Reply via email to