Hi all,

I'm using Tableau with MapR Drill ODBC drivers.  I have successfully set up the 
drivers and am able to query the data from our source which is basically 
parquet files. All seems well as long as I'm using all rows from the source but 
when I try to limit the size of the results by grouping and rolling up the data 
I came across something that feels like a bug:

When I use any functions that return dates and add a group by to my query, the 
column alias in the underlying sql won't show up in the resultset.

Plain select from the source works:

SELECT 
  valid_from as valid_from_raw,
  date_add(to_date(valid_from),1)as valid_from_to_date
FROM
  dw.`/directory/parquet-file`
WHERE 
  valid_from = '1356991200000'

---------------+---------------------
valid_from_raw | valid_from_to_date
---------------+---------------------
1356991200000  | 2013-01-01
---------------+---------------------

When you add GROUP BY to the SQL, Drill looses the original column alias and 
replaces it with it's internal variable or something similar ($f1..n):

SELECT 
  valid_from as valid_from_raw,
  date_add(to_date(valid_from),1) as valid_from_to_date
FROM
  dw.`/directory/parquet-file`
WHERE
  valid_from = '1356991200000'
GROUP BY
  valid_from as valid_from_raw,
  date_add(to_date(valid_from),1)

---------------+-------------
valid_from_raw | $f1
---------------+-------------
1356991200000  | 2013-01-01
---------------+-------------

And naturally this creates a problem with Tableau which is mapping the column 
aliases from the initial SQL and fails to find the corresponding aliases from 
the resultset. Only way to get this working is to use $f0..n column aliases in 
the original query and rename them in Tableau... Something that one definitely 
shouldn't do. I'd appreciate if anyone has a solution or a more solid 
workaround.

Thanks,
Petri

Reply via email to