How to push down "current_date - INTERVAL '1' month " to the TIBCO Data Virtualization's Query Engine for an Apache Hive-2 data source?
book
Article ID: KB0073355
calendar_today
Updated On:
Products
Versions
TIBCO Data Virtualization
8.3, 8.4
Description
The current_date function can be pushed down the TIBCO Data Virtualization's Query engine for an Apache Hive-2 data source. But when it is used with the data type 'INTERVAL', then it can only be pushed down in the following case:
current_date >= current_date - INTERVAL '1' month
However, when the same function is used in the below expression:
cast(to_timestamp(date_time_key) as date) >= current_date - INTERVAL '1' month
Then the function does not get pushed down with the below message:
============== No Push Reason: Cannot push selectable because the data source Hive2 does not support the function --current_date - INTERVAL '1' MONTH-- ==============
Environment
All supported environment
Resolution
To push down the "current_date -INTERVAL '1' month" in the below expression:
"cast(to_timestamp(date_time_key) as date) >= current_date - INTERVAL '1' month"
The below properties need to be added to the hive2.capabilities file. It's recommended to make these changes in the <adapter>_values.xml file so it won't get overridden by upgrades. If a custom adapter is being used e.g. hive_2_1_1_custom under /conf/adapters/custom, so there is a need to update the hive_2_1_1_custom_values.xml file.
Below is the XML which should be used, this need to be put before the comment section as noted in the <adapter>_values.xml file
This article helps to understand how to push down the "current_date -INTERVAL '1' month" function to the TIBCO Data Virtualization's Apache Hive-2 data source when it is used in an expression: cast(to_timestamp(date_time_key) as date) >= current_date - INTERVAL '1' month