Tests partitioned files and more query plan verification tests (#570)

diff --git a/framework/resources/Datasources/table_stats/analyze_tables.sql b/framework/resources/Datasources/table_stats/analyze_tables.sql
index 8559e23..bf1c723 100755
--- a/framework/resources/Datasources/table_stats/analyze_tables.sql
+++ b/framework/resources/Datasources/table_stats/analyze_tables.sql
@@ -20,4 +20,9 @@
 analyze table `table_stats/Tpch0.01/parquet/customer` compute statistics;
 analyze table `table_stats/Tpch0.01/parquet/part` compute statistics;
 analyze table `table_stats/Tpch0.01/parquet/partsupp` compute statistics;
+analyze table  `table_stats/empty` compute statistics;
+--tests with partition pruning
+analyze table `table_stats/pp_some_cols/1991/1` compute statistics(p_name,p_type,p_size);
+analyze table `table_stats/pp_some_cols` compute statistics(p_name,p_type,p_size);
+analyze table  `table_stats/pp_some_cols/1992/2/1/2` compute statistics(p_name,p_type,p_size,p_retailprice);
 reset `store.parquet.reader.int96_as_timestamp`;
diff --git a/framework/resources/Datasources/table_stats/tables/empty/0_0_0.parquet b/framework/resources/Datasources/table_stats/tables/empty/0_0_0.parquet
new file mode 100755
index 0000000..9c600d0
--- /dev/null
+++ b/framework/resources/Datasources/table_stats/tables/empty/0_0_0.parquet
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/pp_some_cols/1991/1/1/1/part.parquet b/framework/resources/Datasources/table_stats/tables/pp_some_cols/1991/1/1/1/part.parquet
new file mode 100755
index 0000000..e86fe08
--- /dev/null
+++ b/framework/resources/Datasources/table_stats/tables/pp_some_cols/1991/1/1/1/part.parquet
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/pp_some_cols/1992/2/1/1/part.parquet b/framework/resources/Datasources/table_stats/tables/pp_some_cols/1992/2/1/1/part.parquet
new file mode 100755
index 0000000..e86fe08
--- /dev/null
+++ b/framework/resources/Datasources/table_stats/tables/pp_some_cols/1992/2/1/1/part.parquet
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/pp_some_cols/1992/2/1/2/part.parquet b/framework/resources/Datasources/table_stats/tables/pp_some_cols/1992/2/1/2/part.parquet
new file mode 100755
index 0000000..e86fe08
--- /dev/null
+++ b/framework/resources/Datasources/table_stats/tables/pp_some_cols/1992/2/1/2/part.parquet
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/customer/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/customer/.stats.drill/0_0.json
deleted file mode 100644
index 2de13a9..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/customer/.stats.drill/0_0.json
+++ /dev/null
@@ -1,63 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:22:51.692-08:00",
-    "columns" : [ {
-      "column" : "C_CUSTKEY",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 1500,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "C_NAME",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 1500,
-      "avgwidth" : 18.0
-    }, {
-      "column" : "C_ADDRESS",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 1500,
-      "avgwidth" : 24.726666666666667
-    }, {
-      "column" : "C_NATIONKEY",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 25,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "C_PHONE",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 1500,
-      "avgwidth" : 15.0
-    }, {
-      "column" : "C_ACCTBAL",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 1499,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "C_MKTSEGMENT",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 5,
-      "avgwidth" : 8.976666666666667
-    }, {
-      "column" : "C_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 1500.0,
-      "nonnullstatcount" : 1500.0,
-      "ndv" : 1500,
-      "avgwidth" : 73.2
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/.stats.drill/0_0.json
deleted file mode 100644
index 12d7339..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/.stats.drill/0_0.json
+++ /dev/null
@@ -1,119 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:00.372-08:00",
-    "columns" : [ {
-      "column" : "L_ORDERKEY",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 14991,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_PARTKEY",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 2000,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_SUPPKEY",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 100,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_LINENUMBER",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 7,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_QUANTITY",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 50,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_EXTENDEDPRICE",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 35879,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_DISCOUNT",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 11,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_TAX",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 9,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "L_RETURNFLAG",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 3,
-      "avgwidth" : 1.0
-    }, {
-      "column" : "L_LINESTATUS",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 2,
-      "avgwidth" : 1.0
-    }, {
-      "column" : "L_SHIPDATE",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 2516,
-      "avgwidth" : 10.0
-    }, {
-      "column" : "L_COMMITDATE",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 2458,
-      "avgwidth" : 10.0
-    }, {
-      "column" : "L_RECEIPTDATE",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 2527,
-      "avgwidth" : 10.0
-    }, {
-      "column" : "L_SHIPINSTRUCT",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 4,
-      "avgwidth" : 12.001046946406316
-    }, {
-      "column" : "L_SHIPMODE",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 7,
-      "avgwidth" : 4.289588699626091
-    }, {
-      "column" : "L_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 60175.0,
-      "nonnullstatcount" : 60175.0,
-      "ndv" : 58641,
-      "avgwidth" : 26.562044038221853
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/01.parquet
deleted file mode 100644
index 6433552..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/02.parquet
deleted file mode 100644
index 1ce62bb..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/03.parquet
deleted file mode 100644
index ad5cb12..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/lineitem/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/.stats.drill/0_0.json
deleted file mode 100644
index f6681b3..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/.stats.drill/0_0.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:05.982-08:00",
-    "columns" : [ {
-      "column" : "N_NATIONKEY",
-      "schema" : 1.0,
-      "statcount" : 25.0,
-      "nonnullstatcount" : 25.0,
-      "ndv" : 25,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "N_NAME",
-      "schema" : 1.0,
-      "statcount" : 25.0,
-      "nonnullstatcount" : 25.0,
-      "ndv" : 25,
-      "avgwidth" : 7.08
-    }, {
-      "column" : "N_REGIONKEY",
-      "schema" : 1.0,
-      "statcount" : 25.0,
-      "nonnullstatcount" : 25.0,
-      "ndv" : 5,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "N_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 25.0,
-      "nonnullstatcount" : 25.0,
-      "ndv" : 25,
-      "avgwidth" : 74.28
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/01.parquet
deleted file mode 100644
index ad9d93c..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/02.parquet
deleted file mode 100644
index e68f1f1..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/03.parquet
deleted file mode 100644
index e578e36..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/nation/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/.stats.drill/0_0.json
deleted file mode 100644
index fb1d874..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/.stats.drill/0_0.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:12.975-08:00",
-    "columns" : [ {
-      "column" : "O_ORDERKEY",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 14991,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "O_CUSTKEY",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 999,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "O_ORDERSTATUS",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 3,
-      "avgwidth" : 1.0
-    }, {
-      "column" : "O_TOTALPRICE",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 14996,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "O_ORDERDATE",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 2399,
-      "avgwidth" : 10.0
-    }, {
-      "column" : "O_ORDERPRIORITY",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 5,
-      "avgwidth" : 8.412533333333334
-    }, {
-      "column" : "O_CLERK",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 1000,
-      "avgwidth" : 15.0
-    }, {
-      "column" : "O_SHIPPRIORITY",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 1,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "O_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 15000.0,
-      "nonnullstatcount" : 15000.0,
-      "ndv" : 14996,
-      "avgwidth" : 48.49093333333333
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/01.parquet
deleted file mode 100644
index 643b337..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/02.parquet
deleted file mode 100644
index 04e0ba6..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/03.parquet
deleted file mode 100644
index 17b1575..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/orders/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/part/.stats.drill/0_0.json
deleted file mode 100644
index 623d9ae..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/.stats.drill/0_0.json
+++ /dev/null
@@ -1,70 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:19.565-08:00",
-    "columns" : [ {
-      "column" : "P_PARTKEY",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 2000,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "P_NAME",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 2001,
-      "avgwidth" : 33.127
-    }, {
-      "column" : "P_MFGR",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 5,
-      "avgwidth" : 14.0
-    }, {
-      "column" : "P_BRAND",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 25,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "P_TYPE",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 150,
-      "avgwidth" : 20.551
-    }, {
-      "column" : "P_SIZE",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 50,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "P_CONTAINER",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 40,
-      "avgwidth" : 7.6105
-    }, {
-      "column" : "P_RETAILPRICE",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 1100,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "P_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 2000.0,
-      "nonnullstatcount" : 2000.0,
-      "ndv" : 1960,
-      "avgwidth" : 13.5865
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/part/01.parquet
deleted file mode 100644
index 216de23..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/part/02.parquet
deleted file mode 100644
index e79f1cf..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/part/03.parquet
deleted file mode 100644
index 676fdbe..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/part/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/.stats.drill/0_0.json
deleted file mode 100644
index 3b0a804..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/.stats.drill/0_0.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:24.682-08:00",
-    "columns" : [ {
-      "column" : "PS_PARTKEY",
-      "schema" : 1.0,
-      "statcount" : 8000.0,
-      "nonnullstatcount" : 8000.0,
-      "ndv" : 2000,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "PS_SUPPKEY",
-      "schema" : 1.0,
-      "statcount" : 8000.0,
-      "nonnullstatcount" : 8000.0,
-      "ndv" : 100,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "PS_AVAILQTY",
-      "schema" : 1.0,
-      "statcount" : 8000.0,
-      "nonnullstatcount" : 8000.0,
-      "ndv" : 5494,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "PS_SUPPLYCOST",
-      "schema" : 1.0,
-      "statcount" : 8000.0,
-      "nonnullstatcount" : 8000.0,
-      "ndv" : 7661,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "PS_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 8000.0,
-      "nonnullstatcount" : 8000.0,
-      "ndv" : 7994,
-      "avgwidth" : 124.06625
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/01.parquet
deleted file mode 100644
index 9c60851..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/02.parquet
deleted file mode 100644
index cd04745..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/03.parquet
deleted file mode 100644
index 6243b61..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/partsupp/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/region/.stats.drill/0_0.json
deleted file mode 100644
index 29c07f3..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/.stats.drill/0_0.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:31.235-08:00",
-    "columns" : [ {
-      "column" : "R_REGIONKEY",
-      "schema" : 1.0,
-      "statcount" : 5.0,
-      "nonnullstatcount" : 5.0,
-      "ndv" : 5,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "R_NAME",
-      "schema" : 1.0,
-      "statcount" : 5.0,
-      "nonnullstatcount" : 5.0,
-      "ndv" : 5,
-      "avgwidth" : 6.8
-    }, {
-      "column" : "R_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 5.0,
-      "nonnullstatcount" : 5.0,
-      "ndv" : 5,
-      "avgwidth" : 66.0
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/region/01.parquet
deleted file mode 100644
index 3c6da60..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/region/02.parquet
deleted file mode 100644
index f3c544a..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/region/03.parquet
deleted file mode 100644
index 866ec62..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/region/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/.stats.drill/0_0.json b/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/.stats.drill/0_0.json
deleted file mode 100644
index 119a7f5..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/.stats.drill/0_0.json
+++ /dev/null
@@ -1,56 +0,0 @@
-{
-  "statistics_version" : "v1",
-  "directories" : [ {
-    "computed" : "2017-02-23T22:23:37.953-08:00",
-    "columns" : [ {
-      "column" : "S_SUPPKEY",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 100,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "S_NAME",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 100,
-      "avgwidth" : 18.0
-    }, {
-      "column" : "S_ADDRESS",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 100,
-      "avgwidth" : 25.37
-    }, {
-      "column" : "S_NATIONKEY",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 25,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "S_PHONE",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 100,
-      "avgwidth" : 15.0
-    }, {
-      "column" : "S_ACCTBAL",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 100,
-      "avgwidth" : 8.0
-    }, {
-      "column" : "S_COMMENT",
-      "schema" : 1.0,
-      "statcount" : 100.0,
-      "nonnullstatcount" : 100.0,
-      "ndv" : 100,
-      "avgwidth" : 61.15
-    } ]
-  } ]
-}
\ No newline at end of file
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/01.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/01.parquet
deleted file mode 100644
index 7fdbb80..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/01.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/02.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/02.parquet
deleted file mode 100644
index b6ee035..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/02.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/03.parquet b/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/03.parquet
deleted file mode 100644
index 9f4beac..0000000
--- a/framework/resources/Datasources/table_stats/tables/tpch-multi/supplier/03.parquet
+++ /dev/null
Binary files differ
diff --git a/framework/resources/Functional/table_stats/stats/positive/empty.plan b/framework/resources/Functional/table_stats/stats/positive/empty.plan
new file mode 100644
index 0000000..061c70a
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/empty.plan
@@ -0,0 +1 @@
+\[\{"computed":.*,"columns":\[\{"column":"`\*`","majortype":\{"type":"INT","mode":"OPTIONAL"\},"schema":1\.0,"rowcount":1\.0,"nonnullrowcount":0.0,"ndv":1,"avgwidth":4\.0}\]\}\]
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/empty.sql b/framework/resources/Functional/table_stats/stats/positive/empty.sql
new file mode 100644
index 0000000..e4bf75c
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/empty.sql
@@ -0,0 +1 @@
+select directories from `table_stats/empty/.stats.drill`;
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_1.plan b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_1.plan
new file mode 100644
index 0000000..3eb3418
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_1.plan
@@ -0,0 +1 @@
+\[\{"computed":.*,"columns":\[\{"column":"`p_name`","majortype":\{"type":"VARCHAR","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":2000,"avgwidth":33.127,"histogram":.*\},\{"column":"`p_type`","majortype":\{"type":"VARCHAR","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":150,"avgwidth":20.551,"histogram":.*\},\{"column":"`p_size`","majortype":\{"type":"INT","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":50,"avgwidth":4.0,"histogram":.*\}\]\}\]
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_1.sql b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_1.sql
new file mode 100644
index 0000000..db45e84
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_1.sql
@@ -0,0 +1 @@
+select directories from `table_stats/pp_some_cols/1991/1/.stats.drill`;
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_2.plan b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_2.plan
new file mode 100644
index 0000000..16e2ded
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_2.plan
@@ -0,0 +1 @@
+\[\{"computed":.*,"columns":\[\{"column":"`p_name`","majortype":\{"type":"VARCHAR","mode":"REQUIRED"\},"schema":1.0,"rowcount":6000.0,"nonnullrowcount":6000.0,"ndv":2001,"avgwidth":33.127,"histogram":.*\},\{"column":"`p_type`","majortype":\{"type":"VARCHAR","mode":"REQUIRED"\},"schema":1.0,"rowcount":6000.0,"nonnullrowcount":6000.0,"ndv":150,"avgwidth":20.551,"histogram":.*\},\{"column":"`p_size`","majortype":\{"type":"INT","mode":"REQUIRED"\},"schema":1.0,"rowcount":6000.0,"nonnullrowcount":6000.0,"ndv":50,"avgwidth":4.0,"histogram":.*\}\]\}\]
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_2.sql b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_2.sql
new file mode 100644
index 0000000..be15792
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_2.sql
@@ -0,0 +1 @@
+select directories from `table_stats/pp_some_cols/.stats.drill`;
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_3.plan b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_3.plan
new file mode 100644
index 0000000..dae5539
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_3.plan
@@ -0,0 +1 @@
+\[\{"computed":"2019-04-04","columns":\[\{"column":"`p_name`","majortype":\{"type":"VARCHAR","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":2000,"avgwidth":33.127,"histogram":.*\},\{"column":"`p_type`","majortype":\{"type":"VARCHAR","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":150,"avgwidth":20.551,"histogram":.*\},\{"column":"`p_size`","majortype":\{"type":"INT","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":50,"avgwidth":4.0,"histogram":.*\},\{"column":"`p_retailprice`","majortype":\{"type":"FLOAT8","mode":"REQUIRED"\},"schema":1.0,"rowcount":2000.0,"nonnullrowcount":2000.0,"ndv":1100,"avgwidth":8.0,"histogram":\{.*\}\]\}\]
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_3.sql b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_3.sql
new file mode 100644
index 0000000..977d9ae
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/positive/pp_some_cols_3.sql
@@ -0,0 +1 @@
+select directories from `table_stats/pp_some_cols/1992/2/1/2/.stats.drill`;
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/query/filter_1.plan b/framework/resources/Functional/table_stats/stats/query/filter_1.plan
new file mode 100644
index 0000000..e7556e9
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/query/filter_1.plan
@@ -0,0 +1,3 @@
+.*Screen.*rowcount = 40.0
+.*Filter.*rowcount = 40.0
+.*Scan.*rowcount = 2000.0
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/query/filter_1.sql b/framework/resources/Functional/table_stats/stats/query/filter_1.sql
new file mode 100644
index 0000000..ac4dc0d
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/query/filter_1.sql
@@ -0,0 +1,4 @@
+-- This is a simple equality filter
+set `planner.statistics.use` = true;
+explain plan including all attributes for select p_partkey from `table_stats/Tpch0.01/parquet/part` where p_size = 41;
+reset `planner.statistics.use`;
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/query/inner_join2.plan b/framework/resources/Functional/table_stats/stats/query/inner_join2.plan
new file mode 100644
index 0000000..bf3b2df
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/query/inner_join2.plan
@@ -0,0 +1,5 @@
+.*Screen.*rowcount = 160.0
+.*HashJoin.*rowcount = 160.0
+.*Scan.*rowcount = 8000.0
+.*Filter.*rowcount = 40.0
+.*Scan.*rowcount = 2000.0
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/query/inner_join2.sql b/framework/resources/Functional/table_stats/stats/query/inner_join2.sql
new file mode 100644
index 0000000..f4a2797
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/query/inner_join2.sql
@@ -0,0 +1,4 @@
+-- This is a simple inner join + equality filter
+set `planner.statistics.use` = true;
+explain plan including all attributes for select p.p_partkey from `table_stats/Tpch0.01/parquet/part` p, `table_stats/Tpch0.01/parquet/partsupp` ps where p.p_partkey = ps.ps_partkey and p.p_size = 41;
+reset `planner.statistics.use`;
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/query/inner_join3.plan b/framework/resources/Functional/table_stats/stats/query/inner_join3.plan
new file mode 100644
index 0000000..2a1f67c
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/query/inner_join3.plan
@@ -0,0 +1,5 @@
+.*Screen.*rowcount = 1.0
+.*StreamAgg.*rowcount = 1.0
+.*HashJoin.*rowcount = 800000.000000017
+.*Scan.*rowcount = 2000.0
+.*Scan.*rowcount = 2000.0
\ No newline at end of file
diff --git a/framework/resources/Functional/table_stats/stats/query/inner_join3.sql b/framework/resources/Functional/table_stats/stats/query/inner_join3.sql
new file mode 100644
index 0000000..2bfc02d
--- /dev/null
+++ b/framework/resources/Functional/table_stats/stats/query/inner_join3.sql
@@ -0,0 +1,4 @@
+-- This is a simple inner join on the same table.
+set `planner.statistics.use` = true;
+explain plan including all attributes for select count(*)  from `table_stats/Tpch0.01/parquet/part` p1, `table_stats/Tpch0.01/parquet/part` p2 where p1.p_mfgr = p2.p_mfgr;
+reset `planner.statistics.use`;
\ No newline at end of file