1 Reply Latest reply on Apr 7, 2015 4:25 PM by Patrick A Van Der Hyde

    Query issue with hive

    aditi.dash

      Hi

      I want to query a partitioned table in hive with partitions on year , month and day. I want to make year, month and day fields dynamic so i wrote the following query in Tableau custom SQL:

      select count(*),e_type,e_src_type

      from table1

      where e_year=cast(substr(date_sub(From_unixtime(unix_timestamp()), 4),1,4) as string)

      and e_month=cast(substr(date_sub(From_unixtime(unix_timestamp()), 4),6,2) as string)

      and e_day=cast(substr(date_sub(From_unixtime(unix_timestamp()), 4),9,2) as string)

      group by e_type,e_src_type

       

      But I came to know in Hive if I do this correct partitions wont be scanned and it will go for FTS.So the other way is to set variables or write hql script.Would you know how its possible in Tableau?

      Thanks!

        • 1. Re: Query issue with hive
          Patrick A Van Der Hyde

          Hello aditi.dash,

           

          In reviewing older, unanswered posts, I came across this post.  

           

          Were you able to find a workable solution for the issue encountered?  If so, please share what worked for you.  If not, could you elaborate with a few more details? 

           

          I am not an expert with Hive but usually lack of response indicates a need to provide more details regarding the original post.  In addition, contacting support and creating a case may also be helpful.   Product Support | Tableau Software

           

          I hope this is helpful.

           

          Patrick