Home > Workload Solutions > Oracle > White Papers > Oracle Big Data SQL on Dell EMC PowerFlex > TPC-H Query 2 test
In this query, tables from Cloudera Hadoop (LINEITEM) and Oracle (ORDERS) were used for an order priority report. The table names in the script were modified to use the external tables: EXT_HDFS_ORDERS and EXT_HDFS_LINEITEM.
/* TPC_H Query 2 - Order Priority Checking */
SELECT O_ORDERPRIORITY,
COUNT(*) AS ORDER_COUNT
FROM EXT_HDFS_ORDERS
WHERE O_ORDERDATE >= '1993-11-01'
AND O_ORDERDATE < dateadd (mm, 3, cast ('1993-11-01' as date))
AND EXISTS( SELECT * FROM EXT_HDFS_LINEITEM
WHERE L_ORDERKEY = O_ORDERKEY
AND L_COMMITDATE < L_RECEIPTDATE)
GROUP BY O_ORDERPRIORITY ORDER BY O_ORDERPRIORITY