You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by ji...@apache.org on 2017/09/18 19:33:05 UTC

[1/6] incubator-quickstep git commit: Path script

Repository: incubator-quickstep
Updated Branches:
  refs/heads/trace c29587a1a -> e6c99562b


Path script


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

Branch: refs/heads/trace
Commit: aa942511cf4ae196c9ca0a55a4f3b6b0c1f578ea
Parents: 718bb68
Author: Jianqiao Zhu <ji...@cs.wisc.edu>
Authored: Sun Sep 3 22:47:49 2017 -0500
Committer: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Mon Sep 18 14:30:30 2017 -0500

----------------------------------------------------------------------
 api/python/lineage.py | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/aa942511/api/python/lineage.py
----------------------------------------------------------------------
diff --git a/api/python/lineage.py b/api/python/lineage.py
deleted file mode 100644
index bd6db00..0000000
--- a/api/python/lineage.py
+++ /dev/null
@@ -1,16 +0,0 @@
-from quickstep import Quickstep
-
-qs = Quickstep('/Users/jianqiao/Desktop/incubator-quickstep/build/Debug/quickstep_client')
-
-vertices = [1299454, 31623412, 31739916, 31593563]
-
-# Truncate old tables.
-qs.execute('DROP TABLE cur; DROP TABLE next; DROP TABLE answer;')
-qs.execute('CREATE TABLE cur(id INT); CREATE TABLE next(id INT); CREATE TABLE answer(id INT);')
-
-stmts = ''
-for v in vertices:
-  stmts += 'INSERT INTO cur VALUES(' + str(v) + '); '
-qs.execute(stmts)
-qs.execute('INSERT INTO answer SELECT id FROM cur;')
-


[6/6] incubator-quickstep git commit: Temporary adjustment for shortest path that prefer partitioned aggregation

Posted by ji...@apache.org.
Temporary adjustment for shortest path that prefer partitioned aggregation


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

Branch: refs/heads/trace
Commit: e6c99562bfd6b64adf15569acb9cd1d7874c79e4
Parents: 01dc532
Author: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Authored: Mon Sep 18 14:27:28 2017 -0500
Committer: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Mon Sep 18 14:32:45 2017 -0500

----------------------------------------------------------------------
 query_optimizer/ExecutionGenerator.cpp                   | 6 +-----
 query_optimizer/cost_model/StarSchemaSimpleCostModel.cpp | 2 +-
 types/containers/ColumnVectorsValueAccessor.hpp          | 3 +--
 3 files changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e6c99562/query_optimizer/ExecutionGenerator.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/ExecutionGenerator.cpp b/query_optimizer/ExecutionGenerator.cpp
index e7ef82a..6f362b8 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -189,7 +189,7 @@ static const volatile bool num_aggregation_partitions_dummy
     = gflags::RegisterFlagValidator(&FLAGS_num_aggregation_partitions, &ValidateNumAggregationPartitions);
 
 DEFINE_uint64(partition_aggregation_num_groups_threshold,
-              100000,
+              100,
               "The threshold used for deciding whether the aggregation is done "
               "in a partitioned way or not");
 
