asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [46/85] [abbrv] [partial] incubator-asterixdb-hyracks git commit: Move Pregelix and Hivesterix codebase to new repositories: 1. Move Pregelix codebase to https://github.com/pregelix/pregelix; 2. Move Hivesterix codebase to https://code.google.com/p/hives
Date Fri, 24 Apr 2015 18:46:13 GMT
http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q16_parts_supplier_relationship.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q16_parts_supplier_relationship.hive b/hivesterix/hivesterix-dist/resource/tpch100/q16_parts_supplier_relationship.hive
deleted file mode 100644
index b551581..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q16_parts_supplier_relationship.hive
+++ /dev/null
@@ -1,52 +0,0 @@
--- create the tables and load the data
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-create external table partsupp (PS_PARTKEY INT, PS_SUPPKEY INT, PS_AVAILQTY INT, PS_SUPPLYCOST DOUBLE, PS_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION'/tpch/100/partsupp';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-
--- create the result table
-create table q16_parts_supplier_relationship(p_brand string, p_type string, p_size int, supplier_cnt int);
-create table q16_tmp(p_brand string, p_type string, p_size int, ps_suppkey int);
-create table supplier_tmp(s_suppkey int);
-
--- the query
-insert overwrite table supplier_tmp
-select 
-  s_suppkey
-from 
-  supplier
-where 
-  not s_comment like '%Customer%Complaints%';
-
-insert overwrite table q16_tmp
-select 
-  p_brand, p_type, p_size, ps_suppkey
-from 
-  partsupp ps join part p 
-  on 
-    p.p_partkey = ps.ps_partkey and p.p_brand <> 'Brand#45' 
-    and not p.p_type like 'MEDIUM POLISHED%'
-  join supplier_tmp s 
-  on 
-    ps.ps_suppkey = s.s_suppkey;
-
-insert overwrite table q16_parts_supplier_relationship
-select 
-  p_brand, p_type, p_size, count(distinct ps_suppkey) as supplier_cnt
-from 
-  (select 
-     * 
-   from
-     q16_tmp 
-   where p_size = 49 or p_size = 14 or p_size = 23 or
-         p_size = 45 or p_size = 19 or p_size = 3 or
-         p_size = 36 or p_size = 9
-) q16_all
-group by p_brand, p_type, p_size
-order by supplier_cnt desc, p_brand, p_type, p_size;
-
-DROP TABLE partsupp;
-DROP TABLE part;
-DROP TABLE supplier;
-DROP TABLE q16_parts_supplier_relationship;
-DROP TABLE q16_tmp;
-DROP TABLE supplier_tmp;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q17_small_quantity_order_revenue.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q17_small_quantity_order_revenue.hive b/hivesterix/hivesterix-dist/resource/tpch100/q17_small_quantity_order_revenue.hive
deleted file mode 100644
index 14e87db..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q17_small_quantity_order_revenue.hive
+++ /dev/null
@@ -1,38 +0,0 @@
--- create the tables and load the data
-create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-
--- create the result table
-create table q17_small_quantity_order_revenue (avg_yearly double);
-create table lineitem_tmp (t_partkey int, t_avg_quantity double);
-
--- the query
-insert overwrite table lineitem_tmp
-select 
-  l_partkey as t_partkey, 0.2 * avg(l_quantity) as t_avg_quantity
-from 
-  lineitem
-group by l_partkey;
-
-insert overwrite table q17_small_quantity_order_revenue
-select
-  sum(l_extendedprice) / 7.0 as avg_yearly
-from
-  (select l_quantity, l_extendedprice, t_avg_quantity from
-   lineitem_tmp t join
-     (select
-        l_quantity, l_partkey, l_extendedprice
-      from
-        part p join lineitem l
-        on
-          p.p_partkey = l.l_partkey
-          and p.p_brand = 'Brand#23'
-          and p.p_container = 'MED BOX'
-      ) l1 on l1.l_partkey = t.t_partkey
-   ) a
-where l_quantity < t_avg_quantity;
-
-DROP TABLE lineitem;
-DROP TABLE part;
-DROP TABLE q17_small_quantity_order_revenue;
-DROP TABLE lineitem_tmp;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q18_large_volume_customer.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q18_large_volume_customer.hive b/hivesterix/hivesterix-dist/resource/tpch100/q18_large_volume_customer.hive
deleted file mode 100644
index f61bd79..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q18_large_volume_customer.hive
+++ /dev/null
@@ -1,42 +0,0 @@
--- create the tables and load the data
-create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/customer';
-
--- create the result tables
-create table q18_tmp(l_orderkey int, t_sum_quantity double);
-create table q18_large_volume_customer(c_name string, c_custkey int, o_orderkey int, o_orderdate string, o_totalprice double, sum_quantity double);
-
-set mapred.min.split.size=268435456;
-set hive.exec.reducers.bytes.per.reducer=1164000000;
-
--- the query
-insert overwrite table q18_tmp
-select 
-  l_orderkey, sum(l_quantity) as t_sum_quantity
-from 
-  lineitem
-group by l_orderkey;
-
-insert overwrite table q18_large_volume_customer
-select 
-  c_name,c_custkey,o_orderkey,o_orderdate,o_totalprice,sum(l_quantity)
-from 
-  customer c join orders o 
-  on 
-    c.c_custkey = o.o_custkey
-  join q18_tmp t 
-  on 
-    o.o_orderkey = t.l_orderkey and t.t_sum_quantity > 300
-  join lineitem l 
-  on 
-    o.o_orderkey = l.l_orderkey
-group by c_name,c_custkey,o_orderkey,o_orderdate,o_totalprice
-order by o_totalprice desc,o_orderdate
-limit 100;
-
-DROP TABLE lineitem;
-DROP TABLE orders;
-DROP TABLE customer;
-DROP TABLE q18_tmp;
-DROP TABLE q18_large_volume_customer;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q19_discounted_revenue.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q19_discounted_revenue.hive b/hivesterix/hivesterix-dist/resource/tpch100/q19_discounted_revenue.hive
deleted file mode 100644
index cb77a06..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q19_discounted_revenue.hive
+++ /dev/null
@@ -1,49 +0,0 @@
--- create the tables and load the data
-create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-
--- create the result table
-create table q19_discounted_revenue(revenue double);
-
-set mapred.min.split.size=268435456;
-set hive.exec.reducers.bytes.per.reducer=1040000000;
-
--- the query
-insert overwrite table q19_discounted_revenue
-select
-  sum(l_extendedprice * (1 - l_discount) ) as revenue
-from
-  lineitem l join part p
-  on 
-    p.p_partkey = l.l_partkey    
-where
-  (
-    p_brand = 'Brand#12'
-	and p_container REGEXP 'SM CASE||SM BOX||SM PACK||SM PKG'
-	and l_quantity >= 1 and l_quantity <= 11
-	and p_size >= 1 and p_size <= 5
-	and l_shipmode REGEXP 'AIR||AIR REG'
-	and l_shipinstruct = 'DELIVER IN PERSON'
-  ) 
-  or 
-  (
-    p_brand = 'Brand#23'
-	and p_container REGEXP 'MED BAG||MED BOX||MED PKG||MED PACK'
-	and l_quantity >= 10 and l_quantity <= 20
-	and p_size >= 1 and p_size <= 10
-	and l_shipmode REGEXP 'AIR||AIR REG'
-	and l_shipinstruct = 'DELIVER IN PERSON'
-  )
-  or
-  (
-	p_brand = 'Brand#34'
-	and p_container REGEXP 'LG CASE||LG BOX||LG PACK||LG PKG'
-	and l_quantity >= 20 and l_quantity <= 30
-	and p_size >= 1 and p_size <= 15
-	and l_shipmode REGEXP 'AIR||AIR REG'
-	and l_shipinstruct = 'DELIVER IN PERSON'
-  );
-
-DROP TABLE lineitem;
-DROP TABLE part;
-DROP TABLE q19_discounted_revenue;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q1_pricing_summary_report.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q1_pricing_summary_report.hive b/hivesterix/hivesterix-dist/resource/tpch100/q1_pricing_summary_report.hive
deleted file mode 100644
index 1899b5c..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q1_pricing_summary_report.hive
+++ /dev/null
@@ -1,21 +0,0 @@
--- create tables and load data
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-
--- create the target table
-CREATE TABLE q1_pricing_summary_report ( L_RETURNFLAG STRING, L_LINESTATUS STRING, SUM_QTY DOUBLE, SUM_BASE_PRICE DOUBLE, SUM_DISC_PRICE DOUBLE, SUM_CHARGE DOUBLE, AVE_QTY DOUBLE, AVE_PRICE DOUBLE, AVE_DISC DOUBLE, COUNT_ORDER INT);
-
-set mapred.min.split.size=536870912;
-
--- the query
-INSERT OVERWRITE TABLE q1_pricing_summary_report 
-SELECT 
-  L_RETURNFLAG, L_LINESTATUS, SUM(L_QUANTITY), SUM(L_EXTENDEDPRICE), SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)), SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)*(1+L_TAX)), AVG(L_QUANTITY), AVG(L_EXTENDEDPRICE), AVG(L_DISCOUNT), COUNT(1) 
-FROM 
-  lineitem 
-WHERE 
-  L_SHIPDATE<='1998-09-02' 
-GROUP BY L_RETURNFLAG, L_LINESTATUS 
-ORDER BY L_RETURNFLAG, L_LINESTATUS;
-
-DROP TABLE lineitem;
-DROP TABLE q1_pricing_summary_report;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q20_potential_part_promotion.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q20_potential_part_promotion.hive b/hivesterix/hivesterix-dist/resource/tpch100/q20_potential_part_promotion.hive
deleted file mode 100644
index d254793..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q20_potential_part_promotion.hive
+++ /dev/null
@@ -1,76 +0,0 @@
--- create tables and load data
-create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-create external table partsupp (PS_PARTKEY INT, PS_SUPPKEY INT, PS_AVAILQTY INT, PS_SUPPLYCOST DOUBLE, PS_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION'/tpch/100/partsupp';
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-
--- create the target table
-create table q20_tmp1(p_partkey int);
-create table q20_tmp2(l_partkey int, l_suppkey int, sum_quantity double);
-create table q20_tmp3(ps_suppkey int, ps_availqty int, sum_quantity double);
-create table q20_tmp4(ps_suppkey int);
-create table q20_potential_part_promotion(s_name string, s_address string);
-
-set mapred.min.split.size=536870912;
-
--- the query
-insert overwrite table q20_tmp1
-select distinct p_partkey
-from
-  part 
-where 
-  p_name like 'forest%';
-
-insert overwrite table q20_tmp2
-select 
-  l_partkey, l_suppkey, 0.5 * sum(l_quantity)
-from
-  lineitem
-where
-  l_shipdate >= '1994-01-01'
-  and l_shipdate < '1995-01-01'
-group by l_partkey, l_suppkey;
-
-insert overwrite table q20_tmp3
-select 
-  ps_suppkey, ps_availqty, sum_quantity
-from  
-  partsupp ps join q20_tmp1 t1 
-  on 
-    ps.ps_partkey = t1.p_partkey
-  join q20_tmp2 t2 
-  on 
-    ps.ps_partkey = t2.l_partkey and ps.ps_suppkey = t2.l_suppkey;
-
-insert overwrite table q20_tmp4
-select 
-  ps_suppkey
-from 
-  q20_tmp3
-where 
-  ps_availqty > sum_quantity
-group by ps_suppkey;
-
-insert overwrite table q20_potential_part_promotion
-select 
-  s_name, s_address
-from 
-  supplier s join nation n
-  on
-    s.s_nationkey = n.n_nationkey
-    and n.n_name = 'CANADA'
-  join q20_tmp4 t4
-  on 
-    s.s_suppkey = t4.ps_suppkey
-order by s_name;
-
-DROP TABLE partsupp;
-DROP TABLE lineitem;
-DROP TABLE supplier;
-DROP TABLE nation;
-DROP TABLE q20_tmp1;
-DROP TABLE q20_tmp2;
-DROP TABLE q20_tmp3;
-DROP TABLE q20_tmp4;
-DROP TABLE q20_potential_part_promotion;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q21_suppliers_who_kept_orders_waiting.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q21_suppliers_who_kept_orders_waiting.hive b/hivesterix/hivesterix-dist/resource/tpch100/q21_suppliers_who_kept_orders_waiting.hive
deleted file mode 100644
index 6e0344c..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q21_suppliers_who_kept_orders_waiting.hive
+++ /dev/null
@@ -1,74 +0,0 @@
--- create tables and load data
-create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-
--- create target tables
-create table q21_tmp1(l_orderkey int, count_suppkey int, max_suppkey int);
-create table q21_tmp2(l_orderkey int, count_suppkey int, max_suppkey int);
-create table q21_suppliers_who_kept_orders_waiting(s_name string, numwait int);
-
--- the query
-insert overwrite table q21_tmp1
-select
-  l_orderkey, count(distinct l_suppkey), max(l_suppkey) as max_suppkey
-from
-  lineitem
-group by l_orderkey;
-
-insert overwrite table q21_tmp2
-select
-  l_orderkey, count(distinct l_suppkey), max(l_suppkey) as max_suppkey
-from
-  lineitem
-where
-  l_receiptdate > l_commitdate
-group by l_orderkey;
-
-insert overwrite table q21_suppliers_who_kept_orders_waiting
-select
-  s_name, count(1) as numwait
-from
-  (select s_name from
-(select s_name, t2.l_orderkey, l_suppkey, count_suppkey, max_suppkey 
- from q21_tmp2 t2 right outer join
-      (select s_name, l_orderkey, l_suppkey from
-         (select s_name, t1.l_orderkey, l_suppkey, count_suppkey, max_suppkey
-          from
-            q21_tmp1 t1 join
-            (select s_name, l_orderkey, l_suppkey
-             from 
-               orders o join
-               (select s_name, l_orderkey, l_suppkey
-                from
-                  nation n join supplier s
-                  on
-                    s.s_nationkey = n.n_nationkey
-                    and n.n_name = 'SAUDI ARABIA'
-                  join lineitem l
-                  on
-                    s.s_suppkey = l.l_suppkey
-                where
-                  l.l_receiptdate > l.l_commitdate
-                ) l1 on o.o_orderkey = l1.l_orderkey and o.o_orderstatus = 'F'
-             ) l2 on l2.l_orderkey = t1.l_orderkey
-          ) a
-          where
-           (count_suppkey > 1) or ((count_suppkey=1) and (l_suppkey <> max_suppkey))
-       ) l3 on l3.l_orderkey = t2.l_orderkey
-    ) b
-    where
-     (count_suppkey is null) or ((count_suppkey=1) and (l_suppkey = max_suppkey))
-  )c
-group by s_name
-order by numwait desc, s_name
-limit 100;
-
-DROP TABLE orders;
-DROP TABLE lineitem;
-DROP TABLE supplier;
-DROP TABLE nation;
-DROP TABLE q21_tmp1;
-DROP TABLE q21_tmp2;
-DROP TABLE q21_suppliers_who_kept_orders_waiting;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q22_global_sales_opportunity.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q22_global_sales_opportunity.hive b/hivesterix/hivesterix-dist/resource/tpch100/q22_global_sales_opportunity.hive
deleted file mode 100644
index 381aa9f..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q22_global_sales_opportunity.hive
+++ /dev/null
@@ -1,69 +0,0 @@
--- create tables and load data
-create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/customer';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-
--- create target tables
-create table q22_customer_tmp(c_acctbal double, c_custkey int, cntrycode string);
-create table q22_customer_tmp1(avg_acctbal double);
-create table q22_orders_tmp(o_custkey int);
-create table q22_global_sales_opportunity(cntrycode string, numcust int, totacctbal double);
-
--- the query
-insert overwrite table q22_customer_tmp
-select 
-  c_acctbal, c_custkey, substr(c_phone, 1, 2) as cntrycode
-from 
-  customer
-where 
-  substr(c_phone, 1, 2) = '13' or
-  substr(c_phone, 1, 2) = '31' or
-  substr(c_phone, 1, 2) = '23' or
-  substr(c_phone, 1, 2) = '29' or
-  substr(c_phone, 1, 2) = '30' or
-  substr(c_phone, 1, 2) = '18' or
-  substr(c_phone, 1, 2) = '17';
- 
-insert overwrite table q22_customer_tmp1
-select
-  avg(c_acctbal)
-from
-  q22_customer_tmp
-where
-  c_acctbal > 0.00;
-
-insert overwrite table q22_orders_tmp
-select 
-  o_custkey 
-from 
-  orders
-group by 
-  o_custkey;
-
-insert overwrite table q22_global_sales_opportunity
-select
-  cntrycode, count(1) as numcust, sum(c_acctbal) as totacctbal
-from
-(
-  select cntrycode, c_acctbal, avg_acctbal from
-  q22_customer_tmp1 ct1 join
-  (
-    select cntrycode, c_acctbal from
-      q22_orders_tmp ot 
-      right outer join q22_customer_tmp ct 
-      on
-        ct.c_custkey = ot.o_custkey
-    where
-      o_custkey is null
-  ) ct2
-) a
-where
-  c_acctbal > avg_acctbal
-group by cntrycode
-order by cntrycode;
-
-DROP TABLE customer;
-DROP TABLE orders;
-DROP TABLE q22_customer_tmp;
-DROP TABLE q22_customer_tmp1;
-DROP TABLE q22_orders_tmp;
-DROP TABLE q22_global_sales_opportunity;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q2_minimum_cost_supplier.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q2_minimum_cost_supplier.hive b/hivesterix/hivesterix-dist/resource/tpch100/q2_minimum_cost_supplier.hive
deleted file mode 100644
index afea998..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q2_minimum_cost_supplier.hive
+++ /dev/null
@@ -1,55 +0,0 @@
--- create the tables and load the data
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table partsupp (PS_PARTKEY INT, PS_SUPPKEY INT, PS_AVAILQTY INT, PS_SUPPLYCOST DOUBLE, PS_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION'/tpch/100/partsupp';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-create external table region (R_REGIONKEY INT, R_NAME STRING, R_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/region';
-
--- create result tables
-create table q2_minimum_cost_supplier_tmp1 (s_acctbal double, s_name string, n_name string, p_partkey int, ps_supplycost double, p_mfgr string, s_address string, s_phone string, s_comment string);
-create table q2_minimum_cost_supplier_tmp2 (p_partkey int, ps_min_supplycost double);
-create table q2_minimum_cost_supplier (s_acctbal double, s_name string, n_name string, p_partkey int, p_mfgr string, s_address string, s_phone string, s_comment string);
-
--- the query
-insert overwrite table q2_minimum_cost_supplier_tmp1 
-select 
-  s.s_acctbal, s.s_name, n.n_name, p.p_partkey, ps.ps_supplycost, p.p_mfgr, s.s_address, s.s_phone, s.s_comment 
-from 
-  nation n join region r 
-  on 
-    n.n_regionkey = r.r_regionkey and r.r_name = 'EUROPE' 
-  join supplier s 
-  on 
-s.s_nationkey = n.n_nationkey 
-  join partsupp ps 
-  on  
-s.s_suppkey = ps.ps_suppkey 
-  join part p 
-  on 
-    p.p_partkey = ps.ps_partkey and p.p_size = 15 and p.p_type like '%BRASS' ;
-
-insert overwrite table q2_minimum_cost_supplier_tmp2 
-select 
-  p_partkey, min(ps_supplycost) 
-from  
-  q2_minimum_cost_supplier_tmp1 
-group by p_partkey;
-
-insert overwrite table q2_minimum_cost_supplier 
-select 
-  t1.s_acctbal, t1.s_name, t1.n_name, t1.p_partkey, t1.p_mfgr, t1.s_address, t1.s_phone, t1.s_comment 
-from 
-  q2_minimum_cost_supplier_tmp1 t1 join q2_minimum_cost_supplier_tmp2 t2 
-on 
-  t1.p_partkey = t2.p_partkey and t1.ps_supplycost=t2.ps_min_supplycost 
-order by s_acctbal desc, n_name, s_name, p_partkey 
-limit 100;
-
-DROP TABLE part;
-DROP TABLE supplier;
-DROP TABLE partsupp;
-DROP TABLE nation;
-DROP TABLE region;
-DROP TABLE q2_minimum_cost_supplier;
-DROP TABLE q2_minimum_cost_supplier_tmp1;
-DROP TABLE q2_minimum_cost_supplier_tmp2;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q3_shipping_priority.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q3_shipping_priority.hive b/hivesterix/hivesterix-dist/resource/tpch100/q3_shipping_priority.hive
deleted file mode 100644
index 9e82c99..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q3_shipping_priority.hive
+++ /dev/null
@@ -1,30 +0,0 @@
--- create tables and load data
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/customer';
-
--- create the target table
-create table q3_shipping_priority (l_orderkey int, revenue double, o_orderdate string, o_shippriority int);
-
-set mapred.min.split.size=536870912;
-set hive.exec.reducers.bytes.per.reducer=1024000000;
-
--- the query
-Insert overwrite table q3_shipping_priority
-select
-  l_orderkey, sum(l_extendedprice*(1-l_discount)) as revenue, o_orderdate, o_shippriority
-from
-  customer c join orders o
-    on c.c_mktsegment = 'BUILDING' and c.c_custkey = o.o_custkey
-  join lineitem l
-    on l.l_orderkey = o.o_orderkey
-where
-  o_orderdate < '1995-03-15' and l_shipdate > '1995-03-15'
-group by l_orderkey, o_orderdate, o_shippriority
-order by revenue desc, o_orderdate
-limit 10;
-
-DROP TABLE orders;
-DROP TABLE lineitem;
-DROP TABLE customer;
-DROP TABLE q3_shipping_priority;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q4_order_priority.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q4_order_priority.hive b/hivesterix/hivesterix-dist/resource/tpch100/q4_order_priority.hive
deleted file mode 100644
index decc493..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q4_order_priority.hive
+++ /dev/null
@@ -1,30 +0,0 @@
--- create tables and load data
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-
--- create the target table
-CREATE TABLE q4_order_priority_tmp (O_ORDERKEY INT);
-CREATE TABLE q4_order_priority (O_ORDERPRIORITY STRING, ORDER_COUNT INT);
-
-set mapred.min.split.size=536870912;
--- the query
-INSERT OVERWRITE TABLE q4_order_priority_tmp 
-select 
-  DISTINCT l_orderkey 
-from 
-  lineitem 
-where 
-  l_commitdate < l_receiptdate;
-INSERT OVERWRITE TABLE q4_order_priority 
-select o_orderpriority, count(1) as order_count 
-from 
-  orders o join q4_order_priority_tmp t 
-  on 
-o.o_orderkey = t.o_orderkey and o.o_orderdate >= '1993-07-01' and o.o_orderdate < '1993-10-01' 
-group by o_orderpriority 
-order by o_orderpriority;
-
-DROP TABLE orders;
-DROP TABLE lineitem;
-DROP TABLE q4_order_priority_tmp;
-DROP TABLE q4_order_priority;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q5_local_supplier_volume.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q5_local_supplier_volume.hive b/hivesterix/hivesterix-dist/resource/tpch100/q5_local_supplier_volume.hive
deleted file mode 100644
index bd10d75..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q5_local_supplier_volume.hive
+++ /dev/null
@@ -1,41 +0,0 @@
--- create tables and load data
-create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/customer';
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-create external table region (R_REGIONKEY INT, R_NAME STRING, R_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/region';
-
--- create the target table
-create table q5_local_supplier_volume (N_NAME STRING, REVENUE DOUBLE);
-
-set mapred.min.split.size=536870912;
-
--- the query
-insert overwrite table q5_local_supplier_volume 
-select 
-  n_name, sum(l_extendedprice * (1 - l_discount)) as revenue 
-from
-  customer c join
-    ( select n_name, l_extendedprice, l_discount, s_nationkey, o_custkey from orders o join
-      ( select n_name, l_extendedprice, l_discount, l_orderkey, s_nationkey from lineitem l join
-        ( select n_name, s_suppkey, s_nationkey from supplier s join
-          ( select n_name, n_nationkey 
-            from nation n join region r 
-            on n.n_regionkey = r.r_regionkey and r.r_name = 'ASIA'
-          ) n1 on s.s_nationkey = n1.n_nationkey
-        ) s1 on l.l_suppkey = s1.s_suppkey
-      ) l1 on l1.l_orderkey = o.o_orderkey and o.o_orderdate >= '1994-01-01' 
-              and o.o_orderdate < '1995-01-01'
-) o1 
-on c.c_nationkey = o1.s_nationkey and c.c_custkey = o1.o_custkey
-group by n_name 
-order by revenue desc;
-
-DROP TABLE customer;
-DROP TABLE orders;
-DROP TABLE lineitem;
-DROP TABLE supplier;
-DROP TABLE nation;
-DROP TABLE region;
-DROP TABLE q5_local_supplier_volume;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q6_forecast_revenue_change.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q6_forecast_revenue_change.hive b/hivesterix/hivesterix-dist/resource/tpch100/q6_forecast_revenue_change.hive
deleted file mode 100644
index 4840fb0..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q6_forecast_revenue_change.hive
+++ /dev/null
@@ -1,20 +0,0 @@
--- create tables and load data
-create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-
--- create the target table
-create table q6_forecast_revenue_change (revenue double);
-
--- the query
-insert overwrite table q6_forecast_revenue_change 
-select 
-  sum(l_extendedprice*l_discount) as revenue
-from 
-  lineitem
-where 
-  l_shipdate >= '1994-01-01'
-  and l_shipdate < '1995-01-01'
-  and l_discount >= 0.05 and l_discount <= 0.07
-  and l_quantity < 24;
-
-DROP TABLE lineitem;
-DROP TABLE q6_forecast_revenue_change;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q7_volume_shipping.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q7_volume_shipping.hive b/hivesterix/hivesterix-dist/resource/tpch100/q7_volume_shipping.hive
deleted file mode 100644
index dd6b416..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q7_volume_shipping.hive
+++ /dev/null
@@ -1,70 +0,0 @@
--- create tables and load data
-create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/customer';
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-
--- create the target table
-create table q7_volume_shipping (supp_nation string, cust_nation string, l_year int, revenue double);
-create table q7_volume_shipping_tmp(supp_nation string, cust_nation string, s_nationkey int, c_nationkey int);
-
-set mapred.min.split.size=536870912;
-set hive.exec.reducers.bytes.per.reducer=1225000000;
-
--- the query
-insert overwrite table q7_volume_shipping_tmp
-select 
-  * 
-from
-  (
-    select 
-      n1.n_name as supp_nation, n2.n_name as cust_nation, n1.n_nationkey as s_nationkey,      
-      n2.n_nationkey as c_nationkey
-from 
-  nation n1 join nation n2 
-  on 
-    n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY'
-    UNION ALL
-select 
-  n1.n_name as supp_nation, n2.n_name as cust_nation, n1.n_nationkey as s_nationkey, 
-  n2.n_nationkey as c_nationkey
-from 
-  nation n1 join nation n2 
-  on 
-    n2.n_name = 'FRANCE' and n1.n_name = 'GERMANY'
-) a;
-
-insert overwrite table q7_volume_shipping 
-select 
-  supp_nation, cust_nation, l_year, sum(volume) as revenue
-from 
-  (
-    select
-      supp_nation, cust_nation, year(l_shipdate) as l_year, 
-      l_extendedprice * (1 - l_discount) as volume
-    from
-      q7_volume_shipping_tmp t join
-        (select l_shipdate, l_extendedprice, l_discount, c_nationkey, s_nationkey 
-         from supplier s join
-           (select l_shipdate, l_extendedprice, l_discount, l_suppkey, c_nationkey 
-            from customer c join
-              (select l_shipdate, l_extendedprice, l_discount, l_suppkey, o_custkey 
-               from orders o join lineitem l 
-               on 
-                 o.o_orderkey = l.l_orderkey and l.l_shipdate >= '1995-01-01' 
-                 and l.l_shipdate <= '1996-12-31'
-               ) l1 on c.c_custkey = l1.o_custkey
-            ) l2 on s.s_suppkey = l2.l_suppkey
-         ) l3 on l3.c_nationkey = t.c_nationkey and l3.s_nationkey = t.s_nationkey
-   ) shipping
-group by supp_nation, cust_nation, l_year
-order by supp_nation, cust_nation, l_year;
-
-DROP TABLE customer;
-DROP TABLE orders;
-DROP TABLE lineitem;
-DROP TABLE supplier;
-DROP TABLE nation;
-DROP TABLE q7_volume_shipping;
-DROP TABLE q7_volume_shipping_tmp;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q8_national_market_share.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q8_national_market_share.hive b/hivesterix/hivesterix-dist/resource/tpch100/q8_national_market_share.hive
deleted file mode 100644
index 72d8b69..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q8_national_market_share.hive
+++ /dev/null
@@ -1,55 +0,0 @@
--- create the tables and load the data
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/customer';
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-create external table region (R_REGIONKEY INT, R_NAME STRING, R_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/region';
-
--- create the result table
-create table q8_national_market_share(o_year string, mkt_share double);
-
--- the query
-insert overwrite table q8_national_market_share 
-select 
-  o_year, sum(case when nation = 'BRAZIL' then volume else 0.0 end) / sum(volume) as mkt_share
-from 
-  (
-select 
-  year(o_orderdate) as o_year, l_extendedprice * (1-l_discount) as volume, 
-  n2.n_name as nation
-    from
-      nation n2 join
-        (select o_orderdate, l_discount, l_extendedprice, s_nationkey 
-         from supplier s join
-          (select o_orderdate, l_discount, l_extendedprice, l_suppkey 
-           from part p join
-             (select o_orderdate, l_partkey, l_discount, l_extendedprice, l_suppkey 
-              from lineitem l join
-                (select o_orderdate, o_orderkey 
-                 from orders o join
-                   (select c.c_custkey 
-                    from customer c join
-                      (select n1.n_nationkey 
-                       from nation n1 join region r
-                       on n1.n_regionkey = r.r_regionkey and r.r_name = 'AMERICA'
-                       ) n11 on c.c_nationkey = n11.n_nationkey
-                    ) c1 on c1.c_custkey = o.o_custkey
-                 ) o1 on l.l_orderkey = o1.o_orderkey and o1.o_orderdate >= '1995-01-01' 
-                         and o1.o_orderdate < '1996-12-31'
-              ) l1 on p.p_partkey = l1.l_partkey and p.p_type = 'ECONOMY ANODIZED STEEL'
-           ) p1 on s.s_suppkey = p1.l_suppkey
-        ) s1 on s1.s_nationkey = n2.n_nationkey
-  ) all_nation
-group by o_year
-order by o_year;
-
-DROP TABLE customer;
-DROP TABLE orders;
-DROP TABLE lineitem;
-DROP TABLE supplier;
-DROP TABLE nation;
-DROP TABLE region;
-DROP TABLE part;
-DROP TABLE q8_national_market_share;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/resource/tpch100/q9_product_type_profit.hive
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/resource/tpch100/q9_product_type_profit.hive b/hivesterix/hivesterix-dist/resource/tpch100/q9_product_type_profit.hive
deleted file mode 100644
index 2519475..0000000
--- a/hivesterix/hivesterix-dist/resource/tpch100/q9_product_type_profit.hive
+++ /dev/null
@@ -1,50 +0,0 @@
--- create the tables and load the data
-create external table part (P_PARTKEY INT, P_NAME STRING, P_MFGR STRING, P_BRAND STRING, P_TYPE STRING, P_SIZE INT, P_CONTAINER STRING, P_RETAILPRICE DOUBLE, P_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/part';
-Create external table lineitem (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DOUBLE, L_EXTENDEDPRICE DOUBLE, L_DISCOUNT DOUBLE, L_TAX DOUBLE, L_RETURNFLAG STRING, L_LINESTATUS STRING, L_SHIPDATE STRING, L_COMMITDATE STRING, L_RECEIPTDATE STRING, L_SHIPINSTRUCT STRING, L_SHIPMODE STRING, L_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/lineitem';
-create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/orders';
-create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/supplier';
-create external table partsupp (PS_PARTKEY INT, PS_SUPPKEY INT, PS_AVAILQTY INT, PS_SUPPLYCOST DOUBLE, PS_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION'/tpch/100/partsupp';
-create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/100/nation';
-
--- create the result table
-create table q9_product_type_profit (nation string, o_year string, sum_profit double);
-
-set mapred.min.split.size=536870912;
-set hive.exec.reducers.bytes.per.reducer=1024000000;
-
--- the query
-insert overwrite table q9_product_type_profit
-select 
-  nation, o_year, sum(amount) as sum_profit
-from 
-  (
-select 
-  n_name as nation, year(o_orderdate) as o_year, 
-  l_extendedprice * (1 - l_discount) -  ps_supplycost * l_quantity as amount
-    from
-      orders o join
-      (select l_extendedprice, l_discount, l_quantity, l_orderkey, n_name, ps_supplycost 
-       from part p join
-         (select l_extendedprice, l_discount, l_quantity, l_partkey, l_orderkey, 
-                 n_name, ps_supplycost 
-          from partsupp ps join
-            (select l_suppkey, l_extendedprice, l_discount, l_quantity, l_partkey, 
-                    l_orderkey, n_name 
-             from
-               (select s_suppkey, n_name 
-                from nation n join supplier s on n.n_nationkey = s.s_nationkey
-               ) s1 join lineitem l on s1.s_suppkey = l.l_suppkey
-            ) l1 on ps.ps_suppkey = l1.l_suppkey and ps.ps_partkey = l1.l_partkey
-         ) l2 on p.p_name like '%green%' and p.p_partkey = l2.l_partkey
-     ) l3 on o.o_orderkey = l3.l_orderkey
-  )profit
-group by nation, o_year
-order by nation, o_year desc;
-
-DROP TABLE part;
-DROP TABLE lineitem;
-DROP TABLE supplier;
-DROP TABLE orders;
-DROP TABLE partsupp;
-DROP TABLE nation;
-DROP TABLE q9_product_type_profit;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/src/main/assembly/binary-assembly.xml
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/src/main/assembly/binary-assembly.xml b/hivesterix/hivesterix-dist/src/main/assembly/binary-assembly.xml
deleted file mode 100755
index e2da26a..0000000
--- a/hivesterix/hivesterix-dist/src/main/assembly/binary-assembly.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!-- ! Copyright 2009-2013 by The Regents of the University of California 
-	! Licensed under the Apache License, Version 2.0 (the "License"); ! you may 
-	not use this file except in compliance with the License. ! you may obtain 
-	a copy of the License from ! ! http://www.apache.org/licenses/LICENSE-2.0 
-	! ! Unless required by applicable law or agreed to in writing, software ! 
-	distributed under the License is distributed on an "AS IS" BASIS, ! WITHOUT 
-	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ! See the 
-	License for the specific language governing permissions and ! limitations 
-	under the License. ! -->
-<assembly>
-	<id>binary-assembly</id>
-	<formats>
-		<format>zip</format>
-		<format>dir</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>src/main/resources/conf</directory>
-			<outputDirectory>conf</outputDirectory>
-			<fileMode>0755</fileMode>
-		</fileSet>
-		<fileSet>
-			<directory>src/main/resources/scripts</directory>
-			<outputDirectory>bin</outputDirectory>
-			<fileMode>0755</fileMode>
-		</fileSet>
-		<fileSet>
-			<directory>target/appassembler/lib</directory>
-			<outputDirectory>lib</outputDirectory>
-			<includes>
-				<include>*.jar</include>
-			</includes>
-			<fileMode>0755</fileMode>
-		</fileSet>
-		<fileSet>
-			<directory>target</directory>
-			<outputDirectory>lib</outputDirectory>
-			<includes>
-				<include>a-hive-patch.jar</include>
-			</includes>
-			<fileMode>0755</fileMode>
-		</fileSet>
-	</fileSets>
-</assembly>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/HyracksExecutionEngine.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/HyracksExecutionEngine.java b/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/HyracksExecutionEngine.java
deleted file mode 100644
index a95edd8..0000000
--- a/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/HyracksExecutionEngine.java
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hivesterix.runtime.exec;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.hadoop.hive.ql.exec.ConditionalTask;
-import org.apache.hadoop.hive.ql.exec.FileSinkOperator;
-import org.apache.hadoop.hive.ql.exec.MapRedTask;
-import org.apache.hadoop.hive.ql.exec.MoveTask;
-import org.apache.hadoop.hive.ql.exec.Operator;
-import org.apache.hadoop.hive.ql.exec.TableScanOperator;
-import org.apache.hadoop.hive.ql.exec.Task;
-import org.apache.hadoop.hive.ql.exec.Utilities;
-import org.apache.hadoop.hive.ql.plan.DynamicPartitionCtx;
-import org.apache.hadoop.hive.ql.plan.FetchWork;
-import org.apache.hadoop.hive.ql.plan.FileSinkDesc;
-import org.apache.hadoop.hive.ql.plan.MapredLocalWork;
-import org.apache.hadoop.hive.ql.plan.MapredWork;
-import org.apache.hadoop.hive.ql.plan.OperatorDesc;
-import org.apache.hadoop.hive.ql.plan.PartitionDesc;
-import org.apache.hadoop.hive.ql.plan.TableScanDesc;
-import org.apache.hadoop.mapred.Reporter;
-
-import edu.uci.ics.hivesterix.common.config.ConfUtil;
-import edu.uci.ics.hivesterix.logical.expression.HiveExpressionTypeComputer;
-import edu.uci.ics.hivesterix.logical.expression.HiveMergeAggregationExpressionFactory;
-import edu.uci.ics.hivesterix.logical.expression.HiveNullableTypeComputer;
-import edu.uci.ics.hivesterix.logical.expression.HivePartialAggregationTypeComputer;
-import edu.uci.ics.hivesterix.logical.plan.HiveAlgebricksTranslator;
-import edu.uci.ics.hivesterix.logical.plan.HiveLogicalPlanAndMetaData;
-import edu.uci.ics.hivesterix.optimizer.rulecollections.HiveRuleCollections;
-import edu.uci.ics.hivesterix.runtime.factory.evaluator.HiveExpressionRuntimeProvider;
-import edu.uci.ics.hivesterix.runtime.factory.nullwriter.HiveNullWriterFactory;
-import edu.uci.ics.hivesterix.runtime.inspector.HiveBinaryBooleanInspectorFactory;
-import edu.uci.ics.hivesterix.runtime.inspector.HiveBinaryIntegerInspectorFactory;
-import edu.uci.ics.hivesterix.runtime.jobgen.HiveConnectorPolicyAssignmentPolicy;
-import edu.uci.ics.hivesterix.runtime.jobgen.HiveConnectorPolicyAssignmentPolicy.Policy;
-import edu.uci.ics.hivesterix.runtime.provider.HiveBinaryComparatorFactoryProvider;
-import edu.uci.ics.hivesterix.runtime.provider.HiveBinaryHashFunctionFactoryProvider;
-import edu.uci.ics.hivesterix.runtime.provider.HiveBinaryHashFunctionFamilyProvider;
-import edu.uci.ics.hivesterix.runtime.provider.HiveNormalizedKeyComputerFactoryProvider;
-import edu.uci.ics.hivesterix.runtime.provider.HivePrinterFactoryProvider;
-import edu.uci.ics.hivesterix.runtime.provider.HiveSerializerDeserializerProvider;
-import edu.uci.ics.hivesterix.runtime.provider.HiveTypeTraitProvider;
-import edu.uci.ics.hyracks.algebricks.common.constraints.AlgebricksAbsolutePartitionConstraint;
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
-import edu.uci.ics.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder;
-import edu.uci.ics.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder.DefaultOptimizationContextFactory;
-import edu.uci.ics.hyracks.algebricks.compiler.api.ICompiler;
-import edu.uci.ics.hyracks.algebricks.compiler.api.ICompilerFactory;
-import edu.uci.ics.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController;
-import edu.uci.ics.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlan;
-import edu.uci.ics.hyracks.algebricks.core.algebra.base.ILogicalPlanAndMetadata;
-import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.AbstractRuleController;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule;
-import edu.uci.ics.hyracks.algebricks.core.rewriter.base.PhysicalOptimizationConfig;
-import edu.uci.ics.hyracks.api.client.HyracksConnection;
-import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
-import edu.uci.ics.hyracks.api.job.JobId;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class HyracksExecutionEngine implements IExecutionEngine {
-
-    private static final Log LOG = LogFactory.getLog(HyracksExecutionEngine.class.getName());
-    private static final String clusterPropertiesPath = "conf/cluster.properties";
-    private static final String masterFilePath = "conf/master";
-
-    private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> DEFAULT_LOGICAL_REWRITES = new ArrayList<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>>();
-    private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> DEFAULT_PHYSICAL_REWRITES = new ArrayList<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>>();
-    static {
-        SequentialFixpointRuleController seqCtrlNoDfs = new SequentialFixpointRuleController(false);
-        SequentialFixpointRuleController seqCtrlFullDfs = new SequentialFixpointRuleController(true);
-        SequentialOnceRuleController seqOnceCtrl = new SequentialOnceRuleController(true);
-        DEFAULT_LOGICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlFullDfs,
-                HiveRuleCollections.NORMALIZATION));
-        DEFAULT_LOGICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                HiveRuleCollections.COND_PUSHDOWN_AND_JOIN_INFERENCE));
-        DEFAULT_LOGICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlFullDfs,
-                HiveRuleCollections.LOAD_FIELDS));
-        DEFAULT_LOGICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                HiveRuleCollections.OP_PUSHDOWN));
-        DEFAULT_LOGICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl,
-                HiveRuleCollections.DATA_EXCHANGE));
-        DEFAULT_LOGICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs,
-                HiveRuleCollections.CONSOLIDATION));
-
-        DEFAULT_PHYSICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl,
-                HiveRuleCollections.PHYSICAL_PLAN_REWRITES));
-        DEFAULT_PHYSICAL_REWRITES.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl,
-                HiveRuleCollections.prepareJobGenRules));
-    }
-
-    /**
-     * static configurations for compiler
-     */
-    private HeuristicCompilerFactoryBuilder builder;
-
-    /**
-     * compiler
-     */
-    private ICompiler compiler;
-
-    /**
-     * physical optimization config
-     */
-    private PhysicalOptimizationConfig physicalOptimizationConfig;
-
-    /**
-     * final ending operators
-     */
-    private List<Operator> leaveOps = new ArrayList<Operator>();
-
-    /**
-     * tasks that are already visited
-     */
-    private Map<Task<? extends Serializable>, Boolean> tasksVisited = new HashMap<Task<? extends Serializable>, Boolean>();
-
-    /**
-     * hyracks job spec
-     */
-    private JobSpecification jobSpec;
-
-    /**
-     * hive configuration
-     */
-    private HiveConf conf;
-
-    /**
-     * plan printer
-     */
-    private PrintWriter planPrinter;
-
-    /**
-     * properties
-     */
-    private Properties clusterProps;
-
-    /**
-     * the Hyracks client connection
-     */
-    private IHyracksClientConnection hcc;
-
-    public HyracksExecutionEngine(HiveConf conf) {
-        this.conf = conf;
-        init(conf);
-    }
-
-    public HyracksExecutionEngine(HiveConf conf, PrintWriter planPrinter) {
-        this.conf = conf;
-        this.planPrinter = planPrinter;
-        init(conf);
-    }
-
-    private void init(HiveConf conf) {
-        builder = new HeuristicCompilerFactoryBuilder(DefaultOptimizationContextFactory.INSTANCE);
-        builder.setLogicalRewrites(DEFAULT_LOGICAL_REWRITES);
-        builder.setPhysicalRewrites(DEFAULT_PHYSICAL_REWRITES);
-        builder.setIMergeAggregationExpressionFactory(HiveMergeAggregationExpressionFactory.INSTANCE);
-        builder.setExpressionTypeComputer(HiveExpressionTypeComputer.INSTANCE);
-        builder.setNullableTypeComputer(HiveNullableTypeComputer.INSTANCE);
-
-        long memSizeExternalGby = conf.getLong("hive.algebricks.groupby.external.memory", 268435456);
-        long memSizeExternalSort = conf.getLong("hive.algebricks.sort.memory", 536870912);
-        int frameSize = conf.getInt("hive.algebricks.framesize", 32768);
-
-        physicalOptimizationConfig = new PhysicalOptimizationConfig();
-        int frameLimitExtGby = (int) (memSizeExternalGby / frameSize);
-        physicalOptimizationConfig.setMaxFramesExternalGroupBy(frameLimitExtGby);
-        int frameLimitExtSort = (int) (memSizeExternalSort / frameSize);
-        physicalOptimizationConfig.setMaxFramesExternalSort(frameLimitExtSort);
-        builder.setPhysicalOptimizationConfig(physicalOptimizationConfig);
-    }
-
-    @Override
-    public int compileJob(List<Task<? extends Serializable>> rootTasks) {
-        // clean up
-        leaveOps.clear();
-        tasksVisited.clear();
-        jobSpec = null;
-
-        HashMap<String, PartitionDesc> aliasToPath = new HashMap<String, PartitionDesc>();
-        List<Operator> rootOps = generateRootOperatorDAG(rootTasks, aliasToPath);
-
-        // get all leave Ops
-        getLeaves(rootOps, leaveOps);
-        HiveAlgebricksTranslator translator = new HiveAlgebricksTranslator();
-        try {
-            translator.translate(rootOps, null, aliasToPath);
-
-            ILogicalPlan plan = translator.genLogicalPlan();
-
-            if (plan.getRoots() != null && plan.getRoots().size() > 0 && plan.getRoots().get(0).getValue() != null) {
-                //translator.printOperators();
-                ILogicalPlanAndMetadata planAndMetadata = new HiveLogicalPlanAndMetaData(plan,
-                        translator.getMetadataProvider());
-
-                ICompilerFactory compilerFactory = builder.create();
-                compiler = compilerFactory.createCompiler(planAndMetadata.getPlan(),
-                        planAndMetadata.getMetadataProvider(), translator.getVariableCounter());
-
-                // run optimization and re-writing rules for Hive plan
-                compiler.optimize();
-
-                // print optimized plan
-                LogicalOperatorPrettyPrintVisitor pvisitor = new LogicalOperatorPrettyPrintVisitor();
-                StringBuilder buffer = new StringBuilder();
-                PlanPrettyPrinter.printPlan(plan, buffer, pvisitor, 0);
-                String planStr = buffer.toString();
-                LOG.info(planStr);
-
-                if (planPrinter != null)
-                    planPrinter.print(planStr);
-            } else {
-                /** it is not a map reduce task DAG */
-                return 2;
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            return 1;
-        }
-
-        return 0;
-    }
-
-    private void codeGen() throws AlgebricksException {
-        try {
-            // number of cpu cores in the cluster
-            builder.setClusterLocations(new AlgebricksAbsolutePartitionConstraint(ConfUtil.getNCs()));
-        } catch (Exception e) {
-            throw new AlgebricksException(e);
-        }
-        // builder.setClusterTopology(ConfUtil.getClusterTopology());
-        builder.setBinaryBooleanInspectorFactory(HiveBinaryBooleanInspectorFactory.INSTANCE);
-        builder.setBinaryIntegerInspectorFactory(HiveBinaryIntegerInspectorFactory.INSTANCE);
-        builder.setComparatorFactoryProvider(HiveBinaryComparatorFactoryProvider.INSTANCE);
-        builder.setExpressionRuntimeProvider(HiveExpressionRuntimeProvider.INSTANCE);
-        builder.setHashFunctionFactoryProvider(HiveBinaryHashFunctionFactoryProvider.INSTANCE);
-        builder.setPrinterProvider(HivePrinterFactoryProvider.INSTANCE);
-        builder.setSerializerDeserializerProvider(HiveSerializerDeserializerProvider.INSTANCE);
-        builder.setNullWriterFactory(HiveNullWriterFactory.INSTANCE);
-        builder.setNormalizedKeyComputerFactoryProvider(HiveNormalizedKeyComputerFactoryProvider.INSTANCE);
-        builder.setPartialAggregationTypeComputer(HivePartialAggregationTypeComputer.INSTANCE);
-        builder.setTypeTraitProvider(HiveTypeTraitProvider.INSTANCE);
-        builder.setHashFunctionFamilyProvider(HiveBinaryHashFunctionFamilyProvider.INSTANCE);
-
-        jobSpec = compiler.createJob(null, null);
-
-        // set the policy
-        String policyStr = conf.get("hive.hyracks.connectorpolicy");
-        if (policyStr == null)
-            policyStr = "PIPELINING";
-        Policy policyValue = Policy.valueOf(policyStr);
-        jobSpec.setConnectorPolicyAssignmentPolicy(new HiveConnectorPolicyAssignmentPolicy(policyValue));
-        jobSpec.setUseConnectorPolicyForScheduling(false);
-    }
-
-    @Override
-    public int executeJob() {
-        try {
-            codeGen();
-            executeHyracksJob(jobSpec);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return 1;
-        }
-        return 0;
-    }
-
-    private List<Operator> generateRootOperatorDAG(List<Task<? extends Serializable>> rootTasks,
-            HashMap<String, PartitionDesc> aliasToPath) {
-
-        List<Operator> rootOps = new ArrayList<Operator>();
-        List<Task<? extends Serializable>> toDelete = new ArrayList<Task<? extends Serializable>>();
-        tasksVisited.clear();
-
-        for (int i = rootTasks.size() - 1; i >= 0; i--) {
-            /**
-             * list of map-reduce tasks
-             */
-            Task<? extends Serializable> task = rootTasks.get(i);
-
-            if (task instanceof MapRedTask) {
-                List<Operator> mapRootOps = articulateMapReduceOperators(task, rootOps, aliasToPath, rootTasks);
-                if (i == 0)
-                    rootOps.addAll(mapRootOps);
-                else {
-                    List<Operator> leaves = new ArrayList<Operator>();
-                    getLeaves(rootOps, leaves);
-
-                    List<Operator> mapChildren = new ArrayList<Operator>();
-                    for (Operator childMap : mapRootOps) {
-                        if (childMap instanceof TableScanOperator) {
-                            TableScanDesc topDesc = (TableScanDesc) childMap.getConf();
-                            if (topDesc == null)
-                                mapChildren.add(childMap);
-                            else {
-                                rootOps.add(childMap);
-                            }
-                        } else
-                            mapChildren.add(childMap);
-                    }
-
-                    if (mapChildren.size() > 0) {
-                        for (Operator leaf : leaves)
-                            leaf.setChildOperators(mapChildren);
-                        for (Operator child : mapChildren)
-                            child.setParentOperators(leaves);
-                    }
-                }
-
-                MapredWork mr = (MapredWork) task.getWork();
-                HashMap<String, PartitionDesc> map = mr.getAliasToPartnInfo();
-
-                addAliasToPartition(aliasToPath, map);
-                toDelete.add(task);
-            }
-        }
-
-        for (Task<? extends Serializable> task : toDelete)
-            rootTasks.remove(task);
-
-        return rootOps;
-    }
-
-    private void addAliasToPartition(HashMap<String, PartitionDesc> aliasToPath, HashMap<String, PartitionDesc> map) {
-        Iterator<String> keys = map.keySet().iterator();
-        while (keys.hasNext()) {
-            String key = keys.next();
-            PartitionDesc part = map.get(key);
-            String[] names = key.split(":");
-            for (String name : names) {
-                aliasToPath.put(name, part);
-            }
-        }
-    }
-
-    private List<Operator> articulateMapReduceOperators(Task task, List<Operator> rootOps,
-            HashMap<String, PartitionDesc> aliasToPath, List<Task<? extends Serializable>> rootTasks) {
-        // System.out.println("!"+task.getName());
-        if (!(task instanceof MapRedTask)) {
-            if (!(task instanceof ConditionalTask)) {
-                rootTasks.add(task);
-                return null;
-            } else {
-                // remove map-reduce branches in condition task
-                ConditionalTask condition = (ConditionalTask) task;
-                List<Task<? extends Serializable>> branches = condition.getListTasks();
-                for (Task branch : branches) {
-                    if (branch instanceof MoveTask) {
-                        //return articulateMapReduceOperators(branch, rootOps, aliasToPath, rootTasks);
-                        return null;
-                    }
-                }
-                for (int i = branches.size() - 1; i >= 0; i--) {
-                    Task branch = branches.get(i);
-                    if (branch instanceof MapRedTask) {
-                        return articulateMapReduceOperators(branch, rootOps, aliasToPath, rootTasks);
-                    }
-                }
-                rootTasks.add(task);
-                return null;
-            }
-        }
-
-        MapredWork mr = (MapredWork) task.getWork();
-        HashMap<String, PartitionDesc> map = mr.getAliasToPartnInfo();
-
-        // put all aliasToParitionDesc mapping into the map
-        addAliasToPartition(aliasToPath, map);
-
-        MapRedTask mrtask = (MapRedTask) task;
-        MapredWork work = (MapredWork) mrtask.getWork();
-        HashMap<String, Operator<? extends OperatorDesc>> operators = work.getAliasToWork();
-
-        Set entries = operators.entrySet();
-        Iterator<Entry<String, Operator>> iterator = entries.iterator();
-        List<Operator> mapRootOps = new ArrayList<Operator>();
-
-        // get map root operators
-        while (iterator.hasNext()) {
-            Operator next = iterator.next().getValue();
-            if (!mapRootOps.contains(next)) {
-                // clear that only for the case of union
-                mapRootOps.add(next);
-            }
-        }
-
-        // get map local work
-        MapredLocalWork localWork = work.getMapLocalWork();
-        if (localWork != null) {
-            HashMap<String, Operator<? extends OperatorDesc>> localOperators = localWork.getAliasToWork();
-
-            Set localEntries = localOperators.entrySet();
-            Iterator<Entry<String, Operator>> localIterator = localEntries.iterator();
-            while (localIterator.hasNext()) {
-                mapRootOps.add(localIterator.next().getValue());
-            }
-
-            HashMap<String, FetchWork> localFetch = localWork.getAliasToFetchWork();
-            Set localFetchEntries = localFetch.entrySet();
-            Iterator<Entry<String, FetchWork>> localFetchIterator = localFetchEntries.iterator();
-            while (localFetchIterator.hasNext()) {
-                Entry<String, FetchWork> fetchMap = localFetchIterator.next();
-                FetchWork fetch = fetchMap.getValue();
-                String alias = fetchMap.getKey();
-                List<PartitionDesc> dirPart = fetch.getPartDesc();
-
-                // temporary hack: put the first partitionDesc into the map
-                aliasToPath.put(alias, dirPart.get(0));
-            }
-        }
-
-        Boolean visited = tasksVisited.get(task);
-        if (visited != null && visited.booleanValue() == true) {
-            return mapRootOps;
-        }
-
-        // do that only for union operator
-        for (Operator op : mapRootOps)
-            if (op.getParentOperators() != null)
-                op.getParentOperators().clear();
-
-        List<Operator> mapLeaves = new ArrayList<Operator>();
-        downToLeaves(mapRootOps, mapLeaves);
-        List<Operator> reduceOps = new ArrayList<Operator>();
-
-        if (work.getReducer() != null)
-            reduceOps.add(work.getReducer());
-
-        for (Operator mapLeaf : mapLeaves) {
-            mapLeaf.setChildOperators(reduceOps);
-        }
-
-        for (Operator reduceOp : reduceOps) {
-            if (reduceOp != null)
-                reduceOp.setParentOperators(mapLeaves);
-        }
-
-        List<Operator> leafs = new ArrayList<Operator>();
-        if (reduceOps.size() > 0) {
-            downToLeaves(reduceOps, leafs);
-        } else {
-            leafs = mapLeaves;
-        }
-
-        List<Operator> mapChildren = new ArrayList<Operator>();
-        if (task.getChildTasks() != null && task.getChildTasks().size() > 0) {
-            for (Object child : task.getChildTasks()) {
-                List<Operator> childMapOps = articulateMapReduceOperators((Task) child, rootOps, aliasToPath, rootTasks);
-                if (childMapOps == null)
-                    continue;
-
-                for (Operator childMap : childMapOps) {
-                    if (childMap instanceof TableScanOperator) {
-                        TableScanDesc topDesc = (TableScanDesc) childMap.getConf();
-                        if (topDesc == null || topDesc.getAlias() == null) {
-                            mapChildren.add(childMap);
-                        } else {
-                            rootOps.add(childMap);
-                        }
-                    } else {
-                        // if not table scan, add the child
-                        mapChildren.add(childMap);
-                    }
-                }
-            }
-
-            if (mapChildren.size() > 0) {
-                int i = 0;
-                for (Operator leaf : leafs) {
-                    if (leaf.getChildOperators() == null || leaf.getChildOperators().size() == 0)
-                        leaf.setChildOperators(new ArrayList<Operator>());
-                    leaf.getChildOperators().add(mapChildren.get(i));
-                    i++;
-                }
-                i = 0;
-                for (Operator child : mapChildren) {
-                    if (child.getParentOperators() == null || child.getParentOperators().size() == 0) {
-                        child.setParentOperators(new ArrayList<Operator>());
-                    }
-                    if (i < leafs.size()) {
-                        if (child.getParentOperators().size()==0) {
-                            child.getParentOperators().add(leafs.get(i));
-                        }
-                    }
-                    i++;
-                }
-            }
-        }
-
-        // mark this task as visited
-        this.tasksVisited.put(task, true);
-        return mapRootOps;
-    }
-
-    /**
-     * down to leaf nodes
-     * 
-     * @param ops
-     * @param leaves
-     */
-    private void downToLeaves(List<Operator> ops, List<Operator> leaves) {
-
-        // Operator currentOp;
-        for (Operator op : ops) {
-            if (op != null && op.getChildOperators() != null && op.getChildOperators().size() > 0) {
-                downToLeaves(op.getChildOperators(), leaves);
-            } else {
-                if (op != null && leaves.indexOf(op) < 0)
-                    leaves.add(op);
-            }
-        }
-    }
-
-    private void getLeaves(List<Operator> roots, List<Operator> currentLeaves) {
-        for (Operator op : roots) {
-            List<Operator> children = op.getChildOperators();
-            if (children == null || children.size() <= 0) {
-                currentLeaves.add(op);
-            } else {
-                getLeaves(children, currentLeaves);
-            }
-        }
-    }
-
-    private void executeHyracksJob(JobSpecification job) throws Exception {
-
-        /**
-         * load the properties file if it is not loaded
-         */
-        if (clusterProps == null) {
-            clusterProps = new Properties();
-            InputStream confIn = new FileInputStream(clusterPropertiesPath);
-            clusterProps.load(confIn);
-            confIn.close();
-        }
-
-        if (hcc == null) {
-            BufferedReader ipReader = new BufferedReader(new InputStreamReader(new FileInputStream(masterFilePath)));
-            String masterNode = ipReader.readLine();
-            ipReader.close();
-
-            InetAddress[] ips = InetAddress.getAllByName(masterNode);
-            int port = Integer.parseInt(clusterProps.getProperty("CC_CLIENTPORT"));
-            for (InetAddress ip : ips) {
-                if (ip.getAddress().length <= 4) {
-                    try {
-                        hcc = new HyracksConnection(ip.getHostAddress(), port);
-                        break;
-                    } catch (Exception e) {
-                        continue;
-                    }
-                }
-            }
-        }
-
-        job.setReportTaskDetails(false);
-        long start = System.currentTimeMillis();
-        JobId jobId = hcc.startJob(job);
-        hcc.waitForCompletion(jobId);
-
-        // System.out.println("job finished: " + jobId.toString());
-        // call all leave nodes to end
-        for (Operator leaf : leaveOps) {
-            jobClose(leaf);
-        }
-
-        long end = System.currentTimeMillis();
-        System.err.println(start + " " + end + " " + (end - start));
-    }
-
-    /**
-     * mv to final directory on hdfs (not real final)
-     * 
-     * @param leaf
-     * @throws Exception
-     */
-    private void jobClose(Operator leaf) throws Exception {
-        FileSinkOperator fsOp = (FileSinkOperator) leaf;
-        FileSinkDesc desc = fsOp.getConf();
-        boolean isNativeTable = !desc.getTableInfo().isNonNative();
-        if ((conf != null) && isNativeTable) {
-            String specPath = desc.getDirName();
-            DynamicPartitionCtx dpCtx = desc.getDynPartCtx();
-            // for 0.7.0
-            //fsOp.mvFileToFinalPath(specPath, conf, true, LOG, dpCtx);
-            // for 0.8.0
-            //Utilities.mvFileToFinalPath(specPath, conf, true, LOG, dpCtx, desc);
-            Utilities.mvFileToFinalPath(specPath, conf, true, LOG, dpCtx, desc, Reporter.NULL);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb-hyracks/blob/ffc967fd/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/IExecutionEngine.java
----------------------------------------------------------------------
diff --git a/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/IExecutionEngine.java b/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/IExecutionEngine.java
deleted file mode 100644
index 8f62d87..0000000
--- a/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/IExecutionEngine.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2009-2013 by The Regents of the University of California
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * you may obtain a copy of the License from
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package edu.uci.ics.hivesterix.runtime.exec;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.apache.hadoop.hive.ql.exec.Task;
-
-public interface IExecutionEngine {
-
-    /**
-     * compile the job
-     * 
-     * @param rootTasks
-     *            : Hive MapReduce plan
-     * @return 0 pass, 1 fail
-     */
-    public int compileJob(List<Task<? extends Serializable>> rootTasks);
-
-    /**
-     * execute the job with latest compiled plan
-     * 
-     * @return
-     */
-    public int executeJob();
-}


Mime
View raw message