Details
-
Question
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 4.0.0
-
None
-
ghx-label-11
Description
When query contains multiple union, and encounter a expr rewrite. Then this query will do 'reAnalyze', and get stuck in 'reset' method. Here is the example to reproduce this bug:
SELECT `t1`.`dt` FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT '20211020' AS `dt` UNION ALL SELECT '20211021' AS `dt`) AS `t` UNION ALL SELECT '20211022' AS `dt`) AS `t` UNION ALL SELECT '20211023' AS `dt`) AS `t` UNION ALL SELECT '20211024' AS `dt`) AS `t` UNION ALL SELECT '20211025' AS `dt`) AS `t` UNION ALL SELECT '20211026' AS `dt`) AS `t` UNION ALL SELECT '20211027' AS `dt`) AS `t` UNION ALL SELECT '20211028' AS `dt`) AS `t` UNION ALL SELECT '20211029' AS `dt`) AS `t` UNION ALL SELECT '20211030' AS `dt`) AS `t` UNION ALL SELECT '20211031' AS `dt`) AS `t` UNION ALL SELECT '20211101' AS `dt`) AS `t` UNION ALL SELECT '20211102' AS `dt`) AS `t` UNION ALL SELECT '20211103' AS `dt`) AS `t` UNION ALL SELECT '20211104' AS `dt`) AS `t` UNION ALL SELECT '20211105' AS `dt`) AS `t` UNION ALL SELECT '20211106' AS `dt`) AS `t` UNION ALL SELECT '20211107' AS `dt`) AS `t` UNION ALL SELECT '20211108' AS `dt`) AS `t` UNION ALL SELECT '20211109' AS `dt`) AS `t` UNION ALL SELECT '20211110' AS `dt`) AS `t` UNION ALL SELECT '20211111' AS `dt`) AS `t` UNION ALL SELECT '20211112' AS `dt`) AS `t` UNION ALL SELECT '20211113' AS `dt`) AS `t` UNION ALL SELECT '20211114' AS `dt`) AS `t` UNION ALL SELECT '20211115' AS `dt`) AS `t` UNION ALL SELECT '20211116' AS `dt`) AS `t` UNION ALL SELECT '20211117' AS `dt`) AS `t` UNION ALL SELECT '20211118' AS `dt`) AS `t` UNION ALL SELECT '20211119' AS `dt`) AS `t` UNION ALL SELECT '20211120' AS `dt`) AS `t1` CROSS JOIN (SELECT 1000+1000) AS `t2` GROUP BY `t1`.`dt`;
This query may take long time to execute, such as ten minutes. If we reduce 'UNION', the query will execute quickly.