Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3, 2.4, 2.5
-
None
Description
Columnar JDBC Rewriter in incorrectly pushing filter against wrong alias when fact columns map to a single dimension.
Ex:
select fact.time_key, time_dim.day_of_week, location_dim_a.location_name, other_location_dim.location_name, sum(fact.dollars_sold) from sales_fact fact inner join time_dim time_dim on fact.time_key = time_dim.time_key inner join location_dim location_dim_a on fact.location_key = location_dim_a.location_key inner join location_dim other_location_dim on fact.other_location_key = other_location_dim.location_key where time_dim.time_key between '2013-01-01' and '2013-01-31' and location_dim_a.location_key = 'some-loc' group by fact.time_key, location_dim_a.location_key, other_location_dim.location_key
is being rewritten to
select ( sales_fact__fact . time_key ), ( time_dim_time_dim . day_of_week ), ( location_dim_location_dim_a . location_name ), ( location_dim_other_location_dim . location_name ), sum(alias1) from (select sales_fact_fact.time_key, sales_fact_fact.location_key, sales_fact_fact.other_location_key,sum(( sales_fact_fact . dollars_sold )) as alias1 from sales_fact sales_fact_fact where sales_fact_fact.time_key in ( select time_dim .time_key from time_dim where ( time_dim. time_key ) between '2013-01-01' and '2013-01-31' ) and sales_fact_fact.location_key in ( select location_dim .location_key from location_dim where (( location_dim. location_key ) = 'some-loc' ) ) and sales_fact_fact.other_location_key in ( select location_dim .location_key from location_dim where (( location_dim. location_key ) = 'some-loc' ) ) group by sales_fact_fact.time_key, sales_fact_fact.location_key, sales_fact_fact.other_location_key) sales_fact_fact inner join (select time_key,day_of_week from time_dim) time_dim_time_dim on (( sales_fact_fact . time_key ) = ( time_dim_time_dim . time_key )) inner join (select location_key,location_name from location_dim) location_dim_location_dim_a on (( sales_fact_fact . location_key ) = ( location_dim_location_dim_a . location_key )) inner join (select location_key,location_name from location_dim) location_dim_other_location_dim on (( sales_fact_fact . other_location_key ) = ( location_dim_other_location_dim . location_key )) where (( time_dim_time_dim . time_key ) between '2013-01-01' and '2013-01-31' and (( location_dim_location_dim_a . location_key ) = 'some-loc' )) group by ( sales_fact_fact . time_key ), ( location_dim_location_dim_a . location_key ), ( location_dim__other_location_dim . location_key )
Attachments
Attachments
Issue Links
- links to