Determining the Query Execution Path for OJAI Queries
You can determine whether an OJAI query directly accesses HPE Ezmeral Data Fabric Database JSON or leverages the OJAI Distributed Query Service by enabling Java OJAI tracing. Java OJAI tracing logs information that enables you to determine which execution path your queries use.
Follow the instructions at Enable OJAI Tracing to output tracing messages that include query plans.
If the query does not use the OJAI Distributed Query Service, you will see tracing like the following:
2017-07-17 17:35:59 TRACE OjaiDocumentStore:132 - Query Plan: '[{"streamName":"DBDocumentStream","parameters":{"queryConditionPath":false,"indexName":"abc_Idx","projectionPath":["c","b","a"],"primaryTable":"/tmp/test-728918932/ei_suffix_sort"}}]'
If a query uses the OJAI Distributed Query Service, you will see tracing like the following instead:
2017-07-17 18:51:13 TRACE OjaiDocumentStore:132 - Query Plan:'[{"streamName":"DrillDocumentStream","parameters":{"sql":"select t.`$$ENC00NQYF6YJUL5UW45AAL5UWI`,t.`$$document` from dfs.`/tmp/testTable` t where (t.`l0_a4_int` = -92) order by t.`l0_a4_int` ASC,t.`_id` DESC"}}]'
2017-07-17 18:51:14 DEBUG DrillDocumentStream:120 - DocumentResultsListener[1].queryIdArrived(queryId = 2692966d-0888-96e2-fa09-0d9befcd3173 ,sql string = select t.`$$ENC00NQYF6YJUL5UW45AAL5UWI`,t.`$$document` from dfs.`/tmp/testTable` t where (t.`l0_a4_int` = -92) order by t.`l0_a4_int` ASC,t.`_id` DESC)
Note that the Query Plan in the second trace fragment above contains a DrillDocumentStream instead of a DBDocumentStream. The sql parameter in that stream shows a SQL query. This is also missing in the first trace fragment above. The presence of the SQL query indicates that OJAI passes the query to the OJAI Distributed Query Service, as noted in the third trace fragment.
For further information about OJAI query plans, see Examining the OJAI Query Plan. For background information about different query execution paths, see OJAI Distributed Query Service.