quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject [24/50] [abbrv] incubator-quickstep git commit: Added column store support for tmp relations.
Date Fri, 27 May 2016 03:23:15 GMT
Added column store support for tmp relations.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/e62dba05
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/e62dba05
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/e62dba05

Branch: refs/heads/tmp-relation-col-store
Commit: e62dba059913d3b351483f7cf3d91378ecc661d7
Parents: ea5e865
Author: Zuyu Zhang <zzhang@pivotal.io>
Authored: Thu May 19 12:48:48 2016 -0700
Committer: Zuyu Zhang <zzhang@pivotal.io>
Committed: Thu May 19 17:16:49 2016 -0700

----------------------------------------------------------------------
 query_optimizer/CMakeLists.txt                  |   2 +
 query_optimizer/ExecutionGenerator.cpp          |  70 +++++++++-
 query_optimizer/ExecutionGenerator.hpp          |   5 +-
 .../tests/execution_generator/Delete.test       |  30 +++--
 .../tests/execution_generator/Select.test       | 128 ++++++++++---------
 .../execution_generator/TableGenerator.test     |  13 +-
 .../tests/execution_generator/Update.test       |   2 +-
 storage/StorageBlockLayout.cpp                  |   3 +-
 storage/StorageBlockLayout.proto                |   2 +-
 9 files changed, 162 insertions(+), 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/query_optimizer/CMakeLists.txt b/query_optimizer/CMakeLists.txt