@@ -267,10 +267,6 @@ bool CheckAggregatePartitioned(const std::size_t num_aggregate_functions,
                                const std::vector<bool> &is_distincts,
                                const std::vector<attribute_id> &group_by_attrs,
                                const std::size_t estimated_num_groups) {
-  // If there's no aggregation, return false.
-  if (num_aggregate_functions == 0) {
-    return false;
-  }
   // If there is only only aggregate function, we allow distinct aggregation.
   // Otherwise it can't be partitioned with distinct aggregation.
   if (num_aggregate_functions > 1) {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e6c99562/query_optimizer/cost_model/StarSchemaSimpleCostModel.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/cost_model/StarSchemaSimpleCostModel.cpp b/query_optimizer/cost_model/StarSchemaSimpleCostModel.cpp
index e0e3dff..ebc4d78 100644
--- a/query_optimizer/cost_model/StarSchemaSimpleCostModel.cpp
+++ b/query_optimizer/cost_model/StarSchemaSimpleCostModel.cpp
@@ -711,7 +711,7 @@ bool StarSchemaSimpleCostModel::canUseTwoPhaseCompactKeyAggregation(
   // to put that flag so that it can be shared by the two cpp files (optimizer
   // vs backend). So here we hardcode the threshold and leave it to be solved
   // later.
-  if (estimated_num_groups >= 10000u) {
+  if (estimated_num_groups >= 100u) {
     return false;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e6c99562/types/containers/ColumnVectorsValueAccessor.hpp
----------------------------------------------------------------------
diff --git a/types/containers/ColumnVectorsValueAccessor.hpp b/types/containers/ColumnVectorsValueAccessor.hpp
index ebd46d4..08b1feb 100644
--- a/types/containers/ColumnVectorsValueAccessor.hpp
+++ b/types/containers/ColumnVectorsValueAccessor.hpp
@@ -164,8 +164,7 @@ class ColumnVectorsValueAccessor : public ValueAccessor {
     DCHECK(tupleIdInRange(tid));
     if (column_native_[attr_id]) {
       return static_cast<const NativeColumnVector&>(*columns_[attr_id])
-          .getTypedValue(tid)
-          .makeReferenceToThis();
+          .getTypedValue(tid);
     } else {
       return static_cast<const IndirectColumnVector&>(*columns_[attr_id])
           .getTypedValue(tid)


[2/6] incubator-quickstep git commit: Updates to API

Posted by ji...@apache.org.
Updates to API


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

Branch: refs/heads/trace
Commit: 718bb689bdb548c431c7e104b5f5eeda145f13d4
Parents: c29587a
Author: Jianqiao Zhu <ji...@cs.wisc.edu>
Authored: Sat Sep 2 23:06:37 2017 -0500
Committer: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Mon Sep 18 14:30:30 2017 -0500

----------------------------------------------------------------------
 api/python/lineage.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/718bb689/api/python/lineage.py
----------------------------------------------------------------------
diff --git a/api/python/lineage.py b/api/python/lineage.py
new file mode 100644
index 0000000..bd6db00
--- /dev/null
+++ b/api/python/lineage.py
@@ -0,0 +1,16 @@
+from quickstep import Quickstep
+
+qs = Quickstep('/Users/jianqiao/Desktop/incubator-quickstep/build/Debug/quickstep_client')
+
+vertices = [1299454, 31623412, 31739916, 31593563]
+
+# Truncate old tables.
+qs.execute('DROP TABLE cur; DROP TABLE next; DROP TABLE answer;')
+qs.execute('CREATE TABLE cur(id INT); CREATE TABLE next(id INT); CREATE TABLE answer(id INT);')
+
+stmts = ''
+for v in vertices:
+  stmts += 'INSERT INTO cur VALUES(' + str(v) + '); '
+qs.execute(stmts)
+qs.execute('INSERT INTO answer SELECT id FROM cur;')
+


[3/6] incubator-quickstep git commit: Minor updates

Posted by ji...@apache.org.
Minor updates


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

Branch: refs/heads/trace
Commit: 4f4e71f7203a94e0b3ac182c70e5a6dad3dcd439
Parents: c330345
Author: Jianqiao Zhu <ji...@cs.wisc.edu>
Authored: Tue Sep 12 14:06:50 2017 -0500
Committer: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Mon Sep 18 14:31:35 2017 -0500

----------------------------------------------------------------------
 cli/CommandExecutor.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/4f4e71f7/cli/CommandExecutor.cpp
----------------------------------------------------------------------
diff --git a/cli/CommandExecutor.cpp b/cli/CommandExecutor.cpp
index 1dfb89a..595c41b 100644
--- a/cli/CommandExecutor.cpp
+++ b/cli/CommandExecutor.cpp
@@ -443,6 +443,23 @@ void ExecuteAnalyzeRange(const PtrVector<ParseString> &arguments,
         mutable_stat->setMaxValue(attr_id, results[1]);
       }
 
+      // Get the number of tuples for the relation.
+      std::string query_string = "SELECT COUNT(*) FROM \"";
+      query_string.append(rel_name);
+      query_string.append("\";");
+
+      TypedValue num_tuples =
+          ExecuteQueryForSingleResult(main_thread_client_id,
+                                      foreman_client_id,
+                                      query_string,
+                                      bus,
+                                      storage_manager,
+                                      query_processor,
+                                      parser_wrapper.get());
+
+      DCHECK_EQ(TypeID::kLong, num_tuples.getTypeID());
+      mutable_stat->setNumTuples(num_tuples.getLiteral<std::int64_t>());
+
       mutable_stat->setExactness(true);
     }
     fprintf(out, "done\n");


[4/6] incubator-quickstep git commit: Update analyze

Posted by ji...@apache.org.
Update analyze


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

Branch: refs/heads/trace
Commit: c330345b01fa5d2c75d0bf57cc0643f146b1c959
Parents: aa94251
Author: Jianqiao Zhu <ji...@cs.wisc.edu>
Authored: Tue Sep 12 00:12:08 2017 -0500
Committer: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Mon Sep 18 14:31:35 2017 -0500

----------------------------------------------------------------------
 cli/CommandExecutor.cpp | 82 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/c330345b/cli/CommandExecutor.cpp
----------------------------------------------------------------------
diff --git a/cli/CommandExecutor.cpp b/cli/CommandExecutor.cpp
index fb0dd4c..1dfb89a 100644
--- a/cli/CommandExecutor.cpp
+++ b/cli/CommandExecutor.cpp
@@ -370,6 +370,88 @@ void ExecuteAnalyzeRange(const PtrVector<ParseString> &arguments,
   query_processor->saveCatalog();
 }
 
+void ExecuteAnalyzeRange(const PtrVector<ParseString> &arguments,
+                    const tmb::client_id main_thread_client_id,
+                    const tmb::client_id foreman_client_id,
+                    MessageBus *bus,
+                    StorageManager *storage_manager,
+                    QueryProcessor *query_processor,
+                    FILE *out) {
+  const CatalogDatabase &database = *query_processor->getDefaultDatabase();
+
+  std::unique_ptr<SqlParserWrapper> parser_wrapper(new SqlParserWrapper());
+  std::vector<std::reference_wrapper<const CatalogRelation>> relations;
+  if (arguments.empty()) {
+    relations.insert(relations.begin(), database.begin(), database.end());
+  } else {
+    for (const auto &rel_name : arguments) {
+      const CatalogRelation *rel = database.getRelationByName(rel_name.value());
+      if (rel == nullptr) {
+        THROW_SQL_ERROR_AT(&rel_name) << "Table does not exist";
+      } else {
+        relations.emplace_back(*rel);
+      }
+    }
+  }
+
+  // Analyze each relation in the database.
+  for (const CatalogRelation &relation : relations) {
+    fprintf(out, "Analyzing %s ... ", relation.getName().c_str());
+    fflush(out);
+
+    CatalogRelation *mutable_relation =
+        query_processor->getDefaultDatabase()->getRelationByIdMutable(relation.getID());
+    CatalogRelationStatistics *mutable_stat =
+        mutable_relation->getStatisticsMutable();
+
+    if (!mutable_stat->isExact()) {
+      mutable_stat->clear();
+
+      const std::string rel_name = EscapeQuotes(relation.getName(), '"');
+
+      for (const CatalogAttribute &attribute : relation) {
+        const std::string attr_name = EscapeQuotes(attribute.getName(), '"');
+        const Type &attr_type = attribute.getType();
+        bool is_min_applicable =
+            AggregateFunctionMin::Instance().canApplyToTypes({&attr_type});
+        bool is_max_applicable =
+            AggregateFunctionMax::Instance().canApplyToTypes({&attr_type});
+        if (!is_min_applicable || !is_max_applicable) {
+          continue;
+        }
+
+        std::string query_string = "SELECT MIN(\"";
+        query_string.append(attr_name);
+        query_string.append("\"), MAX(\"");
+        query_string.append(attr_name);
+        query_string.append("\") FROM \"");
+        query_string.append(rel_name);
+        query_string.append("\";");
+
+        std::vector<TypedValue> results =
+            ExecuteQueryForSingleRow(main_thread_client_id,
+                                     foreman_client_id,
+                                     query_string,
+                                     bus,
+                                     storage_manager,
+                                     query_processor,
+                                     parser_wrapper.get());
+        DCHECK_EQ(2u, results.size());
+
+        const attribute_id attr_id = attribute.getID();
+        mutable_stat->setMinValue(attr_id, results[0]);
+        mutable_stat->setMaxValue(attr_id, results[1]);
+      }
+
+      mutable_stat->setExactness(true);
+    }
+    fprintf(out, "done\n");
+    fflush(out);
+  }
+  query_processor->markCatalogAltered();
+  query_processor->saveCatalog();
+}
+
 }  // namespace
 
 void executeCommand(const ParseStatement &statement,


[5/6] incubator-quickstep git commit: Update analyze command

Posted by ji...@apache.org.
Update analyze command


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

Branch: refs/heads/trace
Commit: 01dc5322acfe97f71e5c7e0b5bc9443c7a51cb91
Parents: 4f4e71f
Author: Jianqiao Zhu <ji...@cs.wisc.edu>
Authored: Tue Sep 12 14:29:52 2017 -0500
Committer: jianqiao <ji...@node-2.jianqiao.quickstep-pg0.wisc.cloudlab.us>
Committed: Mon Sep 18 14:32:45 2017 -0500

----------------------------------------------------------------------
 cli/CommandExecutor.cpp | 99 --------------------------------------------
 1 file changed, 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/01dc5322/cli/CommandExecutor.cpp
----------------------------------------------------------------------
diff --git a/cli/CommandExecutor.cpp b/cli/CommandExecutor.cpp
index 595c41b..fb0dd4c 100644
--- a/cli/CommandExecutor.cpp
+++ b/cli/CommandExecutor.cpp
@@ -370,105 +370,6 @@ void ExecuteAnalyzeRange(const PtrVector<ParseString> &arguments,
   query_processor->saveCatalog();
 }
 
-void ExecuteAnalyzeRange(const PtrVector<ParseString> &arguments,
-                    const tmb::client_id main_thread_client_id,
-                    const tmb::client_id foreman_client_id,
-                    MessageBus *bus,
-                    StorageManager *storage_manager,
-                    QueryProcessor *query_processor,
-                    FILE *out) {
-  const CatalogDatabase &database = *query_processor->getDefaultDatabase();
-
-  std::unique_ptr<SqlParserWrapper> parser_wrapper(new SqlParserWrapper());
-  std::vector<std::reference_wrapper<const CatalogRelation>> relations;
-  if (arguments.empty()) {
-    relations.insert(relations.begin(), database.begin(), database.end());
-  } else {
-    for (const auto &rel_name : arguments) {
-      const CatalogRelation *rel = database.getRelationByName(rel_name.value());
-      if (rel == nullptr) {
-        THROW_SQL_ERROR_AT(&rel_name) << "Table does not exist";
-      } else {
-        relations.emplace_back(*rel);
-      }
-    }
-  }
-
-  // Analyze each relation in the database.
-  for (const CatalogRelation &relation : relations) {
-    fprintf(out, "Analyzing %s ... ", relation.getName().c_str());
-    fflush(out);
-
-    CatalogRelation *mutable_relation =
-        query_processor->getDefaultDatabase()->getRelationByIdMutable(relation.getID());
-    CatalogRelationStatistics *mutable_stat =
-        mutable_relation->getStatisticsMutable();
-
-    if (!mutable_stat->isExact()) {
-      mutable_stat->clear();
-
-      const std::string rel_name = EscapeQuotes(relation.getName(), '"');
-
-      for (const CatalogAttribute &attribute : relation) {
-        const std::string attr_name = EscapeQuotes(attribute.getName(), '"');
-        const Type &attr_type = attribute.getType();
-        bool is_min_applicable =
-            AggregateFunctionMin::Instance().canApplyToTypes({&attr_type});
-        bool is_max_applicable =
-            AggregateFunctionMax::Instance().canApplyToTypes({&attr_type});
-        if (!is_min_applicable || !is_max_applicable) {
-          continue;
-        }
-
-        std::string query_string = "SELECT MIN(\"";
-        query_string.append(attr_name);
-        query_string.append("\"), MAX(\"");
-        query_string.append(attr_name);
-        query_string.append("\") FROM \"");
-        query_string.append(rel_name);
-        query_string.append("\";");
-
-        std::vector<TypedValue> results =
-            ExecuteQueryForSingleRow(main_thread_client_id,
-                                     foreman_client_id,
-                                     query_string,
-                                     bus,
-                                     storage_manager,
-                                     query_processor,
-                                     parser_wrapper.get());
-        DCHECK_EQ(2u, results.size());
-
-        const attribute_id attr_id = attribute.getID();
-        mutable_stat->setMinValue(attr_id, results[0]);
-        mutable_stat->setMaxValue(attr_id, results[1]);
-      }
-
-      // Get the number of tuples for the relation.
-      std::string query_string = "SELECT COUNT(*) FROM \"";
-      query_string.append(rel_name);
-      query_string.append("\";");
-
-      TypedValue num_tuples =
-          ExecuteQueryForSingleResult(main_thread_client_id,
-                                      foreman_client_id,
-                                      query_string,
-                                      bus,
-                                      storage_manager,
-                                      query_processor,
-                                      parser_wrapper.get());
-
-      DCHECK_EQ(TypeID::kLong, num_tuples.getTypeID());
-      mutable_stat->setNumTuples(num_tuples.getLiteral<std::int64_t>());
-
-      mutable_stat->setExactness(true);
-    }
-    fprintf(out, "done\n");
-    fflush(out);
-  }
-  query_processor->markCatalogAltered();
-  query_processor->saveCatalog();
-}
-
 }  // namespace
 
 void executeCommand(const ParseStatement &statement,