Optimizing HPE Data Fabric Database Tables Search by ID
Starting from the 1904 release (EEP 6.0.2, EEP 6.1.1, and EEP 6.2.0), search by ID is supported with Hive HPE Data Fabric Database JSON tables.
About this task
Property of Optimization
Prerequisites
hive.mapr.db.json.fetch.by.id.task.conversion
and the value has a boolean type and by default is set to true, which means it is enabled.Procedure
To disable optimization, set
hive.mapr.db.json.fetch.by.id.task.conversion to
false.
Conditions for Optimization
Procedure
This optimizer is designed for queries such as:
SELECT *
FROM <mapr_db_json_table>
WHERE _id = <constant_string_value>; or:SELECT *
FROM <mapr_db_json_table>
WHERE _id = <constant_string_value> AND (<condition_1>) AND (<condition_2>) ... AND (<condition_N>);
or:SELECT *
FROM <mapr_db_json_table>
WHERE <Constant false operator>where _id is
a key column of HPE Data Fabric Database JSON table. It
provides usage of the findById() method of the HPE Data Fabric Database JSON table. The following functionality is
not supported: - joins
- group by
- distinct
- lateral view
- subquery
- create table as select (CTAS) or insert
- analyze
- single source
SELECT * FROM t WHERE (CASE WHEN _id = 'value_a' THEN 2 ELSE 4 END) > 3;