index aa2873e..1c80458 100644
--- a/query_optimizer/CMakeLists.txt
+++ b/query_optimizer/CMakeLists.txt
@@ -124,6 +124,8 @@ target_link_libraries(quickstep_queryoptimizer_ExecutionGenerator
                       quickstep_relationaloperators_TextScanOperator
                       quickstep_relationaloperators_UpdateOperator
                       quickstep_storage_AggregationOperationState_proto
+                      quickstep_storage_BasicColumnStoreTupleStorageSubBlock
+                      quickstep_storage_CompressedColumnStoreTupleStorageSubBlock
                       quickstep_storage_HashTableFactory
                       quickstep_storage_HashTable_proto
                       quickstep_storage_InsertDestination_proto

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/ExecutionGenerator.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionGenerator.cpp b/query_optimizer/ExecutionGenerator.cpp
index c590b6e..b48fdb7 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -104,6 +104,8 @@
 #include "relational_operators/TextScanOperator.hpp"
 #include "relational_operators/UpdateOperator.hpp"
 #include "storage/AggregationOperationState.pb.h"
+#include "storage/BasicColumnStoreTupleStorageSubBlock.hpp"
+#include "storage/CompressedColumnStoreTupleStorageSubBlock.hpp"
 #include "storage/HashTable.pb.h"
 #include "storage/HashTableFactory.hpp"
 #include "storage/InsertDestination.pb.h"
@@ -148,6 +150,8 @@ DEFINE_bool(parallelize_load, true, "Parallelize loading data files.");
 DEFINE_bool(optimize_joins, false,
             "Enable post execution plan generation optimizations for joins.");
 
+DEFINE_bool(use_column_store, true, "Use the column store for blocks in temporary relations.");
+
 namespace E = ::quickstep::optimizer::expressions;
 namespace P = ::quickstep::optimizer::physical;
 namespace S = ::quickstep::serialization;
@@ -298,28 +302,79 @@ std::string ExecutionGenerator::getNewRelationName() {
 void ExecutionGenerator::createTemporaryCatalogRelation(
     const P::PhysicalPtr &physical,
     const CatalogRelation **catalog_relation_output,
-    S::InsertDestination *insert_destination_proto) {
+    S::InsertDestination *insert_destination_proto,
+    const bool has_explicit_sort) {
   std::unique_ptr<CatalogRelation> catalog_relation(
       new CatalogRelation(optimizer_context_->catalog_database(),
                           getNewRelationName(),
                           -1 /* id */,
                           true /* is_temporary*/));
+
+  const bool use_column_store = FLAGS_use_column_store && !has_explicit_sort;
   attribute_id aid = 0;
+  bool has_non_ascii_string_aid = false;
+  attribute_id first_non_ascii_string_aid = 0;
+  vector<attribute_id> variable_length_aids;
   for (const E::NamedExpressionPtr &project_expression :
        physical->getOutputAttributes()) {
+    const Type &type = project_expression->getValueType();
+
     // The attribute name is simply set to the attribute id to make it distinct.
     std::unique_ptr<CatalogAttribute> catalog_attribute(
         new CatalogAttribute(catalog_relation.get(),
                              std::to_string(aid),
-                             project_expression->getValueType(),
+                             type,
                              aid,
                              project_expression->attribute_alias()));
     attribute_substitution_map_[project_expression->id()] =
         catalog_attribute.get();
     catalog_relation->addAttribute(catalog_attribute.release());
+
+    if (use_column_store) {
+      if (!has_non_ascii_string_aid &&
+          type.getSuperTypeID() != Type::kAsciiString) {
+        has_non_ascii_string_aid = true;
+        first_non_ascii_string_aid = aid;
+      }
+
+      if (type.isVariableLength()) {
+        variable_length_aids.push_back(aid);
+      }
+    }
+
     ++aid;
   }
 
+  if (use_column_store) {
+    StorageBlockLayoutDescription layout_description;
+    layout_description.set_num_slots(1);
+
+    TupleStorageSubBlockDescription *tuple_store_description = layout_description.mutable_tuple_store_description();
+
+    // TODO(quickstep): Pick up the best attribute to sort.
+    const attribute_id sort_attribute_id =
+        has_non_ascii_string_aid
+            ? first_non_ascii_string_aid
+            : 0;
+
+    bool description_is_valid = false;
+    if (variable_length_aids.empty()) {
+      tuple_store_description->set_sub_block_type(TupleStorageSubBlockDescription::BASIC_COLUMN_STORE);
+
+      tuple_store_description->SetExtension(BasicColumnStoreTupleStorageSubBlockDescription::sort_attribute_id,
+                                            sort_attribute_id);
+
+      description_is_valid = BasicColumnStoreTupleStorageSubBlock::DescriptionIsValid(*catalog_relation,
*tuple_store_description);
+    }
+
+    if (description_is_valid) {
+      unique_ptr<StorageBlockLayout> layout(
+          new StorageBlockLayout(*catalog_relation, layout_description));
+      layout->finalize();
+      catalog_relation->setDefaultStorageBlockLayout(layout.release());
+    }
+  }
+
   *catalog_relation_output = catalog_relation.get();
   const relation_id output_rel_id = optimizer_context_->catalog_database()->addRelation(
       catalog_relation.release());
@@ -330,6 +385,9 @@ void ExecutionGenerator::createTemporaryCatalogRelation(
 
   insert_destination_proto->set_insert_destination_type(S::InsertDestinationType::BLOCK_POOL);
   insert_destination_proto->set_relation_id(output_rel_id);
+
+  insert_destination_proto->mutable_layout()->MergeFrom(
+      (*catalog_relation_output)->getDefaultStorageBlockLayout().getDescription());
 }
 
 void ExecutionGenerator::dropAllTemporaryRelations() {
@@ -1476,7 +1534,7 @@ void ExecutionGenerator::convertSort(const P::SortPtr &physical_sort)
{
   S::InsertDestination *initial_runs_destination_proto =
       query_context_proto_->add_insert_destinations();
   createTemporaryCatalogRelation(
-      physical_sort, &initial_runs_relation, initial_runs_destination_proto);
+      physical_sort, &initial_runs_relation, initial_runs_destination_proto, true);
 
   const CatalogRelationInfo *input_relation_info =
       findRelationInfoOutputByPhysical(physical_sort->input());
@@ -1522,7 +1580,8 @@ void ExecutionGenerator::convertSort(const P::SortPtr &physical_sort)
{
     query_context_proto_->add_insert_destinations();
   createTemporaryCatalogRelation(physical_sort,
                                  &merged_runs_relation,
-                                 merged_runs_destination_proto);
+                                 merged_runs_destination_proto,
+                                 true);
   const CatalogRelation *sorted_relation;
   const QueryContext::insert_destination_id sorted_output_destination_id =
     query_context_proto_->insert_destinations_size();
@@ -1530,7 +1589,8 @@ void ExecutionGenerator::convertSort(const P::SortPtr &physical_sort)
{
     query_context_proto_->add_insert_destinations();
   createTemporaryCatalogRelation(physical_sort,
                                  &sorted_relation,
-                                 sorted_output_destination_proto);
+                                 sorted_output_destination_proto,
+                                 true);
 
   // TODO(qzeng): Make the merge factor configurable.
   const QueryPlan::DAGNodeIndex merge_run_operator_index =

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/ExecutionGenerator.hpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionGenerator.hpp b/query_optimizer/ExecutionGenerator.hpp
index 0630bca..194576c 100644
--- a/query_optimizer/ExecutionGenerator.hpp
+++ b/query_optimizer/ExecutionGenerator.hpp
@@ -190,11 +190,14 @@ class ExecutionGenerator {
    * @param catalog_relation_output The output catalog relation.
    * @param insert_destination_proto The output insert destination in proto
    *        form.
+   * @param has_explicit_sort Whether the relation will have an explict sorted
+   *        attribute. True for SortOperators.
    */
   void createTemporaryCatalogRelation(
       const physical::PhysicalPtr &physical,
       const CatalogRelation **catalog_relation_output,
-      serialization::InsertDestination *insert_destination_proto);
+      serialization::InsertDestination *insert_destination_proto,
+      const bool has_explicit_sort = false);
 
   /**
    * @brief Returns a new distinct relation name.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/tests/execution_generator/Delete.test
----------------------------------------------------------------------
diff --git a/query_optimizer/tests/execution_generator/Delete.test b/query_optimizer/tests/execution_generator/Delete.test
index 8c6864c..5e65f96 100644
--- a/query_optimizer/tests/execution_generator/Delete.test
+++ b/query_optimizer/tests/execution_generator/Delete.test
@@ -1,5 +1,5 @@
 #   Copyright 2011-2015 Quickstep Technologies LLC.
-#   Copyright 2015 Pivotal Software, Inc.
+#   Copyright 2015-2016 Pivotal Software, Inc.
 #
 #   Licensed under the Apache License, Version 2.0 (the "License");
 #   you may not use this file except in compliance with the License.
@@ -14,24 +14,26 @@
 #   limitations under the License.
 
 DELETE FROM test WHERE int_col+float_col > 0;
-SELECT int_col+float_col FROM test;
+SELECT int_col+float_col
+FROM test
+ORDER BY 1 NULLS LAST;
 --
 +-------------------+
 |(int_col+float_col)|
 +-------------------+
-|               NULL|
-|                  0|
-|        -1.26794922|
-|        -2.76393199|
-|          -4.354249|
+|        -18.2041683|
+|        -16.4174232|
+|        -14.6411009|
+|         -12.876894|
+|        -11.1270161|
+|        -9.39444923|
+|        -7.68337536|
 |                 -6|
+|          -4.354249|
+|        -2.76393199|
+|        -1.26794922|
+|                  0|
+|               NULL|
 |               NULL|
-|        -7.68337536|
-|        -9.39444923|
-|        -11.1270161|
-|         -12.876894|
-|        -14.6411009|
 |               NULL|
-|        -16.4174232|
-|        -18.2041683|
 +-------------------+

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/tests/execution_generator/Select.test
----------------------------------------------------------------------
diff --git a/query_optimizer/tests/execution_generator/Select.test b/query_optimizer/tests/execution_generator/Select.test
index 05f7108..cfdeeab 100644
--- a/query_optimizer/tests/execution_generator/Select.test
+++ b/query_optimizer/tests/execution_generator/Select.test
@@ -43,11 +43,11 @@ WHERE int_col < 10
 +-----------+--------------------+---------------+------------------------+--------------------+
 |int_col    |long_col            |float_col      |double_col              |char_col     
      |
 +-----------+--------------------+---------------+------------------------+--------------------+
-|         -1|                   1|              1|                      -1|         -1 1.000000|
-|         -3|                   9|     1.73205078|      -5.196152422706632|         -3 1.732051|
-|         -5|                  25|     2.23606801|     -11.180339887498949|         -5 2.236068|
-|         -7|                  49|     2.64575124|     -18.520259177452136|         -7 2.645751|
 |         -9|                  81|              3|                     -27|         -9 3.000000|
+|         -7|                  49|     2.64575124|     -18.520259177452136|         -7 2.645751|
+|         -5|                  25|     2.23606801|     -11.180339887498949|         -5 2.236068|
+|         -3|                   9|     1.73205078|      -5.196152422706632|         -3 1.732051|
+|         -1|                   1|              1|                      -1|         -1 1.000000|
 +-----------+--------------------+---------------+------------------------+--------------------+
 ==
 
@@ -56,36 +56,37 @@ SELECT int_col % 2,
        long_col % (int_col * int_col),
        float_col % 1,
        double_col % 1.0
-FROM test;
+FROM test
+ORDER BY 1, 2, 3, 4 NULLS LAST;
 --
 +-----------+----------------------------+---------------+------------------------+
 |(int_col%2)|(long_col%(int_col*int_col))|(float_col%1)  |(double_col%1.0)        |
 +-----------+----------------------------+---------------+------------------------+
-|       NULL|                        NULL|              0|                    NULL|
 |         -1|                           0|              0|                       0|
-|          0|                           0|    0.414213538|     0.82842712474619029|
-|         -1|                           0|    0.732050776|    -0.19615242270663202|
-|          0|                           0|              0|                       0|
-|         -1|                           0|     0.23606801|    -0.18033988749894903|
-|          0|                           0|    0.449489832|     0.69693845669906729|
-|         -1|                           0|    0.645751238|     -0.5202591774521359|
-|          0|                           0|    0.828427076|     0.62741699796952233|
 |         -1|                           0|              0|                       0|
-|       NULL|                        NULL|    0.162277699|                    NULL|
+|         -1|                           0|    0.123105526|   -0.092795635500223739|
+|         -1|                           0|     0.23606801|    -0.18033988749894903|
 |         -1|                           0|     0.31662488|    -0.48287269390939969|
-|          0|                           0|    0.464101553|     0.56921938165305619|
+|         -1|                           0|    0.358899117|    -0.81907992727280998|
+|         -1|                           0|    0.582575798|    -0.23408959407264263|
 |         -1|                           0|    0.605551243|    -0.87216658103185551|
-|          0|                           0|    0.741657495|      0.3832034148351795|
+|         -1|                           0|    0.645751238|     -0.5202591774521359|
+|         -1|                           0|    0.732050776|    -0.19615242270663202|
+|         -1|                           0|     0.79583168|    -0.30412503619254494|
 |         -1|                           0|    0.872983456|   -0.094750193111252656|
 |          0|                           0|              0|                       0|
-|         -1|                           0|    0.123105526|   -0.092795635500223739|
+|          0|                           0|              0|                       0|
 |          0|                           0|    0.242640495|     0.36753236814712409|
-|         -1|                           0|    0.358899117|    -0.81907992727280998|
-|       NULL|                        NULL|    0.472136021|                    NULL|
-|         -1|                           0|    0.582575798|    -0.23408959407264263|
+|          0|                           0|    0.414213538|     0.82842712474619029|
+|          0|                           0|    0.449489832|     0.69693845669906729|
+|          0|                           0|    0.464101553|     0.56921938165305619|
 |          0|                           0|    0.690415859|     0.18914671611545941|
-|         -1|                           0|     0.79583168|    -0.30412503619254494|
+|          0|                           0|    0.741657495|      0.3832034148351795|
+|          0|                           0|    0.828427076|     0.62741699796952233|
 |          0|                           0|    0.898979664|      0.5755076535925383|
+|       NULL|                        NULL|              0|                    NULL|
+|       NULL|                        NULL|    0.162277699|                    NULL|
+|       NULL|                        NULL|    0.472136021|                    NULL|
 +-----------+----------------------------+---------------+------------------------+
 ==
 
@@ -118,15 +119,15 @@ WHERE int_col < 10
 +-----------+--------------------+---------------+------------------------+--------------------+
 |int_col    |long_col            |float_col      |double_col              |char_col     
      |
 +-----------+--------------------+---------------+------------------------+--------------------+
+|         -9|                  81|              3|                     -27|         -9 3.000000|
+|         -7|                  49|     2.64575124|     -18.520259177452136|         -7 2.645751|
+|         -5|                  25|     2.23606801|     -11.180339887498949|         -5 2.236068|
+|         -3|                   9|     1.73205078|      -5.196152422706632|         -3 1.732051|
 |         -1|                   1|              1|                      -1|         -1 1.000000|
 |          2|                   4|     1.41421354|      2.8284271247461903|          2 1.414214|
-|         -3|                   9|     1.73205078|      -5.196152422706632|         -3 1.732051|
 |          4|                  16|              2|                       8|          4 2.000000|
-|         -5|                  25|     2.23606801|     -11.180339887498949|         -5 2.236068|
 |          6|                  36|     2.44948983|      14.696938456699067|          6 2.449490|
-|         -7|                  49|     2.64575124|     -18.520259177452136|         -7 2.645751|
 |          8|                  64|     2.82842708|      22.627416997969522|          8 2.828427|
-|         -9|                  81|              3|                     -27|         -9 3.000000|
 +-----------+--------------------+---------------+------------------------+--------------------+
 ==
 
@@ -140,15 +141,15 @@ WHERE int_col < 10
 +-----------+-----------+--------------------+
 |int_col    |alias_col  |char_col            |
 +-----------+-----------+--------------------+
+|         -9|         91|         -9 3.000000|
+|         -7|         93|         -7 2.645751|
+|         -5|         95|         -5 2.236068|
+|         -3|         97|         -3 1.732051|
 |         -1|         99|         -1 1.000000|
 |          2|        102|          2 1.414214|
-|         -3|         97|         -3 1.732051|
 |          4|        104|          4 2.000000|
-|         -5|         95|         -5 2.236068|
 |          6|        106|          6 2.449490|
-|         -7|         93|         -7 2.645751|
 |          8|        108|          8 2.828427|
-|         -9|         91|         -9 3.000000|
 +-----------+-----------+--------------------+
 ==
 
@@ -169,11 +170,11 @@ WHERE int_col < 10;
 +-----------+--------------------+---------------+------------------------+--------------------+
 |int_col    |long_col            |float_col      |double_col              |char_col     
      |
 +-----------+--------------------+---------------+------------------------+--------------------+
-|         -1|                   1|              1|                      -1|         -1 1.000000|
-|         -3|                   9|     1.73205078|      -5.196152422706632|         -3 1.732051|
-|         -5|                  25|     2.23606801|     -11.180339887498949|         -5 2.236068|
-|         -7|                  49|     2.64575124|     -18.520259177452136|         -7 2.645751|
 |         -9|                  81|              3|                     -27|         -9 3.000000|
+|         -7|                  49|     2.64575124|     -18.520259177452136|         -7 2.645751|
+|         -5|                  25|     2.23606801|     -11.180339887498949|         -5 2.236068|
+|         -3|                   9|     1.73205078|      -5.196152422706632|         -3 1.732051|
+|         -1|                   1|              1|                      -1|         -1 1.000000|
 +-----------+--------------------+---------------+------------------------+--------------------+
 ==
 
@@ -239,11 +240,11 @@ is multi-line
 column name
 |
 +----------------------------------+
-|                                -1|
-|                                -3|
-|                                -5|
-|                                -7|
 |                                -9|
+|                                -7|
+|                                -5|
+|                                -3|
+|                                -1|
 +----------------------------------+
 ==
 
@@ -257,15 +258,15 @@ WHERE int_col < 10
 +-----------+--------------------+
 |alias_col  |char_col            |
 +-----------+--------------------+
+|         91|         -9 3.000000|
+|         93|         -7 2.645751|
+|         95|         -5 2.236068|
+|         97|         -3 1.732051|
 |         99|         -1 1.000000|
 |        102|          2 1.414214|
-|         97|         -3 1.732051|
 |        104|          4 2.000000|
-|         95|         -5 2.236068|
 |        106|          6 2.449490|
-|         93|         -7 2.645751|
 |        108|          8 2.828427|
-|         91|         -9 3.000000|
 +-----------+--------------------+
 ==
 
@@ -293,15 +294,15 @@ WHERE a.long_col < 100
 +-----------+---------------------+--------------------+
 |int_col    |(a.int_col*b.int_col)|long_col            |
 +-----------+---------------------+--------------------+
+|         -9|                   81|                  81|
+|         -7|                   49|                  49|
+|         -5|                   25|                  25|
+|         -3|                    9|                   9|
 |         -1|                    1|                   1|
 |          2|                    4|                   4|
-|         -3|                    9|                   9|
 |          4|                   16|                  16|
-|         -5|                   25|                  25|
 |          6|                   36|                  36|
-|         -7|                   49|                  49|
 |          8|                   64|                  64|
-|         -9|                   81|                  81|
 +-----------+---------------------+--------------------+
 ==
 
@@ -326,13 +327,13 @@ WHERE a.long_col < 50
 +-----------+-----------+
 |int_col    |int_col    |
 +-----------+-----------+
+|         -7|         -7|
+|         -5|         -5|
+|         -3|         -3|
 |         -1|         -1|
 |          2|          2|
-|         -3|         -3|
 |          4|          4|
-|         -5|         -5|
 |          6|          6|
-|         -7|         -7|
 +-----------+-----------+
 ==
 
@@ -358,16 +359,16 @@ WHERE a.char_col = b.char_col
 +--------------------+--------------------+-----------+
 |char_col            |char_col            |int_col    |
 +--------------------+--------------------+-----------+
-|          0 0.000000|          0 0.000000|       NULL|
+|         -9 3.000000|         -9 3.000000|         -9|
+|         -7 2.645751|         -7 2.645751|         -7|
+|         -5 2.236068|         -5 2.236068|         -5|
+|         -3 1.732051|         -3 1.732051|         -3|
 |         -1 1.000000|         -1 1.000000|         -1|
+|          0 0.000000|          0 0.000000|       NULL|
 |          2 1.414214|          2 1.414214|          2|
-|         -3 1.732051|         -3 1.732051|         -3|
 |          4 2.000000|          4 2.000000|          4|
-|         -5 2.236068|         -5 2.236068|         -5|
 |          6 2.449490|          6 2.449490|          6|
-|         -7 2.645751|         -7 2.645751|         -7|
 |          8 2.828427|          8 2.828427|          8|
-|         -9 3.000000|         -9 3.000000|         -9|
 +--------------------+--------------------+-----------+
 ==
 
@@ -406,7 +407,8 @@ WHERE a.int_col = b.int_col
   AND c.float_col > d.float_col+a.int_col
   AND d.float_col <= 1
   AND a.int_col BETWEEN 0 AND 5
-  AND c.float_col > 4.7;
+  AND c.float_col > 4.7
+ORDER BY 2;
 --
 +-----------+-----------+---------------+-----------------------+---------------+------------------------+-----------+
 |int_col    |int_col    |float_col      |(d.float_col+a.int_col)|float_col      |double_col
             |int_col    |
@@ -624,10 +626,10 @@ ORDER BY group_col1,
 +--------------------+--------------------+--------------------+
 |                   1|                   3|                   6|
 |                   1|                   3|                   7|
-|                   2|                   4|                   8|
 |                   1|                   4|                   9|
 |                   1|                   5|                  10|
 |                   1|                   5|                  11|
+|                   2|                   4|                   8|
 +--------------------+--------------------+--------------------+
 ==
 
@@ -773,10 +775,6 @@ WHERE SUBSTRING(char_col FROM 1 FOR 1) = '-'
 |char_col            |negative_value|
 +--------------------+--------------+
 |         -1 1.000000|            -1|
-|         -3 1.732051|            -3|
-|         -5 2.236068|            -5|
-|         -7 2.645751|            -7|
-|         -9 3.000000|            -9|
 |        -11 3.316625|            -1|
 |        -13 3.605551|            -1|
 |        -15 3.872983|            -1|
@@ -784,6 +782,10 @@ WHERE SUBSTRING(char_col FROM 1 FOR 1) = '-'
 |        -19 4.358899|            -1|
 |        -21 4.582576|            -2|
 |        -23 4.795832|            -2|
+|         -3 1.732051|            -3|
+|         -5 2.236068|            -5|
+|         -7 2.645751|            -7|
+|         -9 3.000000|            -9|
 +--------------------+--------------+
 ==
 
@@ -852,11 +854,11 @@ WHERE double_col < 0
 +-----------+--------------------+---------------+------------------------+--------------------+
 |int_col    |long_col            |float_col      |double_col              |char_col     
      |
 +-----------+--------------------+---------------+------------------------+--------------------+
-|        -15|                 225|     3.87298346|     -58.094750193111253|        -15 3.872983|
-|        -17|                 289|     4.12310553|     -70.092795635500224|        -17 4.123106|
-|        -19|                 361|     4.35889912|      -82.81907992727281|        -19 4.358899|
-|        -21|                 441|      4.5825758|     -96.234089594072643|        -21 4.582576|
 |        -23|                 529|     4.79583168|     -110.30412503619254|        -23 4.795832|
+|        -21|                 441|      4.5825758|     -96.234089594072643|        -21 4.582576|
+|        -19|                 361|     4.35889912|      -82.81907992727281|        -19 4.358899|
+|        -17|                 289|     4.12310553|     -70.092795635500224|        -17 4.123106|
+|        -15|                 225|     3.87298346|     -58.094750193111253|        -15 3.872983|
 +-----------+--------------------+---------------+------------------------+--------------------+
 ==
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/tests/execution_generator/TableGenerator.test
----------------------------------------------------------------------
diff --git a/query_optimizer/tests/execution_generator/TableGenerator.test b/query_optimizer/tests/execution_generator/TableGenerator.test
index 375635e..6a7d706 100644
--- a/query_optimizer/tests/execution_generator/TableGenerator.test
+++ b/query_optimizer/tests/execution_generator/TableGenerator.test
@@ -51,11 +51,11 @@ SELECT * FROM generate_series(10, 1, -2);
 +---------------+
 |generate_series|
 +---------------+
-|             10|
-|              8|
-|              6|
-|              4|
 |              2|
+|              4|
+|              6|
+|              8|
+|             10|
 +---------------+
 ==
 
@@ -153,7 +153,8 @@ SELECT i, j, k
 FROM generate_series(1, 9) AS gs1(i),
      generate_series(1, 9) AS gs2(j),
      generate_series(1, 81) AS gs3(k)
-WHERE i <= j AND i * j = k;
+WHERE i <= j AND i * j = k
+ORDER BY i, j;
 --
 +-----------+-----------+-----------+
 |i          |j          |k          |
@@ -254,5 +255,3 @@ SELECT * FROM generate_series(1, 5, -1);
 ERROR: Invalid step width (1 : 15)
 SELECT * FROM generate_series(1, 5, -1);
               ^
-==
-

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/query_optimizer/tests/execution_generator/Update.test
----------------------------------------------------------------------
diff --git a/query_optimizer/tests/execution_generator/Update.test b/query_optimizer/tests/execution_generator/Update.test
index 5b3709b..1279709 100644
--- a/query_optimizer/tests/execution_generator/Update.test
+++ b/query_optimizer/tests/execution_generator/Update.test
@@ -30,7 +30,7 @@ WHERE int_col < -20
 |float_col      |(float_col/2)  |double_col              |
 +---------------+---------------+------------------------+
 |              2|              1|       2.291287899017334|
-|     4.69041586|     2.34520793|      103.18914671611546|
 |              2|              1|      2.3979158401489258|
+|     4.69041586|     2.34520793|      103.18914671611546|
 |     4.89897966|     2.44948983|      117.57550765359254|
 +---------------+---------------+------------------------+

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/storage/StorageBlockLayout.cpp
----------------------------------------------------------------------
diff --git a/storage/StorageBlockLayout.cpp b/storage/StorageBlockLayout.cpp
index e28fc55..348c5c0 100644
--- a/storage/StorageBlockLayout.cpp
+++ b/storage/StorageBlockLayout.cpp
@@ -52,7 +52,8 @@ StorageBlockLayout::StorageBlockLayout(const CatalogRelationSchema &relation,
 // TODO(chasseur): Align sub-blocks to cache line boundaries.
 void StorageBlockLayout::finalize() {
   CHECK(DescriptionIsValid(relation_, layout_description_))
-      << "Called StorageBlockLayout::finalize() with incomplete or invalid layout.";
+      << "Called StorageBlockLayout::finalize() with incomplete or invalid layout:\n"
+      << layout_description_.DebugString();
 
   // Reset the header and copy the layout from this StorageBlockLayout.
   block_header_.Clear();

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e62dba05/storage/StorageBlockLayout.proto
----------------------------------------------------------------------
diff --git a/storage/StorageBlockLayout.proto b/storage/StorageBlockLayout.proto
index 9e13fbe..c7371d5 100644
--- a/storage/StorageBlockLayout.proto
+++ b/storage/StorageBlockLayout.proto
@@ -66,7 +66,7 @@ message IndexSubBlockDescription {
     SMA = 1;
     BLOOM_FILTER = 2;
     BITWEAVING_H = 3;
-    BITWEAVING_V = 4;    
+    BITWEAVING_V = 4;
   }
 
   required IndexSubBlockType sub_block_type = 1;


Mime
View raw message