If you are using a domain connecting an Athena data source. The timestamp fields are displayed correctly in Ad Hoc. However, if you create a filter for this timestamp field, the code generated does not work.
Jaspersoft Server at the time of this wiki is not supporting the Amazon Athena database, some particular use cases like this one might present issues, but you still can solve it since Jaspersoft Server is highly configurable.
Resolution :
1. The root cause is that Timestamp generated by Jasperserver is not supported by Athena.
Should replace the Timestamp function by the date_parse by adding a new Entry for the supported Athena functions in file: applicationContext-semanticLayer.xml (acs) (see line 838)
=> The value: AWS.Athena in the property : <property name="productName" value="AWS.Athena"/>, can not be changed, it represents the name of the database returned by your driver as per the JDBC specification. If you changed your driver you will need to check the new returned value in the method DatabaseMetaData#getDatabaseProductName() of your new driver (either from the documentation or directly in their code)
The returned value from your current driver is AWS.Athena as specified in their link : https://www.simba.com/products/Athena/doc/Simba_Athena_JDBC_ReleaseNotes.txt
=> For further changes, I can see in the AWS Athena documentation the link to the supported functions that can replace the default one in acs (date/time/aggregations...) : https://prestodb.io/docs/current/functions.html
2. Keep replacing the supported Athena function in AWS.AthenaSqlGenerator bean, to keep the default one intact and operational for other non Athena datasources
3. You can add a debug log level on those classes on the Server settings->Log settings, for detailed logs in jasperserver.log file :
net.sf.jasperreports.engine.query.JRJdbcQueryExecuter
com.jaspersoft.commons.semantic.dsimpl.SQLGenerator
com.jaspersoft.commons.semantic.dsimpl.JdbcBaseDataSet
4. Restart the server to test the changes.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now