github-actions[bot] commented on code in PR #63763:
URL: https://github.com/apache/doris/pull/63763#discussion_r3585397961


##########
regression-test/suites/shape_check/tpcds_sf1000_constraints/shape/query64.groovy:
##########
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+suite("query64_constraints") {
+    String db = context.config.getDbNameByFile(new File(context.file.parent))
+    if (isCloudMode()) {
+        return
+    }
+    sql "use ${db}"
+    sql 'set enable_nereids_planner=true'
+    sql 'set enable_nereids_distribute_planner=false'
+    sql 'set enable_fallback_to_original_planner=false'
+    sql 'set exec_mem_limit=21G'
+    sql 'set be_number_for_test=3'
+    sql 'set parallel_pipeline_task_num=8; '
+    sql 'set forbid_unknown_col_stats=true'
+    sql 'set enable_nereids_timeout = false'
+    sql 'set enable_runtime_filter_prune=false'
+    sql 'set runtime_filter_type=8'
+    sql 'set dump_nereids_memo=false'
+    sql "set disable_nereids_rules=PRUNE_EMPTY_PARTITION"
+    sql "set memo_max_group_expression_size = 1000000"
+
+    def ds = """with cs_ui as
+ (select cs_item_sk
+        ,sum(cs_ext_list_price) as 
sale,sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit) as refund
+  from catalog_sales
+      ,catalog_returns
+  where cs_item_sk = cr_item_sk
+    and cs_order_number = cr_order_number
+  group by cs_item_sk
+  having 
sum(cs_ext_list_price)>2*sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit)),
+cross_sales as
+ (select i_product_name product_name
+     ,i_item_sk item_sk
+     ,s_store_name store_name
+     ,s_zip store_zip
+     ,ad1.ca_street_number b_street_number
+     ,ad1.ca_street_name b_street_name
+     ,ad1.ca_city b_city
+     ,ad1.ca_zip b_zip
+     ,ad2.ca_street_number c_street_number
+     ,ad2.ca_street_name c_street_name
+     ,ad2.ca_city c_city
+     ,ad2.ca_zip c_zip
+     ,d1.d_year as syear
+     ,d2.d_year as fsyear
+     ,d3.d_year s2year
+     ,count(*) cnt
+     ,sum(ss_wholesale_cost) s1
+     ,sum(ss_list_price) s2
+     ,sum(ss_coupon_amt) s3
+  FROM   store_sales
+        ,store_returns
+        ,cs_ui
+        ,date_dim d1
+        ,date_dim d2
+        ,date_dim d3
+        ,store
+        ,customer
+        ,customer_demographics cd1
+        ,customer_demographics cd2
+        ,promotion
+        ,household_demographics hd1
+        ,household_demographics hd2
+        ,customer_address ad1
+        ,customer_address ad2
+        ,income_band ib1
+        ,income_band ib2
+        ,item
+  WHERE  ss_store_sk = s_store_sk AND
+         ss_sold_date_sk = d1.d_date_sk AND
+         ss_customer_sk = c_customer_sk AND
+         ss_cdemo_sk= cd1.cd_demo_sk AND
+         ss_hdemo_sk = hd1.hd_demo_sk AND
+         ss_addr_sk = ad1.ca_address_sk and
+         ss_item_sk = i_item_sk and
+         ss_item_sk = sr_item_sk and
+         ss_ticket_number = sr_ticket_number and
+         ss_item_sk = cs_ui.cs_item_sk and
+         c_current_cdemo_sk = cd2.cd_demo_sk AND
+         c_current_hdemo_sk = hd2.hd_demo_sk AND
+         c_current_addr_sk = ad2.ca_address_sk and
+         c_first_sales_date_sk = d2.d_date_sk and
+         c_first_shipto_date_sk = d3.d_date_sk and
+         ss_promo_sk = p_promo_sk and
+         hd1.hd_income_band_sk = ib1.ib_income_band_sk and
+         hd2.hd_income_band_sk = ib2.ib_income_band_sk and
+         cd1.cd_marital_status <> cd2.cd_marital_status and
+         i_color in ('orange','lace','lawn','misty','blush','pink') and
+         i_current_price between 48 and 48 + 10 and
+         i_current_price between 48 + 1 and 48 + 15
+group by i_product_name
+       ,i_item_sk
+       ,s_store_name
+       ,s_zip
+       ,ad1.ca_street_number
+       ,ad1.ca_street_name
+       ,ad1.ca_city
+       ,ad1.ca_zip
+       ,ad2.ca_street_number
+       ,ad2.ca_street_name
+       ,ad2.ca_city
+       ,ad2.ca_zip
+       ,d1.d_year
+       ,d2.d_year
+       ,d3.d_year
+)
+select cs1.product_name
+     ,cs1.store_name
+     ,cs1.store_zip
+     ,cs1.b_street_number
+     ,cs1.b_street_name
+     ,cs1.b_city
+     ,cs1.b_zip
+     ,cs1.c_street_number
+     ,cs1.c_street_name
+     ,cs1.c_city
+     ,cs1.c_zip
+     ,cs1.syear
+     ,cs1.cnt
+     ,cs1.s1 as s11
+     ,cs1.s2 as s21
+     ,cs1.s3 as s31
+     ,cs2.s1 as s12
+     ,cs2.s2 as s22
+     ,cs2.s3 as s32
+     ,cs2.syear
+     ,cs2.cnt
+from cross_sales cs1,cross_sales cs2
+where cs1.item_sk=cs2.item_sk and
+     cs1.syear = 1999 and
+     cs2.syear = 1999 + 1 and
+     cs2.cnt <= cs1.cnt and
+     cs1.store_name = cs2.store_name and
+     cs1.store_zip = cs2.store_zip
+order by cs1.product_name
+       ,cs1.store_name
+       ,cs2.cnt
+       ,cs1.s1
+       ,cs2.s1"""
+//     qt_ds_shape_64_constraints '''

Review Comment:
   This new constraints suite does not currently assert anything. It builds the 
Q64 SQL text, but the only `qt_ds_shape_64_constraints` / `explain shape plan` 
block is commented out, and there is no matching `query64.out` in the new 
`tpcds_sf1000_constraints` outputs. The regression run will still execute the 
setup and then pass without checking a plan for Q64, so this file gives the new 
constraints shape family a false sense of coverage. Please either enable the 
Q64 shape check and add the generated output, or intentionally skip/remove this 
suite with a reason.



##########
regression-test/data/shape_check/tpcds_sf1000_constraints/shape/query1.out:
##########
@@ -0,0 +1,37 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !ds_shape_1_constraints --
+PhysicalCteAnchor ( cteId=CTEId#0 )
+--PhysicalCteProducer ( cteId=CTEId#0 )
+----PhysicalProject
+------hashAgg[GLOBAL]
+--------PhysicalDistribute[DistributionSpecHash]
+----------hashAgg[LOCAL]
+------------PhysicalProject
+--------------hashJoin[INNER_JOIN broadcast] 
hashCondition=((store_returns.sr_returned_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->sr_returned_date_sk
+----------------PhysicalProject
+------------------PhysicalOlapScan[store_returns] apply RFs: RF0
+----------------PhysicalProject
+------------------filter((date_dim.d_year = 2000))
+--------------------PhysicalOlapScan[date_dim]
+--PhysicalResultSink
+----PhysicalTopN[MERGE_SORT]
+------PhysicalDistribute[DistributionSpecGather]
+--------PhysicalTopN[LOCAL_SORT]
+----------PhysicalProject
+------------hashJoin[INNER_JOIN broadcast] 
hashCondition=((ctr1.ctr_customer_sk = customer.c_customer_sk)) 
otherCondition=() build RFs:RF4 ctr_customer_sk->c_customer_sk
+--------------PhysicalProject
+----------------PhysicalOlapScan[customer] apply RFs: RF4
+--------------PhysicalProject
+----------------hashJoin[INNER_JOIN broadcast] 
hashCondition=((ctr1.ctr_store_sk = ctr2.ctr_store_sk)) 
otherCondition=((cast(ctr_total_return as DECIMALV3(38, 5)) > 
(avg(ctr_total_return) * 1.2))) build RFs:RF2 ctr_store_sk->ctr_store_sk;RF3 
ctr_store_sk->s_store_sk
+------------------PhysicalProject
+--------------------hashJoin[INNER_JOIN shuffle] 
hashCondition=((store.s_store_sk = ctr1.ctr_store_sk)) otherCondition=() build 
RFs:RF1 s_store_sk->ctr_store_sk
+----------------------PhysicalCteConsumer ( cteId=CTEId#0 ) apply RFs: RF1 RF2
+----------------------PhysicalProject
+------------------------filter((store.s_state = 'TN'))
+--------------------------PhysicalOlapScan[store] apply RFs: RF3
+------------------hashAgg[GLOBAL]
+--------------------PhysicalDistribute[DistributionSpecHash]
+----------------------hashAgg[LOCAL]
+------------------------PhysicalDistribute[DistributionSpecExecutionAny]
+--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+

Review Comment:
   This output file has an added blank line after the final expected plan line, 
and the same pattern appears across the new constraints shape outputs. `git 
diff --check` reports this as `new blank line at EOF` for representative files 
such as this one and `tpch_sf1000_constraints/shape/q1.out`. Please regenerate 
or trim the generated outputs so each file ends immediately after the final 
expected line, with only the normal terminating newline.



##########
regression-test/data/shape_check/tpcds_sf1000_constraints/shape/query14.out:
##########
@@ -0,0 +1,170 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !ds_shape_14_constraints --
+PhysicalCteAnchor ( cteId=CTEId#0 )
+--PhysicalCteProducer ( cteId=CTEId#0 )
+----PhysicalProject
+------hashJoin[INNER_JOIN broadcast] hashCondition=((item.i_brand_id = 
t.brand_id) and (item.i_category_id = t.category_id) and (item.i_class_id = 
t.class_id)) otherCondition=() build RFs:RF8 brand_id->i_brand_id;RF9 
class_id->i_class_id;RF10 category_id->i_category_id
+--------PhysicalProject
+----------PhysicalOlapScan[item] apply RFs: RF8 RF9 RF10
+--------PhysicalIntersect build RFs:RF6 brand_id->i_brand_id RF7 
brand_id->i_brand_id 

Review Comment:
   This added line ends with trailing whitespace, so the patch is not clean 
under the repository's required diff/style checks. I also found the same issue 
in the new constraints suite files, for example 
`regression-test/suites/shape_check/tpcds_sf1000_constraints/load.groovy:796` 
has trailing spaces after the column definition. Please strip trailing 
whitespace from the generated `.out` and `.groovy` additions before rerunning 
the output generation/checks.



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