kasakrisz commented on code in PR #5089:
URL: https://github.com/apache/hive/pull/5089#discussion_r1499266706


##########
ql/src/test/queries/clientpositive/cte_mat_11.q:
##########
@@ -0,0 +1,15 @@
+--! qt:dataset:src
+set hive.optimize.cte.materialize.threshold=2;
+set hive.optimize.cte.materialize.full.aggregate.only=false;
+
+EXPLAIN WITH materialized_cte1 AS (
+  SELECT * FROM src
+),
+materialized_cte2 AS (
+  SELECT *
+  FROM materialized_cte1 a
+  JOIN materialized_cte1 b ON (a.key = b.key)
+)
+SELECT *
+FROM materialized_cte2 a
+JOIN materialized_cte2 b ON (a.key = b.key);

Review Comment:
   I haven't dig in deeply what could be the cause of the failure. Maybe it can 
be a bug or it is something which Hive doesn't support and there are 
opportunities to make some improvement at this area or it is something which 
does not makes sense by SQL semantics. So it requires some investigation first. 
If it is a bug please file a new jira and include the repro steps.
   
   About propagating stats: I think it is a good idea. I see some plan changes 
in existing tests so it seems that those are proving that the stats propagation 
happens. If you think we need some additional tests please feel free to add it. 
You can easily check whether CBO is passing or not by adding an `EXPLAIN CBO 
<query>` command, it should print the CBO plan.



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