Hi Lens Developers,

I am running the example queries, and found the following Lens query:

query execute cube select customer_city_name, store_cost from sales where
time_range_in(order_time, '2015-04-13-03', '2015-04-13-04')

Was converted to the following hive Query:

SELECT ( customer_city . name ), sum(( sales . store_cost )) FROM
local_sales_aggr_fact2 sales join local_city_table customer_city on
sales.customer_city_id = customer_city.id and (customer_city.dt = 'latest')
WHERE ((((*(( sales . dt ) =  '2015-04-13-04' ) or (( sales . dt ) =
 '2015-04-13-05' ))* and ((( *sales . order_time* ) >=  '2015-04-13
03:00:00' ) and (( *sales . order_time* ) <  '2015-04-13 04:00:00' )))))
GROUP BY ( customer_city . name )

The property shows (! grep -A 33333333 <x_
examples/resources/sales-cube.xml):
  <properties>
    <property name="cube.sales.timed.dimensions.list"
value="order_time,delivery_time" />
    *<property name="cube.timedim.partition.order_time" value="ot" />*
    <property name="cube.timedim.partition.delivery_time" value="dt" />
    *<property name="cube.timedim.relation.order_time"
value="delivery_time+[-20 days,-1 hour]" />*
    <!-- means dt-20days <= ot <= dt-1hour -->
  </properties>


Which means that "order time can be between delivery time -20 days to
delivery time - 1 hour" according to the 20 minutes demo.

However, the Hive query's 'where' condition use deliver_time equal '
*2015-04-13-04*' or '*2015-04-13-05*', and how does it find the column
'sales.order_time'? Shouldn't it match order_time with partition 'ot'?

Thanks,
-- 

*Tao Yan*
Software Engineer
Data Analytics Infrastructure Tools and Services



206.250.5345
t...@linkedin.com
https://www.linkedin.com/in/taousc

Reply via email to