Search code examples
hadoophivejasper-reportsjaspersoft-studio

Jaspersoft Hive date parameter issue


I am using JasperSoft Studio to connect to Hive and pass a query with a dynamic date. The report should be querying on yesterdays date. I am having an issue with using a dynamic in the JasperSoft Studio Dataset and Query Dialog box. The following query works from the Hive command line, but JasperSoft Studio does not seem to recognize the commands "date_sub" and "unix_timestamp()". I am using JasperSoft Studio version 6.1.

SELECT col1, count(col2), count(col3)
FROM table1
WHERE date = date_sub(from_unixtime(unix_timestamp(),'yyyy-MM-dd'),1)
GROUP BY col1

Any suggestions as to how to get this query to work would be greatly appreciated, if a date parameter can be passed in an alternative way using JasperSoft's paramters or variables I would be open to that too.


Solution

  • One solution will be create a view on your DDBB and make a basic sql on JasperSoft to access the information.