Looker Wrapping Parentheses around Dimension Causing Incorrect Syntax

I have the following LookML code

(select max(${origin_event_date}) from ${origin_table_name}))

It should be generating the following SQL. 

(select max(date) from looker-pop-block-testing.looker_pop_block_testing.test_pattern)

Instead, it generates this (note the extra set of parentheses around the ${origin_table_name} value).  

(select max(date) from (looker-pop-block-testing.looker_pop_block_testing.test_pattern))

This is causing a syntax error. I don’t see any way to prevent Looker from doing this. Even stranger, it only does this when the code is running under BigQuery. For Redshift, it doesn’t add parentheses. Another oddity is that the ${origin_event_date} value isn’t wrapped. It looks like the dot in the string is triggering this. 

UPDATE: It was something about having two dots in the string. As the database wasn’t necessary to specify in this case, I have it working for now. I don’t see a need to specify the database in the future, so this is more of a minor mystery than a show stopper. 

0 0 150
0 REPLIES 0
Top Labels in this Space
Top Solution Authors