incubator-quickstep git commit: [QUICKSTEP-53] New representation and faster comparison operators for DateLit [Forced Update!]

2016-09-06 Thread hakanmemisoglu
Repository: incubator-quickstep
Updated Branches:
  refs/heads/date-representation 92555fc43 -> 5a9c29004 (forced update)


[QUICKSTEP-53] New representation and faster comparison operators for DateLit

- New representation for DateLit.
- New comparison implementations for DateLit.

Closes #98


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

Branch: refs/heads/date-representation
Commit: 5a9c290043051dab9c4fd40db220f266479cf419
Parents: 1d10422
Author: Hakan Memisoglu 
Authored: Tue Sep 6 19:59:26 2016 -0500
Committer: Hakan Memisoglu 
Committed: Tue Sep 6 20:01:57 2016 -0500

--
 types/DateOperatorOverloads.hpp | 12 ++--
 types/DateType.cpp  |  8 +--
 types/DatetimeLit.hpp   | 62 +---
 types/TypedValue.cpp|  9 +--
 types/TypedValue.hpp|  4 +-
 types/TypedValue.proto  |  8 +--
 .../unary_operations/DateExtractOperation.cpp   |  2 +-
 7 files changed, 58 insertions(+), 47 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/5a9c2900/types/DateOperatorOverloads.hpp
--
diff --git a/types/DateOperatorOverloads.hpp b/types/DateOperatorOverloads.hpp
index b04f44e..e2e5f6a 100644
--- a/types/DateOperatorOverloads.hpp
+++ b/types/DateOperatorOverloads.hpp
@@ -122,8 +122,8 @@ inline DatetimeLit operator+(const YearMonthIntervalLit 
, const DatetimeLit
 }
 
 inline DateLit operator+(const DateLit , const YearMonthIntervalLit ) {
-  std::int32_t result_year = lhs.year + (rhs.months / 12);
-  std::uint8_t result_month = lhs.month + (rhs.months % 12);
+  std::int32_t result_year = lhs.yearField() + (rhs.months / 12);
+  std::uint8_t result_month = static_cast(lhs.monthField()) + 
(rhs.months % 12);
 
   if (result_month > 11) {
 result_month -= 12;
@@ -131,7 +131,7 @@ inline DateLit operator+(const DateLit , const 
YearMonthIntervalLit ) {
   }
 
   const std::uint8_t result_day = static_cast(
-  ClampDayOfMonth(result_year, result_month, lhs.day));
+  ClampDayOfMonth(result_year, result_month, lhs.dayField()));
 
   return DateLit::Create(result_year, result_month, result_day);
 }
@@ -187,8 +187,8 @@ inline DatetimeLit operator-(const DatetimeLit , const 
YearMonthIntervalLit
 }
 
 inline DateLit operator-(const DateLit , const YearMonthIntervalLit ) {
-  std::int32_t result_year = lhs.year - (rhs.months / 12);
-  std::int8_t result_month = lhs.month - (rhs.months % 12);
+  std::int32_t result_year = lhs.yearField() - (rhs.months / 12);
+  std::int8_t result_month = static_cast(lhs.monthField()) - 
(rhs.months % 12);
 
   if (result_month < 0) {
 --result_year;
@@ -196,7 +196,7 @@ inline DateLit operator-(const DateLit , const 
YearMonthIntervalLit ) {
   }
 
   const std::uint8_t result_day = static_cast(
-  ClampDayOfMonth(result_year, result_month, lhs.day));
+  ClampDayOfMonth(result_year, result_month, lhs.dayField()));
 
   return DateLit::Create(result_year, result_month, result_day);
 }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/5a9c2900/types/DateType.cpp
--
diff --git a/types/DateType.cpp b/types/DateType.cpp
index 5bb982c..388898e 100644
--- a/types/DateType.cpp
+++ b/types/DateType.cpp
@@ -60,7 +60,7 @@ std::string DateType::printValueToString(const TypedValue 
) const {
   DCHECK(!value.isNull());
 
   const DateLit literal = value.getLiteral();
-  const std::int32_t year = literal.year;
+  const std::int32_t year = literal.yearField();
 
   char datebuf[DateLit::kIsoChars + 1];
   std::size_t chars_written = 0;
@@ -78,9 +78,9 @@ std::string DateType::printValueToString(const TypedValue 
) const {
   // All the rest of the ISO 8601 date/time parts.
   snprintf_result = snprintf(datebuf + chars_written,
  sizeof(datebuf) - chars_written,
- "%02d-%02d",
- literal.month,
- literal.day);
+ "%02u-%02u",
+ literal.monthField(),
+ literal.dayField());
   CheckSnprintf(snprintf_result, sizeof(datebuf), _written);
 
   return std::string(datebuf);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/5a9c2900/types/DatetimeLit.hpp

incubator-quickstep git commit: Introduced DestroyAggregationState operator

2016-09-06 Thread zuyuz
Repository: incubator-quickstep
Updated Branches:
  refs/heads/master 1d1042291 -> 590ba4dac


Introduced DestroyAggregationState operator

- Similar to the pattern with DestroyHash, this operator destroys the
  AggregationState once the Finalize aggregation operator finishes its
  execution.
- Optimizer support for DestroyAggregationState operator.
- Removed unused QueryContext::releaseAggregationState method.


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

Branch: refs/heads/master
Commit: 590ba4dacfe0c65a1d254e79daaecbf4f1f5854b
Parents: 1d10422
Author: Harshad Deshmukh 
Authored: Tue Aug 23 11:00:57 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:21:39 2016 -0500

--
 query_execution/QueryContext.hpp|  10 +-
 query_optimizer/CMakeLists.txt  |   1 +
 query_optimizer/ExecutionGenerator.cpp  |  10 ++
 relational_operators/CMakeLists.txt |  16 +++
 .../DestroyAggregationStateOperator.cpp |  64 ++
 .../DestroyAggregationStateOperator.hpp | 120 +++
 .../FinalizeAggregationOperator.cpp |   2 +-
 .../FinalizeAggregationOperator.hpp |   3 +-
 relational_operators/WorkOrder.proto|   7 ++
 relational_operators/WorkOrderFactory.cpp   |  16 ++-
 .../tests/AggregationOperator_unittest.cpp  |  25 
 11 files changed, 264 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/590ba4da/query_execution/QueryContext.hpp
--
diff --git a/query_execution/QueryContext.hpp b/query_execution/QueryContext.hpp
index c54c7ff..393b55e 100644
--- a/query_execution/QueryContext.hpp
+++ b/query_execution/QueryContext.hpp
@@ -182,16 +182,14 @@ class QueryContext {
   }
 
   /**
-   * @brief Release the given AggregationOperationState.
+   * @brief Destroy the given aggregation state.
*
-   * @param id The id of the AggregationOperationState to destroy.
-   *
-   * @return The AggregationOperationState, alreadly created in the 
constructor.
+   * @param id The ID of the AggregationOperationState to destroy.
**/
-  inline AggregationOperationState* releaseAggregationState(const 
aggregation_state_id id) {
+  inline void destroyAggregationState(const aggregation_state_id id) {
 DCHECK_LT(id, aggregation_states_.size());
 DCHECK(aggregation_states_[id]);
-return aggregation_states_[id].release();
+aggregation_states_[id].reset(nullptr);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/590ba4da/query_optimizer/CMakeLists.txt
--
diff --git a/query_optimizer/CMakeLists.txt b/query_optimizer/CMakeLists.txt
index 56ae52f..32f7885 100644
--- a/query_optimizer/CMakeLists.txt
+++ b/query_optimizer/CMakeLists.txt
@@ -118,6 +118,7 @@ 
target_link_libraries(quickstep_queryoptimizer_ExecutionGenerator
   quickstep_relationaloperators_CreateIndexOperator
   quickstep_relationaloperators_CreateTableOperator
   quickstep_relationaloperators_DeleteOperator
+  
quickstep_relationaloperators_DestroyAggregationStateOperator
   quickstep_relationaloperators_DestroyHashOperator
   quickstep_relationaloperators_DropTableOperator
   quickstep_relationaloperators_FinalizeAggregationOperator

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/590ba4da/query_optimizer/ExecutionGenerator.cpp
--
diff --git a/query_optimizer/ExecutionGenerator.cpp 
b/query_optimizer/ExecutionGenerator.cpp
index 2e03e09..130134c 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -94,6 +94,7 @@
 #include "relational_operators/CreateIndexOperator.hpp"
 #include "relational_operators/CreateTableOperator.hpp"
 #include "relational_operators/DeleteOperator.hpp"
+#include "relational_operators/DestroyAggregationStateOperator.hpp"
 #include "relational_operators/DestroyHashOperator.hpp"
 #include "relational_operators/DropTableOperator.hpp"
 #include "relational_operators/FinalizeAggregationOperator.hpp"
@@ -1464,6 +1465,15 @@ void ExecutionGenerator::convertAggregate(
   std::forward_as_tuple(finalize_aggregation_operator_index, 
output_relation));
   

[01/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache. [Forced Update!]

2016-09-06 Thread hbdeshmukh
Repository: incubator-quickstep
Updated Branches:
  refs/heads/partitioned-aggregation b7bc9f4a2 -> 63f66a242 (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/utility/tests/CalculateInstalledMemory_unittest.cpp
--
diff --git a/utility/tests/CalculateInstalledMemory_unittest.cpp 
b/utility/tests/CalculateInstalledMemory_unittest.cpp
index 0bfec64..eb34f89 100644
--- a/utility/tests/CalculateInstalledMemory_unittest.cpp
+++ b/utility/tests/CalculateInstalledMemory_unittest.cpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/utility/tests/DAG_unittest.cpp
--
diff --git a/utility/tests/DAG_unittest.cpp b/utility/tests/DAG_unittest.cpp
index 30a8250..3fe2990 100644
--- a/utility/tests/DAG_unittest.cpp
+++ b/utility/tests/DAG_unittest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/utility/tests/EqualsAnyConstant_benchmark.cpp
--
diff --git a/utility/tests/EqualsAnyConstant_benchmark.cpp 
b/utility/tests/EqualsAnyConstant_benchmark.cpp
index 75eeed9..a50a87f 100644
--- a/utility/tests/EqualsAnyConstant_benchmark.cpp
+++ b/utility/tests/EqualsAnyConstant_benchmark.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   Licensed under the Apache License, Version 2.0 

[10/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/storage/tests/StorageTestConfig.h.in
--
diff --git a/storage/tests/StorageTestConfig.h.in 
b/storage/tests/StorageTestConfig.h.in
index 9db581d..4ffb09a 100644
--- a/storage/tests/StorageTestConfig.h.in
+++ b/storage/tests/StorageTestConfig.h.in
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #cmakedefine QUICKSTEP_LONG_HASH_REVERSIBLE

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/storage/tests/TupleStorePredicateUtil.hpp
--
diff --git a/storage/tests/TupleStorePredicateUtil.hpp 
b/storage/tests/TupleStorePredicateUtil.hpp
index a2a5777..dcdf0fa 100644
--- a/storage/tests/TupleStorePredicateUtil.hpp
+++ b/storage/tests/TupleStorePredicateUtil.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_STORAGE_TESTS_TUPLE_STORE_PREDICATE_UTIL_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/storage/tests/WindowAggregationOperationState_unittest.cpp
--
diff --git a/storage/tests/WindowAggregationOperationState_unittest.cpp 
b/storage/tests/WindowAggregationOperationState_unittest.cpp
index d58f0f5..c12f66f 100644
--- a/storage/tests/WindowAggregationOperationState_unittest.cpp
+++ b/storage/tests/WindowAggregationOperationState_unittest.cpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file 

[05/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/IntervalParser.hpp
--
diff --git a/types/IntervalParser.hpp b/types/IntervalParser.hpp
index 0b9d499..bafd6e1 100644
--- a/types/IntervalParser.hpp
+++ b/types/IntervalParser.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_TYPES_INTERVAL_PARSER_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/LongType.cpp
--
diff --git a/types/LongType.cpp b/types/LongType.cpp
index feedb9d..fbf8d30 100644
--- a/types/LongType.cpp
+++ b/types/LongType.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef __STDC_FORMAT_MACROS

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/LongType.hpp
--
diff --git a/types/LongType.hpp b/types/LongType.hpp
index 0721035..a90dd32 100644
--- a/types/LongType.hpp
+++ b/types/LongType.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under 

[54/73] [abbrv] incubator-quickstep git commit: Fixed 4 failures on unit tests

2016-09-06 Thread hbdeshmukh
Fixed 4 failures on unit tests


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

Branch: refs/heads/partitioned-aggregation
Commit: 48dc0e819b7b595ac89676fdc74745c36ea3707a
Parents: 169ae32
Author: rathijit 
Authored: Fri Aug 5 06:00:12 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 .../aggregation/AggregationConcreteHandle.cpp   | 14 +++---
 .../aggregation/AggregationConcreteHandle.hpp   | 41 ++--
 expressions/aggregation/AggregationHandle.hpp   |  6 ++-
 .../aggregation/AggregationHandleAvg.cpp| 14 +++---
 .../aggregation/AggregationHandleAvg.hpp| 15 +-
 .../aggregation/AggregationHandleCount.cpp  |  7 +--
 .../aggregation/AggregationHandleCount.hpp  | 19 ++--
 .../aggregation/AggregationHandleDistinct.cpp   |  2 +-
 .../aggregation/AggregationHandleDistinct.hpp   |  2 +-
 .../aggregation/AggregationHandleMax.cpp| 14 +++---
 .../aggregation/AggregationHandleMax.hpp| 13 -
 .../aggregation/AggregationHandleMin.cpp| 14 +++---
 .../aggregation/AggregationHandleMin.hpp| 15 +-
 .../aggregation/AggregationHandleSum.cpp| 15 +++---
 .../aggregation/AggregationHandleSum.hpp| 15 +-
 storage/AggregationOperationState.cpp   | 51 +++-
 storage/CMakeLists.txt  |  1 -
 storage/FastHashTable.hpp   | 41 +++-
 storage/FastSeparateChainingHashTable.hpp   | 16 +++---
 19 files changed, 221 insertions(+), 94 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/48dc0e81/expressions/aggregation/AggregationConcreteHandle.cpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.cpp 
b/expressions/aggregation/AggregationConcreteHandle.cpp
index 1efe010..ac5148b 100644
--- a/expressions/aggregation/AggregationConcreteHandle.cpp
+++ b/expressions/aggregation/AggregationConcreteHandle.cpp
@@ -52,17 +52,17 @@ void 
AggregationConcreteHandle::insertValueAccessorIntoDistinctifyHashTable(
 AggregationStateHashTableBase *distinctify_hash_table) const {
   // If the key-value pair is already there, we don't need to update the value,
   // which should always be "true". I.e. the value is just a placeholder.
-//  const auto noop_upserter = [](const auto , const bool *value) -> 
void {};
+  //  const auto noop_upserter = [](const auto , const bool *value) 
-> void {};
 
   AggregationStateFastHashTable *hash_table =
   static_cast(distinctify_hash_table);
   if (key_ids.size() == 1) {
-// TODO(rathijit): fix
-//hash_table->upsertValueAccessor(accessor,
-//key_ids[0],
-//true /* check_for_null_keys */,
-//true /* initial_value */,
-//_upserter);
+std::vector args;
+args.emplace_back(key_ids);
+hash_table->upsertValueAccessorFast(args,
+accessor,
+key_ids[0],
+true /* check_for_null_keys */);
   } else {
 std::vector empty_args;
 empty_args.resize(1);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/48dc0e81/expressions/aggregation/AggregationConcreteHandle.hpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.hpp 
b/expressions/aggregation/AggregationConcreteHandle.hpp
index d332ec9..609937a 100644
--- a/expressions/aggregation/AggregationConcreteHandle.hpp
+++ b/expressions/aggregation/AggregationConcreteHandle.hpp
@@ -27,6 +27,7 @@
 #include "catalog/CatalogTypedefs.hpp"
 #include "expressions/aggregation/AggregationHandle.hpp"
 #include "storage/HashTable.hpp"
+#include "storage/FastHashTable.hpp"
 #include "storage/HashTableBase.hpp"
 #include "types/TypedValue.hpp"
 #include "types/containers/ColumnVector.hpp"
@@ -278,6 +279,11 @@ class AggregationConcreteHandle : public AggregationHandle 
{
   const AggregationStateHashTableBase _hash_table) const;
 
   template 
+  StateT* aggregateOnDistinctifyHashTableForSingleUnaryHelperFast(
+  const AggregationStateHashTableBase _hash_table) const;
+
+  template 
   void aggregateOnDistinctifyHashTableForGroupByUnaryHelper(
@@ -289,7 +295,7 @@ class AggregationConcreteHandle : 

[23/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/window_aggregation/WindowAggregationHandle.cpp
--
diff --git a/expressions/window_aggregation/WindowAggregationHandle.cpp 
b/expressions/window_aggregation/WindowAggregationHandle.cpp
index 835eaff..f26656d 100644
--- a/expressions/window_aggregation/WindowAggregationHandle.cpp
+++ b/expressions/window_aggregation/WindowAggregationHandle.cpp
@@ -1,20 +1,20 @@
 /**
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you 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 at
- * 
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
  **/
 
 #include "expressions/window_aggregation/WindowAggregationHandle.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/window_aggregation/WindowAggregationHandle.hpp
--
diff --git a/expressions/window_aggregation/WindowAggregationHandle.hpp 
b/expressions/window_aggregation/WindowAggregationHandle.hpp
index 41d1d96..3569123 100644
--- a/expressions/window_aggregation/WindowAggregationHandle.hpp
+++ b/expressions/window_aggregation/WindowAggregationHandle.hpp
@@ -1,20 +1,20 @@
 /**
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you 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 at
- * 
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
  **/
 
 #ifndef QUICKSTEP_EXPRESSIONS_WINDOW_AGGREGATION_WINDOW_AGGREGATION_HANDLE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
--
diff --git a/expressions/window_aggregation/WindowAggregationHandleAvg.cpp 
b/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
index e6a4b3f..b1c6e3b 100644
--- a/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
+++ 

[63/73] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
Modified Aggregation unit test. Ran clang-format.


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

Branch: refs/heads/partitioned-aggregation
Commit: 63a65249150145f01bf47b34b57e30807aa2e4a0
Parents: a0eedcb
Author: rathijit 
Authored: Sun Aug 21 05:33:40 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:40:00 2016 -0500

--
 .../aggregation/AggregationConcreteHandle.hpp   |  153 +-
 expressions/aggregation/AggregationHandle.hpp   |   48 +-
 .../aggregation/AggregationHandleAvg.cpp|   96 +-
 .../aggregation/AggregationHandleAvg.hpp|  130 +-
 .../aggregation/AggregationHandleCount.cpp  |  150 +-
 .../aggregation/AggregationHandleCount.hpp  |  118 +-
 .../aggregation/AggregationHandleDistinct.hpp   |   28 +-
 .../aggregation/AggregationHandleMax.cpp|   71 +-
 .../aggregation/AggregationHandleMax.hpp|   98 +-
 .../aggregation/AggregationHandleMin.cpp|   73 +-
 .../aggregation/AggregationHandleMin.hpp|  101 +-
 .../aggregation/AggregationHandleSum.cpp|   87 +-
 .../aggregation/AggregationHandleSum.hpp|  113 +-
 expressions/aggregation/CMakeLists.txt  |   85 +-
 .../tests/AggregationHandleAvg_unittest.cpp |  255 ++--
 .../tests/AggregationHandleCount_unittest.cpp   |  311 ++--
 .../tests/AggregationHandleMax_unittest.cpp |  382 +++--
 .../tests/AggregationHandleMin_unittest.cpp |  378 +++--
 .../tests/AggregationHandleSum_unittest.cpp |  291 ++--
 storage/AggregationOperationState.cpp   |  263 ++--
 storage/AggregationOperationState.hpp   |   42 +-
 storage/FastHashTable.hpp   | 1419 ++
 storage/FastSeparateChainingHashTable.hpp   | 1171 +--
 storage/HashTableBase.hpp   |   20 +-
 24 files changed, 3268 insertions(+), 2615 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/expressions/aggregation/AggregationConcreteHandle.hpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.hpp 
b/expressions/aggregation/AggregationConcreteHandle.hpp
index 5b47e93..ac37bae 100644
--- a/expressions/aggregation/AggregationConcreteHandle.hpp
+++ b/expressions/aggregation/AggregationConcreteHandle.hpp
@@ -21,18 +21,18 @@
 #define QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_CONCRETE_HANDLE_HPP_
 
 #include 
-#include 
 #include 
+#include 
 
 #include "catalog/CatalogTypedefs.hpp"
 #include "expressions/aggregation/AggregationHandle.hpp"
-#include "storage/HashTable.hpp"
 #include "storage/FastHashTable.hpp"
+#include "storage/HashTable.hpp"
 #include "storage/HashTableBase.hpp"
+#include "threading/SpinMutex.hpp"
 #include "types/TypedValue.hpp"
 #include "types/containers/ColumnVector.hpp"
 #include "utility/Macros.hpp"
-#include "threading/SpinMutex.hpp"
 
 #include "glog/logging.h"
 
@@ -61,7 +61,8 @@ class HashTableStateUpserterFast {
*table. The corresponding state (for the same key) in the 
destination
*hash table will be upserted.
**/
-  HashTableStateUpserterFast(const HandleT , const uint8_t 
*source_state)
+  HashTableStateUpserterFast(const HandleT ,
+ const std::uint8_t *source_state)
   : handle_(handle), source_state_(source_state) {}
 
   /**
@@ -70,13 +71,13 @@ class HashTableStateUpserterFast {
* @param destination_state The aggregation state in the aggregation hash
*table that is being upserted.
**/
-  void operator()(uint8_t *destination_state) {
+  void operator()(std::uint8_t *destination_state) {
 handle_.mergeStatesFast(source_state_, destination_state);
   }
 
  private:
   const HandleT _;
-  const uint8_t *source_state_;
+  const std::uint8_t *source_state_;
 
   DISALLOW_COPY_AND_ASSIGN(HashTableStateUpserterFast);
 };
@@ -108,13 +109,15 @@ class AggregationConcreteHandle : public 
AggregationHandle {
*/
   AggregationStateHashTableBase* createDistinctifyHashTable(
   const HashTableImplType hash_table_impl,
-  const std::vector _types,
+  const std::vector _types,
   const std::size_t estimated_num_distinct_keys,
   StorageManager *storage_manager) const override;
 
   /**
-   * @brief Implementaion for 
AggregationHandle::insertValueAccessorIntoDistinctifyHashTable()
-   *that inserts the GROUP BY expressions and aggregation arguments 
together
+   * @brief Implementaion for
+   * 

[03/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/operations/comparisons/NotEqualComparison.hpp
--
diff --git a/types/operations/comparisons/NotEqualComparison.hpp 
b/types/operations/comparisons/NotEqualComparison.hpp
index 995eaf3..560f613 100644
--- a/types/operations/comparisons/NotEqualComparison.hpp
+++ b/types/operations/comparisons/NotEqualComparison.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_TYPES_OPERATIONS_COMPARISONS_NOT_EQUAL_COMPARISON_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/operations/comparisons/PatternMatchingComparators-inl.hpp
--
diff --git a/types/operations/comparisons/PatternMatchingComparators-inl.hpp 
b/types/operations/comparisons/PatternMatchingComparators-inl.hpp
index 6188a52..617eadf 100644
--- a/types/operations/comparisons/PatternMatchingComparators-inl.hpp
+++ b/types/operations/comparisons/PatternMatchingComparators-inl.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- *   University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef 
QUICKSTEP_TYPES_OPERATIONS_COMPARISONS_PATTERN_MATCHING_COMPARATORS_INL_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/operations/comparisons/PatternMatchingComparators.hpp
--
diff --git a/types/operations/comparisons/PatternMatchingComparators.hpp 
b/types/operations/comparisons/PatternMatchingComparators.hpp
index ed105a6..bb2af97 100644
--- a/types/operations/comparisons/PatternMatchingComparators.hpp
+++ b/types/operations/comparisons/PatternMatchingComparators.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- *   University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * 

[12/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/storage/DataExchangerAsync.hpp
--
diff --git a/storage/DataExchangerAsync.hpp b/storage/DataExchangerAsync.hpp
index 75a4e4d..f3b256a 100644
--- a/storage/DataExchangerAsync.hpp
+++ b/storage/DataExchangerAsync.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_STORAGE_DATA_EXCHANGER_ASYNC_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/storage/EvictionPolicy.cpp
--
diff --git a/storage/EvictionPolicy.cpp b/storage/EvictionPolicy.cpp
index b7e0033..2f10f09 100644
--- a/storage/EvictionPolicy.cpp
+++ b/storage/EvictionPolicy.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "storage/EvictionPolicy.hpp"
@@ -310,12 +312,12 @@ class LRUKEvictionPolicyImpl : public EvictionPolicy {
 #ifdef QUICKSTEP_DEBUG
   /**
* @brief Prints the contents of the LRUKEvictionPolicyImpl. Use this
-   *strictly for debugging purposes. 
+   *strictly for debugging purposes.
*WARNING: This method is not safe as it does not acquire
-   * any mutexes on the internal state variable, so use it 
+   * any mutexes on the internal state variable, so use it
* primarily for debugging purposes.
*
-   * @param print_map If true, print the eviction map. 
+   * @param print_map If true, print the eviction map.
* @param print_nr_list If true, print the list of non referenced blocks.
*
*/

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/storage/EvictionPolicy.hpp
--
diff --git a/storage/EvictionPolicy.hpp b/storage/EvictionPolicy.hpp
index ae2a258..9c98fcd 100644
--- a/storage/EvictionPolicy.hpp
+++ b/storage/EvictionPolicy.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, 

[64/73] [abbrv] incubator-quickstep git commit: Initial commit for partitioned hash tables.

2016-09-06 Thread hbdeshmukh
Initial commit for partitioned hash tables.


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

Branch: refs/heads/partitioned-aggregation
Commit: 6fa0e295d403815f810050c61260b9e9e86b5c26
Parents: 63a6524
Author: Harshad Deshmukh 
Authored: Mon Aug 15 12:21:19 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 12:09:02 2016 -0500

--
 storage/AggregationOperationState.hpp |   1 +
 storage/CMakeLists.txt|  11 ++
 storage/PartitionedHashTablePool.hpp  | 201 +
 3 files changed, 213 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6fa0e295/storage/AggregationOperationState.hpp
--
diff --git a/storage/AggregationOperationState.hpp 
b/storage/AggregationOperationState.hpp
index 7956bc6..66af517 100644
--- a/storage/AggregationOperationState.hpp
+++ b/storage/AggregationOperationState.hpp
@@ -32,6 +32,7 @@
 #include "storage/AggregationOperationState.pb.h"
 #include "storage/HashTableBase.hpp"
 #include "storage/HashTablePool.hpp"
+#include "storage/PartitionedHashTablePool.hpp"
 #include "storage/StorageBlockInfo.hpp"
 #include "utility/Macros.hpp"
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6fa0e295/storage/CMakeLists.txt
--
diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt
index f05cc46..3d6e8d4 100644
--- a/storage/CMakeLists.txt
+++ b/storage/CMakeLists.txt
@@ -235,6 +235,7 @@ 
add_library(quickstep_storage_PackedRowStoreTupleStorageSubBlock
 add_library(quickstep_storage_PackedRowStoreValueAccessor
 ../empty_src.cpp
 PackedRowStoreValueAccessor.hpp)
+add_library(quickstep_storage_PartitionedHashTablePool ../empty_src.cpp 
PartitionedHashTablePool.hpp)
 add_library(quickstep_storage_PreloaderThread PreloaderThread.cpp 
PreloaderThread.hpp)
 add_library(quickstep_storage_SMAIndexSubBlock SMAIndexSubBlock.cpp 
SMAIndexSubBlock.hpp)
 add_library(quickstep_storage_SeparateChainingHashTable ../empty_src.cpp 
SeparateChainingHashTable.hpp)
@@ -289,6 +290,7 @@ 
target_link_libraries(quickstep_storage_AggregationOperationState
   quickstep_storage_HashTableFactory
   quickstep_storage_HashTablePool
   quickstep_storage_InsertDestination
+  quickstep_storage_PartitionedHashTablePool
   quickstep_storage_StorageBlock
   quickstep_storage_StorageBlockInfo
   quickstep_storage_StorageManager
@@ -850,6 +852,14 @@ 
target_link_libraries(quickstep_storage_PackedRowStoreValueAccessor
   quickstep_types_TypedValue
   quickstep_utility_BitVector
   quickstep_utility_Macros)
+target_link_libraries(quickstep_storage_PartitionedHashTablePool
+  glog
+  quickstep_expressions_aggregation_AggregationHandle
+  quickstep_storage_FastHashTable
+  quickstep_storage_FastHashTableFactory
+  quickstep_storage_HashTableBase
+  quickstep_utility_Macros
+  quickstep_utility_StringUtil)
 target_link_libraries(quickstep_storage_PreloaderThread
   glog
   quickstep_catalog_CatalogDatabase
@@ -1167,6 +1177,7 @@ target_link_libraries(quickstep_storage
   quickstep_storage_LinearOpenAddressingHashTable
   quickstep_storage_PackedRowStoreTupleStorageSubBlock
   quickstep_storage_PackedRowStoreValueAccessor
+  quickstep_storage_PartitionedHashTablePool
   quickstep_storage_PreloaderThread
   quickstep_storage_SMAIndexSubBlock
   quickstep_storage_SeparateChainingHashTable

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6fa0e295/storage/PartitionedHashTablePool.hpp
--
diff --git a/storage/PartitionedHashTablePool.hpp 
b/storage/PartitionedHashTablePool.hpp
new file mode 100644
index 000..a71af44
--- /dev/null
+++ b/storage/PartitionedHashTablePool.hpp
@@ -0,0 +1,201 @@
+/**
+ *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
+ * University of Wisconsin—Madison.
+ *
+ *   Licensed under the Apache License, 

[09/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/include/tmb/internal/log_reader_posix.h
--
diff --git a/third_party/tmb/include/tmb/internal/log_reader_posix.h 
b/third_party/tmb/include/tmb/internal/log_reader_posix.h
index 5a4e74e..2dba5f3 100644
--- a/third_party/tmb/include/tmb/internal/log_reader_posix.h
+++ b/third_party/tmb/include/tmb/internal/log_reader_posix.h
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ **/
 
 #ifndef TMB_INTERNAL_LOG_READER_POSIX_H_
 #define TMB_INTERNAL_LOG_READER_POSIX_H_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/include/tmb/internal/log_reader_stdio.h
--
diff --git a/third_party/tmb/include/tmb/internal/log_reader_stdio.h 
b/third_party/tmb/include/tmb/internal/log_reader_stdio.h
index 9754e5b..6cb1d95 100644
--- a/third_party/tmb/include/tmb/internal/log_reader_stdio.h
+++ b/third_party/tmb/include/tmb/internal/log_reader_stdio.h
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ **/
 
 #ifndef TMB_INTERNAL_LOG_READER_STDIO_H_
 #define TMB_INTERNAL_LOG_READER_STDIO_H_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/include/tmb/internal/log_record_header.h
--
diff --git a/third_party/tmb/include/tmb/internal/log_record_header.h 
b/third_party/tmb/include/tmb/internal/log_record_header.h
index b57dcf0..a9fd47e 100644
--- a/third_party/tmb/include/tmb/internal/log_record_header.h
+++ b/third_party/tmb/include/tmb/internal/log_record_header.h
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software

[21/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_execution/PolicyEnforcerSingleNode.hpp
--
diff --git a/query_execution/PolicyEnforcerSingleNode.hpp 
b/query_execution/PolicyEnforcerSingleNode.hpp
index 671fd83..870df95 100644
--- a/query_execution/PolicyEnforcerSingleNode.hpp
+++ b/query_execution/PolicyEnforcerSingleNode.hpp
@@ -1,15 +1,20 @@
 /**
- *   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 at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_EXECUTION_POLICY_ENFORCER_SINGLE_NODE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_execution/QueryContext.cpp
--
diff --git a/query_execution/QueryContext.cpp b/query_execution/QueryContext.cpp
index 7019b6a..2572e18 100644
--- a/query_execution/QueryContext.cpp
+++ b/query_execution/QueryContext.cpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "query_execution/QueryContext.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_execution/QueryContext.hpp
--
diff --git a/query_execution/QueryContext.hpp b/query_execution/QueryContext.hpp
index 9171250..c54c7ff 100644
--- a/query_execution/QueryContext.hpp
+++ b/query_execution/QueryContext.hpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may 

[16/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/rules/PushDownSemiAntiJoin.cpp
--
diff --git a/query_optimizer/rules/PushDownSemiAntiJoin.cpp 
b/query_optimizer/rules/PushDownSemiAntiJoin.cpp
index d53970e..7c54edf 100644
--- a/query_optimizer/rules/PushDownSemiAntiJoin.cpp
+++ b/query_optimizer/rules/PushDownSemiAntiJoin.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "query_optimizer/rules/PushDownSemiAntiJoin.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/rules/PushDownSemiAntiJoin.hpp
--
diff --git a/query_optimizer/rules/PushDownSemiAntiJoin.hpp 
b/query_optimizer/rules/PushDownSemiAntiJoin.hpp
index 7b1ea85..8374d80 100644
--- a/query_optimizer/rules/PushDownSemiAntiJoin.hpp
+++ b/query_optimizer/rules/PushDownSemiAntiJoin.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_RULES_PUSH_DOWN_SEMI_ANTI_JOIN_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/rules/Rule.hpp
--
diff --git a/query_optimizer/rules/Rule.hpp b/query_optimizer/rules/Rule.hpp
index 7e0e98e..9f4f30a 100644
--- a/query_optimizer/rules/Rule.hpp
+++ b/query_optimizer/rules/Rule.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 

[55/73] [abbrv] incubator-quickstep git commit: Removed some dead code and made minor updates.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/a0eedcb9/storage/FastSeparateChainingHashTable.hpp
--
diff --git a/storage/FastSeparateChainingHashTable.hpp 
b/storage/FastSeparateChainingHashTable.hpp
index 49cea5b..0670993 100644
--- a/storage/FastSeparateChainingHashTable.hpp
+++ b/storage/FastSeparateChainingHashTable.hpp
@@ -120,25 +120,15 @@ class FastSeparateChainingHashTable : public 
FastHashTable
-::putCompositeKeyInternal(const std::vector ,
-  const std::size_t variable_key_size,
-  const uint8_t ,
-  HashTablePreallocationState *prealloc_state) 
{
-  DEBUG_ASSERT(this->key_types_.size() == key.size());
-
-  if (prealloc_state == nullptr) {
-// Early check for a free bucket.
-if (header_->buckets_allocated.load(std::memory_order_relaxed) >= 
header_->num_buckets) {
-  return HashTablePutResult::kOutOfSpace;
-}
-
-// TODO(chasseur): If allow_duplicate_keys is true, avoid storing more than
-// one copy of the same variable-length key.
-if (!key_manager_.allocateVariableLengthKeyStorage(variable_key_size)) {
-  // Ran out of variable-length key storage space.
-  return HashTablePutResult::kOutOfSpace;
-}
-  }
-
-  const std::size_t hash_code = this->hashCompositeKey(key);
-  void *bucket = nullptr;
-  std::atomic *pending_chain_ptr;
-  std::size_t pending_chain_ptr_finish_value;
-  for (;;) {
-if (locateBucketForInsertion(hash_code,
- 0,
- ,
- _chain_ptr,
- _chain_ptr_finish_value,
- prealloc_state)) {
-  // Found an empty bucket.
-  break;
-} else if (bucket == nullptr) {
-  // Ran out of buckets. Deallocate any variable space that we were unable
-  // to use.
-  DEBUG_ASSERT(prealloc_state == nullptr);
-  key_manager_.deallocateVariableLengthKeyStorage(variable_key_size);
-  return HashTablePutResult::kOutOfSpace;
-} else {
-  // Hash collision found, and duplicates aren't allowed.
-  DEBUG_ASSERT(!allow_duplicate_keys);
-  DEBUG_ASSERT(prealloc_state == nullptr);
-  if (key_manager_.compositeKeyCollisionCheck(key, bucket)) {
-// Duplicate key. Deallocate any variable storage space and return.
-key_manager_.deallocateVariableLengthKeyStorage(variable_key_size);
-return HashTablePutResult::kDuplicateKey;
-  }
-}
-  }
-
-  // Write the key and hash.
-  writeCompositeKeyToBucket(key, hash_code, bucket, prealloc_state);
-
-  // Store the value by using placement new with ValueT's copy constructor.
-  new(static_cast(bucket) + kValueOffset) uint8_t(value);
-
-  // Update the previous chain pointer to point to the new bucket.
-  pending_chain_ptr->store(pending_chain_ptr_finish_value, 
std::memory_order_release);
-
-  // We're all done.
-  return HashTablePutResult::kOK;
-}
-
-template 

[69/73] [abbrv] incubator-quickstep git commit: Changed the bool flag

2016-09-06 Thread hbdeshmukh
Changed the bool flag


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

Branch: refs/heads/partitioned-aggregation
Commit: 6ecda1f742f08b27de3bf1c1b9bd4c1a49b5e2d9
Parents: 4064d39
Author: Harshad Deshmukh 
Authored: Fri Aug 19 15:00:28 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 15:01:33 2016 -0500

--
 storage/AggregationOperationState.cpp | 3 ++-
 storage/AggregationOperationState.hpp | 5 +
 2 files changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6ecda1f7/storage/AggregationOperationState.cpp
--
diff --git a/storage/AggregationOperationState.cpp 
b/storage/AggregationOperationState.cpp
index 6b4a672..20ba114 100644
--- a/storage/AggregationOperationState.cpp
+++ b/storage/AggregationOperationState.cpp
@@ -68,7 +68,7 @@ AggregationOperationState::AggregationOperationState(
 const HashTableImplType hash_table_impl_type,
 const std::vector _hash_table_impl_types,
 StorageManager *storage_manager)
-: is_aggregate_partitioned_(estimated_num_entries > 
kPartitionedAggregateThreshold),
+: is_aggregate_partitioned_(estimated_num_entries > 
kPartitionedAggregateThreshold && !group_by.empty()),
   input_relation_(input_relation),
   predicate_(predicate),
   group_by_list_(std::move(group_by)),
@@ -76,6 +76,7 @@ AggregationOperationState::AggregationOperationState(
   is_distinct_(std::move(is_distinct)),
   storage_manager_(storage_manager) {
   // Sanity checks: each aggregate has a corresponding list of arguments.
+  LOG(INFO) << "Aggregate partitioned: " << is_aggregate_partitioned_ << " 
with estimated # entries: " << estimated_num_entries;
   DCHECK(aggregate_functions.size() == arguments_.size());
 
   // Get the types of GROUP BY expressions for creating HashTables below.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6ecda1f7/storage/AggregationOperationState.hpp
--
diff --git a/storage/AggregationOperationState.hpp 
b/storage/AggregationOperationState.hpp
index 37d77e3..7a11e92 100644
--- a/storage/AggregationOperationState.hpp
+++ b/storage/AggregationOperationState.hpp
@@ -181,6 +181,11 @@ class AggregationOperationState {
   void finalizeAggregatePartitioned(const std::size_t partition_id,
 InsertDestination *output_destination);
 
+  /**
+   * @brief Find if the aggregation has been performed in a partitoned way.
+   *
+   * @note At present the partitioning is enabled only with GROUP BY.
+   **/
   bool isAggregatePartitioned() const {
 return is_aggregate_partitioned_;
   }



[26/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/cli/DropRelation.hpp
--
diff --git a/cli/DropRelation.hpp b/cli/DropRelation.hpp
index e82e246..91cea43 100644
--- a/cli/DropRelation.hpp
+++ b/cli/DropRelation.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_CLI_DROP_RELATION_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/cli/InputParserUtil.cpp
--
diff --git a/cli/InputParserUtil.cpp b/cli/InputParserUtil.cpp
index 352883e..0538afc 100644
--- a/cli/InputParserUtil.cpp
+++ b/cli/InputParserUtil.cpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "cli/InputParserUtil.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/cli/InputParserUtil.hpp
--
diff --git a/cli/InputParserUtil.hpp b/cli/InputParserUtil.hpp
index ebb32d2..d34dbed 100644
--- a/cli/InputParserUtil.hpp
+++ b/cli/InputParserUtil.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
- *  

[58/73] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/storage/FastSeparateChainingHashTable.hpp
--
diff --git a/storage/FastSeparateChainingHashTable.hpp 
b/storage/FastSeparateChainingHashTable.hpp
index 0670993..886a8ca 100644
--- a/storage/FastSeparateChainingHashTable.hpp
+++ b/storage/FastSeparateChainingHashTable.hpp
@@ -27,8 +27,8 @@
 #include 
 #include 
 
-#include "storage/HashTable.hpp"
 #include "storage/FastHashTable.hpp"
+#include "storage/HashTable.hpp"
 #include "storage/HashTableBase.hpp"
 #include "storage/HashTableKeyManager.hpp"
 #include "storage/StorageBlob.hpp"
@@ -55,43 +55,42 @@ template 
-class FastSeparateChainingHashTable : public FastHashTable {
+class FastSeparateChainingHashTable
+: public FastHashTable {
  public:
-  FastSeparateChainingHashTable(const std::vector _types,
-const std::size_t num_entries,
-const std::vector _sizes,
-const std::vector ,
-StorageManager *storage_manager);
-
-  FastSeparateChainingHashTable(const std::vector _types,
-void *hash_table_memory,
-const std::size_t hash_table_memory_size,
-const bool new_hash_table,
-const bool hash_table_memory_zeroed);
+  FastSeparateChainingHashTable(const std::vector _types,
+const std::size_t num_entries,
+const std::vector _sizes,
+const std::vector 
,
+StorageManager *storage_manager);
+
+  FastSeparateChainingHashTable(const std::vector _types,
+void *hash_table_memory,
+const std::size_t hash_table_memory_size,
+const bool new_hash_table,
+const bool hash_table_memory_zeroed);
 
   // Delegating constructors for single scalar keys.
   FastSeparateChainingHashTable(const Type _type,
-const std::size_t num_entries,
-StorageManager *storage_manager)
-  : FastSeparateChainingHashTable(std::vector(1, _type),
-  num_entries,
-  storage_manager) {
-  }
+const std::size_t num_entries,
+StorageManager *storage_manager)
+  : FastSeparateChainingHashTable(std::vector(1, _type),
+  num_entries,
+  storage_manager) {}
 
   FastSeparateChainingHashTable(const Type _type,
-void *hash_table_memory,
-const std::size_t hash_table_memory_size,
-const bool new_hash_table,
-const bool hash_table_memory_zeroed)
-  : FastSeparateChainingHashTable(std::vector(1, _type),
-  hash_table_memory,
-  hash_table_memory_size,
-  new_hash_table,
-  hash_table_memory_zeroed) {
-  }
+void *hash_table_memory,
+const std::size_t hash_table_memory_size,
+const bool new_hash_table,
+const bool hash_table_memory_zeroed)
+  : FastSeparateChainingHashTable(std::vector(1, _type),
+  hash_table_memory,
+  hash_table_memory_size,
+  new_hash_table,
+  hash_table_memory_zeroed) {}
 
   ~FastSeparateChainingHashTable() override {
 DestroyValues(buckets_,
@@ -106,48 +105,54 @@ class FastSeparateChainingHashTable : public 
FastHashTablebuckets_allocated.load(std::memory_order_relaxed);
   }
 
-  const uint8_t* getSingle(const TypedValue ) const override;
-  const uint8_t* getSingleCompositeKey(const std::vector ) 
const override;
-  const uint8_t* getSingleCompositeKey(const std::vector , int 
index) const override;
+  const std::uint8_t* getSingle(const TypedValue ) const override;
+  const std::uint8_t* getSingleCompositeKey(
+  const std::vector ) const override;
+  const std::uint8_t* getSingleCompositeKey(const std::vector 

[35/73] [abbrv] incubator-quickstep git commit: Removed an unused message type.

2016-09-06 Thread hbdeshmukh
Removed an unused message type.


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

Branch: refs/heads/partitioned-aggregation
Commit: 6168996216af8278d5c789c67aa4ec8325fab483
Parents: 2c0ce6a
Author: Zuyu Zhang 
Authored: Mon Aug 8 15:32:34 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 9 10:44:50 2016 -0700

--
 query_execution/ForemanSingleNode.cpp|  4 +---
 query_execution/PolicyEnforcerBase.cpp   | 13 -
 query_execution/QueryExecutionMessages.proto |  5 -
 query_execution/QueryExecutionTypedefs.hpp   |  1 -
 query_execution/Shiftboss.cpp|  1 -
 query_execution/Shiftboss.hpp|  1 -
 query_execution/Worker.hpp   |  1 -
 7 files changed, 1 insertion(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/ForemanSingleNode.cpp
--
diff --git a/query_execution/ForemanSingleNode.cpp 
b/query_execution/ForemanSingleNode.cpp
index 23db379..d064a6f 100644
--- a/query_execution/ForemanSingleNode.cpp
+++ b/query_execution/ForemanSingleNode.cpp
@@ -87,7 +87,6 @@ ForemanSingleNode::ForemanSingleNode(
   kPoisonMessage,
   kRebuildWorkOrderCompleteMessage,
   kWorkOrderFeedbackMessage,
-  kWorkOrdersAvailableMessage,
   kWorkOrderCompleteMessage};
 
   for (const auto message_type : receiver_message_types) {
@@ -122,8 +121,7 @@ void ForemanSingleNode::run() {
   case kDataPipelineMessage:
   case kRebuildWorkOrderCompleteMessage:
   case kWorkOrderCompleteMessage:
-  case kWorkOrderFeedbackMessage:
-  case kWorkOrdersAvailableMessage: {
+  case kWorkOrderFeedbackMessage: {
 policy_enforcer_->processMessage(tagged_message);
 break;
   }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/PolicyEnforcerBase.cpp
--
diff --git a/query_execution/PolicyEnforcerBase.cpp 
b/query_execution/PolicyEnforcerBase.cpp
index 78f7b44..4174bd6 100644
--- a/query_execution/PolicyEnforcerBase.cpp
+++ b/query_execution/PolicyEnforcerBase.cpp
@@ -107,19 +107,6 @@ void PolicyEnforcerBase::processMessage(const 
TaggedMessage _message) {
   op_index, proto.block_id(), proto.relation_id());
   break;
 }
-case kWorkOrdersAvailableMessage: {
-  serialization::WorkOrdersAvailableMessage proto;
-  CHECK(proto.ParseFromArray(tagged_message.message(),
- tagged_message.message_bytes()));
-  query_id = proto.query_id();
-  DCHECK(admitted_queries_.find(query_id) != admitted_queries_.end());
-
-  op_index = proto.operator_index();
-
-  // Check if new work orders are available.
-  admitted_queries_[query_id]->fetchNormalWorkOrders(op_index);
-  break;
-}
 case kWorkOrderFeedbackMessage: {
   WorkOrder::FeedbackMessage msg(
   const_cast(tagged_message.message()),

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/QueryExecutionMessages.proto
--
diff --git a/query_execution/QueryExecutionMessages.proto 
b/query_execution/QueryExecutionMessages.proto
index 20b684e..060efa1 100644
--- a/query_execution/QueryExecutionMessages.proto
+++ b/query_execution/QueryExecutionMessages.proto
@@ -74,11 +74,6 @@ message DataPipelineMessage {
   required uint64 query_id = 4;
 }
 
-message WorkOrdersAvailableMessage {
-  required uint64 operator_index = 1;
-  required uint64 query_id = 2;
-}
-
 // Distributed version related messages.
 message ShiftbossRegistrationMessage {
   // The total Work Order processing capacity in Shiftboss, which equals to the

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/QueryExecutionTypedefs.hpp
--
diff --git a/query_execution/QueryExecutionTypedefs.hpp 
b/query_execution/QueryExecutionTypedefs.hpp
index d154d84..33a93b0 100644
--- a/query_execution/QueryExecutionTypedefs.hpp
+++ b/query_execution/QueryExecutionTypedefs.hpp
@@ -69,7 +69,6 @@ enum QueryExecutionMessageType : message_type_id {
   kWorkOrderCompleteMessage,  // From Worker to Foreman.
   kCatalogRelationNewBlockMessage,  // From InsertDestination to Foreman.
   kDataPipelineMessage,  // From InsertDestination or some WorkOrders to 
Foreman.
-  

[44/73] [abbrv] incubator-quickstep git commit: Separate Date type from Datetime type.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/1d104229/types/operations/unary_operations/tests/DateExtractOperation_unittest.cpp
--
diff --git 
a/types/operations/unary_operations/tests/DateExtractOperation_unittest.cpp 
b/types/operations/unary_operations/tests/DateExtractOperation_unittest.cpp
index ec14408..8f4dfc4 100644
--- a/types/operations/unary_operations/tests/DateExtractOperation_unittest.cpp
+++ b/types/operations/unary_operations/tests/DateExtractOperation_unittest.cpp
@@ -31,6 +31,7 @@
 #include "types/operations/unary_operations/DateExtractOperation.hpp"
 #include "types/operations/unary_operations/UnaryOperation.hpp"
 #include "types/operations/unary_operations/UnaryOperationFactory.hpp"
+#include "utility/EqualsAnyConstant.hpp"
 
 #include "gtest/gtest.h"
 
@@ -44,10 +45,13 @@ namespace quickstep {
 class DateExtractOperationTest : public ::testing::Test {
  protected:
   virtual void SetUp() {
-dt_literal_.ticks = 1431359664 * DatetimeLit::kTicksPerSecond;  // Mon, 11 
May 2015 15:54:24 GMT.
-datetime_.reset(new TypedValue(dt_literal_));
-
+datetime_literal_.ticks = 1431359664 * DatetimeLit::kTicksPerSecond;  // 
Mon, 11 May 2015 15:54:24 GMT.
+datetime_.reset(new TypedValue(datetime_literal_));
 datetime_null_.reset(new TypedValue(kDatetime));
+
+date_literal_ = DateLit::Create(2015, 05, 11);  // 11 May 2015.
+date_.reset(new TypedValue(date_literal_));
+date_null_.reset(new TypedValue(kDate));
   }
 
   void checkDateExtractOperationSerialization(const DateExtractOperation 
) {
@@ -57,7 +61,7 @@ class DateExtractOperationTest : public ::testing::Test {
 
EXPECT_TRUE(operation.equals(UnaryOperationFactory::ReconstructFromProto(proto)));
   }
 
-  void checkDateExtract(int64_t expected, const DateExtractUnit unit) {
+  void checkDatetimeExtract(int64_t expected, const DateExtractUnit unit) {
 const DateExtractOperation  = 
DateExtractOperation::Instance(unit);
 checkDateExtractOperationSerialization(operation);
 
@@ -74,22 +78,42 @@ class DateExtractOperationTest : public ::testing::Test {
 
EXPECT_TRUE(unchecked_operator_->applyToTypedValue(*datetime_null_).isNull());
   }
 
+  void checkDateExtract(int32_t expected, const DateExtractUnit unit) {
+const DateExtractOperation  = 
DateExtractOperation::Instance(unit);
+checkDateExtractOperationSerialization(operation);
+
+EXPECT_EQ(expected,
+  operation.applyToChecked(*date_,
+   TypeFactory::GetType(kDate, 
true)).getLiteral());
+EXPECT_TRUE(operation.applyToChecked(*date_null_,
+ TypeFactory::GetType(kDate, 
true)).isNull());
+
+unchecked_operator_.reset(
+
operation.makeUncheckedUnaryOperatorForType(TypeFactory::GetType(kDate, true)));
+EXPECT_EQ(expected, 
unchecked_operator_->applyToTypedValue(*date_).getLiteral());
+
+EXPECT_TRUE(unchecked_operator_->applyToTypedValue(*date_null_).isNull());
+  }
+
   static void CheckFixedNullableResultTypeForField(const DateExtractUnit 
field) {
 const Type *fixed_result_type
 = DateExtractOperation::Instance(field).fixedNullableResultType();
-ASSERT_NE(fixed_result_type, nullptr);
-EXPECT_TRUE(TypeFactory::GetType(kLong, true).equals(*fixed_result_type));
+ASSERT_EQ(fixed_result_type, nullptr);
   }
 
   static void CheckResultTypeIsPlausibleForField(const DateExtractUnit field) {
-// Only Long is plausible.
+// Long and Int are plausible.
 EXPECT_TRUE(DateExtractOperation::Instance(field).resultTypeIsPlausible(
 TypeFactory::GetType(kLong, false)));
 EXPECT_TRUE(DateExtractOperation::Instance(field).resultTypeIsPlausible(
 TypeFactory::GetType(kLong, true)));
+EXPECT_TRUE(DateExtractOperation::Instance(field).resultTypeIsPlausible(
+TypeFactory::GetType(kInt, false)));
+EXPECT_TRUE(DateExtractOperation::Instance(field).resultTypeIsPlausible(
+TypeFactory::GetType(kInt, true)));
 
 for (const TypeID type_id
- : {kInt, kFloat, kDouble, kDatetime, kDatetimeInterval, 
kYearMonthInterval}) {
+ : {kFloat, kDouble, kDatetime, kDatetimeInterval, 
kYearMonthInterval}) {
   EXPECT_FALSE(DateExtractOperation::Instance(field).resultTypeIsPlausible(
   TypeFactory::GetType(type_id, false)));
   EXPECT_FALSE(DateExtractOperation::Instance(field).resultTypeIsPlausible(
@@ -109,16 +133,34 @@ class DateExtractOperationTest : public ::testing::Test {
   static void CheckPushDownTypeHintForField(const DateExtractUnit field) {
 const UnaryOperation  = DateExtractOperation::Instance(field);
 
-// If hint is Long, then the argument is a Datetime with the same
-// nullability.
+// For nullable types.
 const Type *argument_hint
 = op.pushDownTypeHint(::GetType(kLong, true));
-ASSERT_NE(argument_hint, nullptr);
-

[66/73] [abbrv] incubator-quickstep git commit: Created method for partition aware finalize aggregate.

2016-09-06 Thread hbdeshmukh
Created method for partition aware finalize aggregate.


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

Branch: refs/heads/partitioned-aggregation
Commit: 07afae2849cbeb1cfa271d52df4482e39740dcc8
Parents: b22323e
Author: Harshad Deshmukh 
Authored: Thu Aug 18 16:54:38 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 15:01:30 2016 -0500

--
 storage/AggregationOperationState.cpp | 69 +-
 storage/AggregationOperationState.hpp | 33 +-
 2 files changed, 98 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/07afae28/storage/AggregationOperationState.cpp
--
diff --git a/storage/AggregationOperationState.cpp 
b/storage/AggregationOperationState.cpp
index c39e98a..6b4a672 100644
--- a/storage/AggregationOperationState.cpp
+++ b/storage/AggregationOperationState.cpp
@@ -566,8 +566,14 @@ void AggregationOperationState::finalizeHashTable(
 }
 AggregationStateHashTableBase *agg_hash_table = hash_tables->back().get();
 DCHECK(agg_hash_table != nullptr);
-ColumnVector *agg_result_col = handles_[agg_idx]->finalizeHashTable(
-*agg_hash_table, _by_keys, agg_idx);
+// TODO(harshad) - Modify the finalizeHashTable() function called below 
such
+// that group_by_keys is a single ColumnVectorValueAccessor in which there
+// is one ColumnVector per group by key. If we do that, the code below
+// for reorganizing group_by_keys can be removed.
+ColumnVector* agg_result_col =
+handles_[agg_idx]->finalizeHashTable(*agg_hash_table,
+ _by_keys,
+  agg_idx);
 if (agg_result_col != nullptr) {
   final_values.emplace_back(agg_result_col);
 }
@@ -618,4 +624,63 @@ void AggregationOperationState::finalizeHashTable(
   output_destination->bulkInsertTuples(_result);
 }
 
+void AggregationOperationState::finalizeAggregatePartitioned(
+const std::size_t partition_id, InsertDestination *output_destination) {
+  // Each element of 'group_by_keys' is a vector of values for a particular
+  // group (which is also the prefix of the finalized Tuple for that group).
+  std::vector group_by_keys;
+
+  // Collect per-aggregate finalized values.
+  std::vector final_values;
+  for (std::size_t agg_idx = 0; agg_idx < handles_.size(); ++agg_idx) {
+AggregationStateHashTableBase *hash_table =
+partitioned_group_by_hashtable_pool_->getHashTable(partition_id);
+ColumnVector *agg_result_col = handles_[agg_idx]->finalizeHashTable(
+*hash_table, _by_keys, agg_idx);
+if (agg_result_col != nullptr) {
+  final_values.emplace_back(agg_result_col);
+}
+  }
+
+  // Reorganize 'group_by_keys' in column-major order so that we can make a
+  // ColumnVectorsValueAccessor to bulk-insert results.
+  //
+  // TODO(chasseur): Shuffling around the GROUP BY keys like this is suboptimal
+  // if there is only one aggregate. The need to do this should hopefully go
+  // away when we work out storing composite structures for multiple aggregates
+  // in a single HashTable.
+  std::vector group_by_cvs;
+  std::size_t group_by_element_idx = 0;
+  for (const std::unique_ptr _by_element : group_by_list_) 
{
+const Type _by_type = group_by_element->getType();
+if (NativeColumnVector::UsableForType(group_by_type)) {
+  NativeColumnVector *element_cv = new NativeColumnVector(group_by_type, 
group_by_keys.size());
+  group_by_cvs.emplace_back(element_cv);
+  for (std::vector _key : group_by_keys) {
+
element_cv->appendTypedValue(std::move(group_key[group_by_element_idx]));
+  }
+} else {
+  IndirectColumnVector *element_cv = new 
IndirectColumnVector(group_by_type, group_by_keys.size());
+  group_by_cvs.emplace_back(element_cv);
+  for (std::vector _key : group_by_keys) {
+
element_cv->appendTypedValue(std::move(group_key[group_by_element_idx]));
+  }
+}
+++group_by_element_idx;
+  }
+
+  // Stitch together a ColumnVectorsValueAccessor combining the GROUP BY keys
+  // and the finalized aggregates.
+  ColumnVectorsValueAccessor complete_result;
+  for (std::unique_ptr _by_cv : group_by_cvs) {
+complete_result.addColumn(group_by_cv.release());
+  }
+  for (std::unique_ptr _value_cv : final_values) {
+complete_result.addColumn(final_value_cv.release());
+  }
+
+  // 

[24/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/predicate/TrivialPredicates.hpp
--
diff --git a/expressions/predicate/TrivialPredicates.hpp 
b/expressions/predicate/TrivialPredicates.hpp
index 273c0a4..4e44976 100644
--- a/expressions/predicate/TrivialPredicates.hpp
+++ b/expressions/predicate/TrivialPredicates.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_EXPRESSIONS_PREDICATE_TRIVIAL_PREDICATES_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/predicate/tests/Predicate_unittest.cpp
--
diff --git a/expressions/predicate/tests/Predicate_unittest.cpp 
b/expressions/predicate/tests/Predicate_unittest.cpp
index 54c4bb2..3c2889d 100644
--- a/expressions/predicate/tests/Predicate_unittest.cpp
+++ b/expressions/predicate/tests/Predicate_unittest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/scalar/CMakeLists.txt
--
diff --git a/expressions/scalar/CMakeLists.txt 
b/expressions/scalar/CMakeLists.txt
index 3c8ace1..8f509da 100644
--- a/expressions/scalar/CMakeLists.txt
+++ b/expressions/scalar/CMakeLists.txt
@@ -1,17 +1,19 @@
-#   Copyright 2011-2015 Quickstep Technologies LLC.
-#   Copyright 2015 Pivotal Software, Inc.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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 at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you 

[08/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/src/java/CancelMessages.java
--
diff --git a/third_party/tmb/src/java/CancelMessages.java 
b/third_party/tmb/src/java/CancelMessages.java
index 0465f43..86a1d6a 100644
--- a/third_party/tmb/src/java/CancelMessages.java
+++ b/third_party/tmb/src/java/CancelMessages.java
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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 tmb.voltdb;
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/src/java/ConnectClient.java
--
diff --git a/third_party/tmb/src/java/ConnectClient.java 
b/third_party/tmb/src/java/ConnectClient.java
index 5980895..34f443e 100644
--- a/third_party/tmb/src/java/ConnectClient.java
+++ b/third_party/tmb/src/java/ConnectClient.java
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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 tmb.voltdb;
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/src/java/DeleteMessages.java
--
diff --git a/third_party/tmb/src/java/DeleteMessages.java 
b/third_party/tmb/src/java/DeleteMessages.java
index a7507db..9fe0a65 100644
--- a/third_party/tmb/src/java/DeleteMessages.java
+++ b/third_party/tmb/src/java/DeleteMessages.java
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache 

[40/73] [abbrv] incubator-quickstep git commit: Fix IWYU for ExecutionDAGVisualizer

2016-09-06 Thread hbdeshmukh
Fix IWYU for ExecutionDAGVisualizer


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

Branch: refs/heads/partitioned-aggregation
Commit: 8ec99ed8b95a909d68de9c3f8b87d2a3b74372a6
Parents: 203d3ea
Author: Jianqiao Zhu 
Authored: Tue Aug 16 12:37:30 2016 -0500
Committer: Zuyu Zhang 
Committed: Tue Aug 16 11:17:37 2016 -0700

--
 query_execution/ForemanSingleNode.cpp  | 2 --
 query_execution/ForemanSingleNode.hpp  | 2 +-
 query_execution/PolicyEnforcerBase.hpp | 3 +--
 query_execution/QueryExecutionTypedefs.hpp | 1 +
 utility/CMakeLists.txt | 2 ++
 utility/ExecutionDAGVisualizer.cpp | 3 ++-
 6 files changed, 7 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/ForemanSingleNode.cpp
--
diff --git a/query_execution/ForemanSingleNode.cpp 
b/query_execution/ForemanSingleNode.cpp
index 7596b00..4661c37 100644
--- a/query_execution/ForemanSingleNode.cpp
+++ b/query_execution/ForemanSingleNode.cpp
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -245,7 +244,6 @@ void 
ForemanSingleNode::printWorkOrderProfilingResults(const std::size_t query_i
   policy_enforcer_->getProfilingResults(query_id);
   fputs("Query ID,Worker ID,NUMA Socket,Operator ID,Time (microseconds)\n", 
out);
   for (auto workorder_entry : recorded_times) {
-// Note: Index of the "worker thread index" in the tuple is 0.
 const std::size_t worker_id = workorder_entry.worker_id;
 fprintf(out,
 "%lu,%lu,%d,%lu,%lu\n",

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/ForemanSingleNode.hpp
--
diff --git a/query_execution/ForemanSingleNode.hpp 
b/query_execution/ForemanSingleNode.hpp
index 71ce99d..5a368aa 100644
--- a/query_execution/ForemanSingleNode.hpp
+++ b/query_execution/ForemanSingleNode.hpp
@@ -84,7 +84,7 @@ class ForemanSingleNode final : public ForemanBase {
*query.
*
* @param query_id The ID of the query for which the results are to be 
printed.
-   * @return A vector of tuples, each being a single profiling entry.
+   * @return A vector of records, each being a single profiling entry.
**/
   const std::vector& getWorkOrderProfilingResults(
   const std::size_t query_id) const;

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/PolicyEnforcerBase.hpp
--
diff --git a/query_execution/PolicyEnforcerBase.hpp 
b/query_execution/PolicyEnforcerBase.hpp
index e95799e..62906e9 100644
--- a/query_execution/PolicyEnforcerBase.hpp
+++ b/query_execution/PolicyEnforcerBase.hpp
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -126,7 +125,7 @@ class PolicyEnforcerBase {
* @param query_id The ID of the query for which the profiling results are
*requested.
*
-   * @return A vector of tuples, each being a single profiling entry.
+   * @return A vector of records, each being a single profiling entry.
**/
   inline const std::vector& getProfilingResults(
   const std::size_t query_id) const {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/QueryExecutionTypedefs.hpp
--
diff --git a/query_execution/QueryExecutionTypedefs.hpp 
b/query_execution/QueryExecutionTypedefs.hpp
index bba67e3..22c0ae1 100644
--- a/query_execution/QueryExecutionTypedefs.hpp
+++ b/query_execution/QueryExecutionTypedefs.hpp
@@ -20,6 +20,7 @@
 #ifndef QUICKSTEP_QUERY_EXECUTION_QUERY_EXECUTION_TYPEDEFS_HPP_
 #define QUICKSTEP_QUERY_EXECUTION_QUERY_EXECUTION_TYPEDEFS_HPP_
 
+#include 
 #include 
 #include 
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/utility/CMakeLists.txt
--
diff --git a/utility/CMakeLists.txt b/utility/CMakeLists.txt
index ae1179d..ddaae45 100644
--- a/utility/CMakeLists.txt
+++ b/utility/CMakeLists.txt
@@ -238,6 +238,8 @@ 
target_link_libraries(quickstep_utility_ExecutionDAGVisualizer
   quickstep_relationaloperators_BuildHashOperator
   quickstep_relationaloperators_HashJoinOperator
   

[22/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/parser/ParseSimpleTableReference.cpp
--
diff --git a/parser/ParseSimpleTableReference.cpp 
b/parser/ParseSimpleTableReference.cpp
index e56af06..518dc20 100644
--- a/parser/ParseSimpleTableReference.cpp
+++ b/parser/ParseSimpleTableReference.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "parser/ParseSimpleTableReference.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/parser/ParseSimpleTableReference.hpp
--
diff --git a/parser/ParseSimpleTableReference.hpp 
b/parser/ParseSimpleTableReference.hpp
index 5e6815e..4ff92a5 100644
--- a/parser/ParseSimpleTableReference.hpp
+++ b/parser/ParseSimpleTableReference.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_PARSER_PARSE_SIMPLE_TABLE_REFERENCE_HPP_
@@ -41,7 +43,7 @@ class ParseTreeNode;
 class ParseSimpleTableReference : public ParseTableReference {
  public:
   /**
-   * @brief Constructor. 
+   * @brief Constructor.
* @note Takes ownership of \p table_name and \p sample.
*
* @param line_number The line number of the first token of the table 
reference.
@@ -97,4 +99,4 @@ class ParseSimpleTableReference : public ParseTableReference {
 
 }  // namespace quickstep
 
-#endif /* QUICKSTEP_PARSER_PARSE_SIMPLE_TABLE_REFERENCE_HPP_ */
+#endif  // QUICKSTEP_PARSER_PARSE_SIMPLE_TABLE_REFERENCE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/parser/ParseStatement.hpp
--
diff --git a/parser/ParseStatement.hpp b/parser/ParseStatement.hpp
index 61475a9..cb5a1b5 100644
--- a/parser/ParseStatement.hpp
+++ b/parser/ParseStatement.hpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research 

[20/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/PhysicalGenerator.hpp
--
diff --git a/query_optimizer/PhysicalGenerator.hpp 
b/query_optimizer/PhysicalGenerator.hpp
index 484900a..886a173 100644
--- a/query_optimizer/PhysicalGenerator.hpp
+++ b/query_optimizer/PhysicalGenerator.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_GENERATOR_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/QueryHandle.hpp
--
diff --git a/query_optimizer/QueryHandle.hpp b/query_optimizer/QueryHandle.hpp
index 55427cd..1ca6021 100644
--- a/query_optimizer/QueryHandle.hpp
+++ b/query_optimizer/QueryHandle.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015-2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_QUERY_HANDLE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/QueryOptimizerConfig.h.in
--
diff --git a/query_optimizer/QueryOptimizerConfig.h.in 
b/query_optimizer/QueryOptimizerConfig.h.in
index da0fa18..3bdb6ce 100644
--- a/query_optimizer/QueryOptimizerConfig.h.in
+++ b/query_optimizer/QueryOptimizerConfig.h.in
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   

[36/73] [abbrv] incubator-quickstep git commit: Logged all sent messages using glog.

2016-09-06 Thread hbdeshmukh
Logged all sent messages using glog.


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

Branch: refs/heads/partitioned-aggregation
Commit: d9135a8a2d11a1eabf6705c88391c498f4be38bb
Parents: 6168996
Author: Zuyu Zhang 
Authored: Mon Aug 8 22:49:59 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 9 19:48:01 2016 -0700

--
 query_execution/ForemanSingleNode.cpp | 14 ++--
 query_execution/PolicyEnforcerDistributed.cpp | 38 --
 query_execution/QueryExecutionUtil.hpp|  6 +-
 query_execution/Shiftboss.cpp | 86 +-
 query_execution/Worker.cpp|  6 +-
 relational_operators/DeleteOperator.cpp   | 10 +--
 relational_operators/RebuildWorkOrder.hpp |  7 +-
 relational_operators/UpdateOperator.cpp   | 10 +--
 relational_operators/WorkOrder.hpp|  7 +-
 storage/InsertDestination.cpp | 18 +++--
 storage/InsertDestination.hpp | 10 +--
 11 files changed, 92 insertions(+), 120 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d9135a8a/query_execution/ForemanSingleNode.cpp
--
diff --git a/query_execution/ForemanSingleNode.cpp 
b/query_execution/ForemanSingleNode.cpp
index d064a6f..7596b00 100644
--- a/query_execution/ForemanSingleNode.cpp
+++ b/query_execution/ForemanSingleNode.cpp
@@ -168,16 +168,15 @@ void ForemanSingleNode::run() {
   // Signal the main thread that there are no queries to be executed.
   // Currently the message doesn't have any real content.
   TaggedMessage completion_tagged_message(kWorkloadCompletionMessage);
+  DLOG(INFO) << "ForemanSingleNode sent WorkloadCompletionMessage (typed 
'" << kWorkloadCompletionMessage
+ << "') to CLI with TMB client ID " << main_thread_client_id_;
   const tmb::MessageBus::SendStatus send_status =
   QueryExecutionUtil::SendTMBMessage(
   bus_,
   foreman_client_id_,
   main_thread_client_id_,
   move(completion_tagged_message));
-  CHECK(send_status == tmb::MessageBus::SendStatus::kOK)
-  << "Message could not be sent from Foreman with TMB client ID "
-  << foreman_client_id_ << " to main thread with TMB client ID"
-  << main_thread_client_id_;
+  CHECK(send_status == tmb::MessageBus::SendStatus::kOK);
 }
   }
 }
@@ -225,15 +224,14 @@ void ForemanSingleNode::sendWorkerMessage(const size_t 
worker_thread_index,
   }
   TaggedMessage worker_tagged_message(, sizeof(message), type);
 
+  DLOG(INFO) << "ForemanSingleNode sent WorkOrderMessage (typed '" << type
+ << "') to Worker with TMB client ID " << 
worker_directory_->getClientID(worker_thread_index);
   const tmb::MessageBus::SendStatus send_status =
   QueryExecutionUtil::SendTMBMessage(bus_,
  foreman_client_id_,
  
worker_directory_->getClientID(worker_thread_index),
  move(worker_tagged_message));
-  CHECK(send_status == tmb::MessageBus::SendStatus::kOK) <<
-  "Message could not be sent from Foreman with TMB client ID "
-  << foreman_client_id_ << " to Foreman with TMB client ID "
-  << worker_directory_->getClientID(worker_thread_index);
+  CHECK(send_status == tmb::MessageBus::SendStatus::kOK);
 }
 
 const std::vector& ForemanSingleNode

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d9135a8a/query_execution/PolicyEnforcerDistributed.cpp
--
diff --git a/query_execution/PolicyEnforcerDistributed.cpp 
b/query_execution/PolicyEnforcerDistributed.cpp
index 6d0de47..c76a9e1 100644
--- a/query_execution/PolicyEnforcerDistributed.cpp
+++ b/query_execution/PolicyEnforcerDistributed.cpp
@@ -170,25 +170,22 @@ void 
PolicyEnforcerDistributed::initiateQueryInShiftboss(QueryHandle *query_hand
 kQueryInitiateMessage);
   free(proto_bytes);
 
-  LOG(INFO) << "PolicyEnforcerDistributed sent QueryInitiateMessage (typed '" 
<< kQueryInitiateMessage
-<< "') to Shiftboss 0";
-
   // TODO(zuyu): Multiple Shiftbosses support.
+  DLOG(INFO) << "PolicyEnforcerDistributed sent QueryInitiateMessage (typed '" 
<< kQueryInitiateMessage
+ << "') to Shiftboss with TMB client ID " << 
shiftboss_directory_->getClientId(0);
   const tmb::MessageBus::SendStatus send_status =
   

[32/73] [abbrv] incubator-quickstep git commit: Added guards for gnu_source definition in CMake.

2016-09-06 Thread hbdeshmukh
Added guards for gnu_source definition in CMake.


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

Branch: refs/heads/partitioned-aggregation
Commit: 658cb61760ab6bc98ead1faf231b7b7f27a0fa1e
Parents: 3c2749e
Author: Harshad Deshmukh 
Authored: Mon Aug 8 12:19:00 2016 -0500
Committer: Zuyu Zhang 
Committed: Mon Aug 8 10:42:51 2016 -0700

--
 storage/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/658cb617/storage/CMakeLists.txt
--
diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt
index c4b8f70..65a7975 100644
--- a/storage/CMakeLists.txt
+++ b/storage/CMakeLists.txt
@@ -50,7 +50,9 @@ endif()
 # See if mmap can be used to allocate Linux hugetlb pages.
 include(CheckCXXSourceCompiles)
 CHECK_CXX_SOURCE_COMPILES("
+  #ifndef _GNU_SOURCE
   #define _GNU_SOURCE
+  #endif
   #include 
 
   int main() {



[72/73] [abbrv] incubator-quickstep git commit: Added new workorder to WorkOrderFactory classes.

2016-09-06 Thread hbdeshmukh
Added new workorder to WorkOrderFactory classes.


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

Branch: refs/heads/partitioned-aggregation
Commit: ef665e4095f567d704d79bb855e00d36db241269
Parents: 2e8e1c3
Author: Harshad Deshmukh 
Authored: Sun Aug 21 11:02:49 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 15:01:34 2016 -0500

--
 relational_operators/CMakeLists.txt   |  1 +
 relational_operators/WorkOrderFactory.cpp | 14 ++
 2 files changed, 15 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/ef665e40/relational_operators/CMakeLists.txt
--
diff --git a/relational_operators/CMakeLists.txt 
b/relational_operators/CMakeLists.txt
index 369deba..5064999 100644
--- a/relational_operators/CMakeLists.txt
+++ b/relational_operators/CMakeLists.txt
@@ -462,6 +462,7 @@ 
target_link_libraries(quickstep_relationaloperators_WorkOrderFactory
   quickstep_relationaloperators_AggregationOperator
   quickstep_relationaloperators_BuildHashOperator
   quickstep_relationaloperators_DeleteOperator
+  
quickstep_relationaloperators_DestroyAggregationStateOperator
   quickstep_relationaloperators_DestroyHashOperator
   quickstep_relationaloperators_DropTableOperator
   quickstep_relationaloperators_FinalizeAggregationOperator

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/ef665e40/relational_operators/WorkOrderFactory.cpp
--
diff --git a/relational_operators/WorkOrderFactory.cpp 
b/relational_operators/WorkOrderFactory.cpp
index 6970486..6b9ab42 100644
--- a/relational_operators/WorkOrderFactory.cpp
+++ b/relational_operators/WorkOrderFactory.cpp
@@ -30,6 +30,7 @@
 #include "relational_operators/AggregationOperator.hpp"
 #include "relational_operators/BuildHashOperator.hpp"
 #include "relational_operators/DeleteOperator.hpp"
+#include "relational_operators/DestroyAggregationStateOperator.hpp"
 #include "relational_operators/DestroyHashOperator.hpp"
 #include "relational_operators/DropTableOperator.hpp"
 #include "relational_operators/FinalizeAggregationOperator.hpp"
@@ -116,6 +117,14 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const 
serialization::WorkOrder
   shiftboss_client_id,
   bus);
 }
+case serialization::DESTROY_AGGREGATION_STATE: {
+  LOG(INFO) << "Creating DestroyAggregationStateWorkOrder";
+  return new DestroyAggregationStateWorkOrder(
+  proto.query_id(),
+  proto.GetExtension(
+  
serialization::DestroyAggregationStateWorkOrder::aggr_state_index),
+  query_context);
+}
 case serialization::DESTROY_HASH: {
   LOG(INFO) << "Creating DestroyHashWorkOrder";
   return new DestroyHashWorkOrder(
@@ -489,6 +498,11 @@ bool WorkOrderFactory::ProtoIsValid(const 
serialization::WorkOrder ,
  proto.HasExtension(serialization::DeleteWorkOrder::block_id) &&
  
proto.HasExtension(serialization::DeleteWorkOrder::operator_index);
 }
+case serialization::DESTROY_AGGREGATION_STATE: {
+  return 
proto.HasExtension(serialization::DestroyAggregationStateWorkOrder::aggr_state_index)
 &&
+ query_context.isValidAggregationStateId(
+ 
proto.GetExtension(serialization::DestroyAggregationStateWorkOrder::aggr_state_index));
+}
 case serialization::DESTROY_HASH: {
   return 
proto.HasExtension(serialization::DestroyHashWorkOrder::join_hash_table_index) 
&&
  query_context.isValidJoinHashTableId(



[15/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
--
diff --git a/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp 
b/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
index d1d9380..b8cd02a 100644
--- a/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
+++ b/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_TESTS_EXECUTION_GENERATOR_TEST_RUNNER_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
--
diff --git a/query_optimizer/tests/ExecutionHeuristics_unittest.cpp 
b/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
index 815c13e..73b3e84 100644
--- a/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
+++ b/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/tests/OptimizerTest.cpp
--
diff --git a/query_optimizer/tests/OptimizerTest.cpp 
b/query_optimizer/tests/OptimizerTest.cpp
index 57e2d67..a93db3e 100644
--- a/query_optimizer/tests/OptimizerTest.cpp
+++ b/query_optimizer/tests/OptimizerTest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file 

[73/73] [abbrv] incubator-quickstep git commit: Changes due to rebasing.

2016-09-06 Thread hbdeshmukh
Changes due to rebasing.


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

Branch: refs/heads/partitioned-aggregation
Commit: 63f66a24278bdf10b21a2bb94252a28c8a7c9a3b
Parents: b4ccb36
Author: Harshad Deshmukh 
Authored: Tue Sep 6 15:14:16 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 15:14:16 2016 -0500

--
 relational_operators/DestroyAggregationStateOperator.hpp | 6 ++
 storage/AggregationOperationState.hpp| 3 +++
 2 files changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63f66a24/relational_operators/DestroyAggregationStateOperator.hpp
--
diff --git a/relational_operators/DestroyAggregationStateOperator.hpp 
b/relational_operators/DestroyAggregationStateOperator.hpp
index b9a74ec..e4248c4 100644
--- a/relational_operators/DestroyAggregationStateOperator.hpp
+++ b/relational_operators/DestroyAggregationStateOperator.hpp
@@ -20,6 +20,8 @@
 #ifndef QUICKSTEP_RELATIONAL_OPERATORS_DESTROY_AGGREGATION_STATE_OPERATOR_HPP_
 #define QUICKSTEP_RELATIONAL_OPERATORS_DESTROY_AGGREGATION_STATE_OPERATOR_HPP_
 
+#include 
+
 #include "query_execution/QueryContext.hpp"
 #include "relational_operators/RelationalOperator.hpp"
 #include "relational_operators/WorkOrder.hpp"
@@ -60,6 +62,10 @@ class DestroyAggregationStateOperator : public 
RelationalOperator {
 
   ~DestroyAggregationStateOperator() override {}
 
+  std::string getName() const override {
+return "DestroyAggregationStateOperator";
+  }
+
   bool getAllWorkOrders(WorkOrdersContainer *container,
 QueryContext *query_context,
 StorageManager *storage_manager,

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63f66a24/storage/AggregationOperationState.hpp
--
diff --git a/storage/AggregationOperationState.hpp 
b/storage/AggregationOperationState.hpp
index 7a11e92..a3fe635 100644
--- a/storage/AggregationOperationState.hpp
+++ b/storage/AggregationOperationState.hpp
@@ -268,6 +268,9 @@ class AggregationOperationState {
 
   StorageManager *storage_manager_;
 
+  void mergeGroupByHashTables(AggregationStateHashTableBase *src,
+  AggregationStateHashTableBase *dst);
+
   DISALLOW_COPY_AND_ASSIGN(AggregationOperationState);
 };
 



[28/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
QUICKSTEP-40: Fix Copyright notice to confirm to Apache.


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

Branch: refs/heads/partitioned-aggregation
Commit: 918167a444e0ec0b479713afe1bd20b404685b21
Parents: 410d2b6
Author: Jignesh Patel 
Authored: Sun Aug 7 01:11:14 2016 -0500
Committer: Zuyu Zhang 
Committed: Sat Aug 6 23:29:11 2016 -0700

--
 CMakeLists.txt  | 38 ++--
 CREDITS.md  |  2 +-
 GENERATOR_FUNCTIONS.md  |  6 ++--
 NOTICE  |  2 +-
 README.md   | 18 +-
 WORKING_WITH_AN_IDE.md  | 18 +-
 build/profile_build.sh  | 23 +++-
 build/vagrant/debian-jessie-amd64/Vagrantfile   | 19 --
 build/vagrant/freebsd-10.2-amd64/Vagrantfile| 19 --
 build/vagrant/ubuntu-precise-amd64/Vagrantfile  | 19 --
 catalog/CMakeLists.txt  | 28 +++
 catalog/Catalog.cpp | 26 +++---
 catalog/Catalog.hpp | 26 +++---
 catalog/Catalog.proto   | 30 
 catalog/CatalogAttribute.cpp| 26 +++---
 catalog/CatalogAttribute.hpp| 26 +++---
 catalog/CatalogConfig.h.in  | 26 +++---
 catalog/CatalogDatabase.cpp | 26 +++---
 catalog/CatalogDatabase.hpp | 26 +++---
 catalog/CatalogDatabaseCache.cpp| 25 +++--
 catalog/CatalogDatabaseCache.hpp| 25 +++--
 catalog/CatalogDatabaseLite.hpp | 25 +++--
 catalog/CatalogErrors.hpp   | 26 +++---
 catalog/CatalogModule.hpp   | 26 +++---
 catalog/CatalogRelation.cpp | 28 +++
 catalog/CatalogRelation.hpp | 28 +++
 catalog/CatalogRelationSchema.cpp   | 28 +++
 catalog/CatalogRelationSchema.hpp   | 28 +++
 catalog/CatalogRelationStatistics.cpp   | 26 +++---
 catalog/CatalogRelationStatistics.hpp   | 26 +++---
 catalog/CatalogTypedefs.hpp | 28 +++
 catalog/IndexScheme.cpp | 26 +++---
 catalog/IndexScheme.hpp | 26 +++---
 catalog/NUMAPlacementScheme.cpp | 26 +++---
 catalog/NUMAPlacementScheme.hpp | 26 +++---
 catalog/PartitionScheme.cpp | 26 +++---
 catalog/PartitionScheme.hpp | 26 +++---
 catalog/PartitionSchemeHeader.cpp   | 26 +++---
 catalog/PartitionSchemeHeader.hpp   | 26 +++---
 catalog/tests/Catalog_unittest.cpp  | 28 +++
 catalog/tests/NUMAPlacementScheme_unittest.cpp  | 26 +++---
 catalog/tests/PartitionScheme_unittest.cpp  | 26 +++---
 cli/CMakeLists.txt  | 28 +++
 cli/CliConfig.h.in  | 26 +++---
 cli/CliModule.hpp   | 26 +++---
 cli/CommandExecutor.cpp | 26 +++---
 cli/CommandExecutor.hpp | 26 +++---
 cli/DefaultsConfigurator.hpp| 26 +++---
 cli/DropRelation.cpp| 25 +++--
 cli/DropRelation.hpp| 25 +++--
 cli/InputParserUtil.cpp | 25 +++--
 cli/InputParserUtil.hpp | 25 +++--
 cli/LineReader.cpp  | 26 +++---
 cli/LineReader.hpp  | 26 +++---
 cli/LineReaderDumb.cpp  | 26 +++---
 cli/LineReaderDumb.hpp  | 26 +++---
 cli/LineReaderLineNoise.cpp | 26 +++---
 cli/LineReaderLineNoise.hpp | 26 +++---
 cli/PrintToScreen.cpp   | 26 +++---
 cli/PrintToScreen.hpp   | 26 +++---
 cli/QuickstepCli.cpp| 28 +++
 cli/tests/CMakeLists.txt| 28 ---
 cli/tests/CommandExecutorTest.cpp 

[67/73] [abbrv] incubator-quickstep git commit: Minor change in DCHECK.

2016-09-06 Thread hbdeshmukh
Minor change in DCHECK.


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

Branch: refs/heads/partitioned-aggregation
Commit: 650c0b342ca2c8b06794d222d209fd39e2a7a926
Parents: 07afae2
Author: Harshad Deshmukh 
Authored: Thu Aug 18 22:14:09 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 15:01:33 2016 -0500

--
 storage/StorageBlock.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/650c0b34/storage/StorageBlock.cpp
--
diff --git a/storage/StorageBlock.cpp b/storage/StorageBlock.cpp
index 06daff6..62f91e1 100644
--- a/storage/StorageBlock.cpp
+++ b/storage/StorageBlock.cpp
@@ -1458,7 +1458,7 @@ void StorageBlock::aggregateGroupByPartitioned(
 std::unique_ptr *reuse_matches,
 std::vector *reuse_group_by_vectors,
 PartitionedHashTablePool *hashtable_pool) const {
-  DCHECK_EQ(group_by.size(), 0u)
+  DCHECK(!group_by.empty())
   << "Called aggregateGroupByPartitioned() with zero GROUP BY expressions";
 
   SubBlocksReference sub_blocks_ref(*tuple_store_,



[65/73] [abbrv] incubator-quickstep git commit: Added function to aggregate group by with partition

2016-09-06 Thread hbdeshmukh
Added function to aggregate group by with partition

- Added a function to compute a composite hash function for multiple
  attributes.
- Changes to Tuple class to support partitioning.
- A function in StorageBlock to compute aggregate with group by that
  supports partitioning.


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

Branch: refs/heads/partitioned-aggregation
Commit: b22323e7be97055f4e98c061731005420aca4ea6
Parents: 6fa0e29
Author: Harshad Deshmukh 
Authored: Thu Aug 18 12:30:18 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 14:56:12 2016 -0500

--
 storage/AggregationOperationState.cpp |  69 --
 storage/AggregationOperationState.hpp |   7 ++
 storage/PartitionedHashTablePool.hpp  |   4 +
 storage/StorageBlock.cpp  | 113 +
 storage/StorageBlock.hpp  |  10 +++
 types/containers/CMakeLists.txt   |   1 +
 types/containers/Tuple.hpp|   8 ++
 utility/CMakeLists.txt|   6 ++
 utility/CompositeHash.hpp |  52 +
 9 files changed, 246 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b22323e7/storage/AggregationOperationState.cpp
--
diff --git a/storage/AggregationOperationState.cpp 
b/storage/AggregationOperationState.cpp
index c5f59f9..c39e98a 100644
--- a/storage/AggregationOperationState.cpp
+++ b/storage/AggregationOperationState.cpp
@@ -68,7 +68,8 @@ AggregationOperationState::AggregationOperationState(
 const HashTableImplType hash_table_impl_type,
 const std::vector _hash_table_impl_types,
 StorageManager *storage_manager)
-: input_relation_(input_relation),
+: is_aggregate_partitioned_(estimated_num_entries > 
kPartitionedAggregateThreshold),
+  input_relation_(input_relation),
   predicate_(predicate),
   group_by_list_(std::move(group_by)),
   arguments_(std::move(arguments)),
@@ -194,15 +195,26 @@ AggregationOperationState::AggregationOperationState(
 }
 
 if (!group_by_handles.empty()) {
-  // Aggregation with GROUP BY: create a HashTable pool for per-group
-  // states.
-  group_by_hashtable_pools_.emplace_back(std::unique_ptr(
-  new HashTablePool(estimated_num_entries,
-hash_table_impl_type,
-group_by_types,
-payload_sizes,
-group_by_handles,
-storage_manager)));
+  // Aggregation with GROUP BY: create a HashTable pool for per-group 
states.
+  if (!is_aggregate_partitioned_) {
+group_by_hashtable_pools_.emplace_back(std::unique_ptr(
+  new HashTablePool(estimated_num_entries,
+hash_table_impl_type,
+group_by_types,
+payload_sizes,
+group_by_handles,
+storage_manager)));
+}
+  else {
+partitioned_group_by_hashtable_pool_.reset(
+new PartitionedHashTablePool(estimated_num_entries,
+ kNumPartitionsForAggregate,
+ hash_table_impl_type,
+ group_by_types,
+ payload_sizes,
+ group_by_handles,
+ storage_manager));
+  }
 }
   }
 }
@@ -441,20 +453,29 @@ void AggregationOperationState::aggregateBlockHashTable(
 }
   }
 
-  // Call StorageBlock::aggregateGroupBy() to aggregate this block's values
-  // directly into the (threadsafe) shared global HashTable for this
-  // aggregate.
-  DCHECK(group_by_hashtable_pools_[0] != nullptr);
-  AggregationStateHashTableBase *agg_hash_table =
-  group_by_hashtable_pools_[0]->getHashTableFast();
-  DCHECK(agg_hash_table != nullptr);
-  block->aggregateGroupByFast(arguments_,
-  group_by_list_,
-  predicate_.get(),
-  agg_hash_table,
-  _matches,
-  _group_by_vectors);
-  group_by_hashtable_pools_[0]->returnHashTable(agg_hash_table);
+  if (!is_aggregate_partitioned_) {
+// Call StorageBlock::aggregateGroupBy() to aggregate this block's values
+// directly 

[39/73] [abbrv] incubator-quickstep git commit: Added ForemanDistributed.

2016-09-06 Thread hbdeshmukh
Added ForemanDistributed.


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

Branch: refs/heads/partitioned-aggregation
Commit: 203d3ea66e4c1f72f7edc858b5b243ae9db33eba
Parents: 1325a6a
Author: Zuyu Zhang 
Authored: Sat Aug 13 23:37:59 2016 -0700
Committer: Zuyu Zhang 
Committed: Mon Aug 15 13:48:32 2016 -0700

--
 query_execution/CMakeLists.txt |  24 ++
 query_execution/ForemanDistributed.cpp | 335 
 query_execution/ForemanDistributed.hpp | 130 +++
 3 files changed, 489 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/203d3ea6/query_execution/CMakeLists.txt
--
diff --git a/query_execution/CMakeLists.txt b/query_execution/CMakeLists.txt
index 4033594..1b27194 100644
--- a/query_execution/CMakeLists.txt
+++ b/query_execution/CMakeLists.txt
@@ -33,6 +33,9 @@ if (ENABLE_DISTRIBUTED)
   add_library(quickstep_queryexecution_BlockLocator BlockLocator.cpp 
BlockLocator.hpp)
 endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_ForemanBase ../empty_src.cpp 
ForemanBase.hpp)
+if (ENABLE_DISTRIBUTED)
+  add_library(quickstep_queryexecution_ForemanDistributed 
ForemanDistributed.cpp ForemanDistributed.hpp)
+endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_ForemanSingleNode ForemanSingleNode.cpp 
ForemanSingleNode.hpp)
 add_library(quickstep_queryexecution_PolicyEnforcerBase PolicyEnforcerBase.cpp 
PolicyEnforcerBase.hpp)
 if (ENABLE_DISTRIBUTED)
@@ -86,6 +89,26 @@ target_link_libraries(quickstep_queryexecution_ForemanBase
   quickstep_threading_Thread
   quickstep_utility_Macros
   tmb)
+if (ENABLE_DISTRIBUTED)
+  target_link_libraries(quickstep_queryexecution_ForemanDistributed
+glog
+quickstep_catalog_CatalogDatabase
+quickstep_catalog_CatalogRelation
+quickstep_catalog_CatalogTypedefs
+quickstep_catalog_Catalog_proto
+quickstep_queryexecution_AdmitRequestMessage
+quickstep_queryexecution_ForemanBase
+quickstep_queryexecution_PolicyEnforcerDistributed
+quickstep_queryexecution_QueryExecutionMessages_proto
+quickstep_queryexecution_QueryExecutionTypedefs
+quickstep_queryexecution_QueryExecutionUtil
+quickstep_queryexecution_ShiftbossDirectory
+quickstep_threading_ThreadUtil
+quickstep_utility_EqualsAnyConstant
+quickstep_utility_Macros
+tmb
+${GFLAGS_LIB_NAME})
+endif(ENABLE_DISTRIBUTED)
 target_link_libraries(quickstep_queryexecution_ForemanSingleNode
   glog
   quickstep_queryexecution_AdmitRequestMessage
@@ -316,6 +339,7 @@ target_link_libraries(quickstep_queryexecution
 if (ENABLE_DISTRIBUTED)
   target_link_libraries(quickstep_queryexecution
 quickstep_queryexecution_BlockLocator
+quickstep_queryexecution_ForemanDistributed
 quickstep_queryexecution_PolicyEnforcerDistributed
 quickstep_queryexecution_QueryManagerDistributed
 quickstep_queryexecution_Shiftboss

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/203d3ea6/query_execution/ForemanDistributed.cpp
--
diff --git a/query_execution/ForemanDistributed.cpp 
b/query_execution/ForemanDistributed.cpp
new file mode 100644
index 000..29f5b9b
--- /dev/null
+++ b/query_execution/ForemanDistributed.cpp
@@ -0,0 +1,335 @@
+/**
+ * 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 at
+ *
+ *   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.
+ **/
+
+#include "query_execution/ForemanDistributed.hpp"
+
+#include 
+#include 

[49/73] [abbrv] incubator-quickstep git commit: Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, some more optimizations are pending.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/storage/StorageBlock.hpp
--
diff --git a/storage/StorageBlock.hpp b/storage/StorageBlock.hpp
index 97b4773..8b59a3c 100644
--- a/storage/StorageBlock.hpp
+++ b/storage/StorageBlock.hpp
@@ -468,6 +468,14 @@ class StorageBlock : public StorageBlockBase {
 std::vector
 *reuse_group_by_vectors) const;
 
+
+  void aggregateGroupByFast(const 
std::vector> ,
+const std::vector 
_by,
+const Predicate *predicate,
+AggregationStateHashTableBase *hash_table,
+std::unique_ptr *reuse_matches,
+std::vector
+*reuse_group_by_vectors) const;
   /**
* @brief Inserts the GROUP BY expressions and aggregation arguments together
*as keys into the distinctify hash table.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/threading/SpinMutex.hpp
--
diff --git a/threading/SpinMutex.hpp b/threading/SpinMutex.hpp
index 5ed1405..106ef13 100644
--- a/threading/SpinMutex.hpp
+++ b/threading/SpinMutex.hpp
@@ -44,6 +44,8 @@ class SpinMutex {
   SpinMutex() : locked_(false) {
   }
 
+  explicit SpinMutex(uint8_t *ptr): locked_(*ptr) {}
+
   /**
* @note This call does NOT yield when contended. SpinMutex is intended
*   mainly for cases where locks are held briefly and it is better to



[70/73] [abbrv] incubator-quickstep git commit: New operator to destroy aggregation state.

2016-09-06 Thread hbdeshmukh
New operator to destroy aggregation state.


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

Branch: refs/heads/partitioned-aggregation
Commit: 2e8e1c3d266cfb985290e3596e00c499e5a4a7be
Parents: 6ecda1f
Author: Harshad Deshmukh 
Authored: Sun Aug 21 09:32:51 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 15:01:34 2016 -0500

--
 query_execution/QueryContext.hpp|  13 ++-
 relational_operators/CMakeLists.txt |  12 ++
 .../DestroyAggregationStateOperator.cpp |  64 +++
 .../DestroyAggregationStateOperator.hpp | 112 +++
 relational_operators/WorkOrder.proto|   7 ++
 5 files changed, 207 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2e8e1c3d/query_execution/QueryContext.hpp
--
diff --git a/query_execution/QueryContext.hpp b/query_execution/QueryContext.hpp
index c54c7ff..6a928e8 100644
--- a/query_execution/QueryContext.hpp
+++ b/query_execution/QueryContext.hpp
@@ -184,7 +184,7 @@ class QueryContext {
   /**
* @brief Release the given AggregationOperationState.
*
-   * @param id The id of the AggregationOperationState to destroy.
+   * @param id The id of the AggregationOperationState to release.
*
* @return The AggregationOperationState, alreadly created in the 
constructor.
**/
@@ -195,6 +195,17 @@ class QueryContext {
   }
 
   /**
+   * @brief Destroy the given aggregation state.
+   *
+   * @param id The ID of the AggregationOperationState to destroy.
+   **/
+  inline void destroyAggregationState(const aggregation_state_id id) {
+DCHECK_LT(id, aggregation_states_.size());
+DCHECK(aggregation_states_[id]);
+aggregation_states_[id].reset(nullptr);
+  }
+
+  /**
* @brief Whether the given BloomFilter id is valid.
*
* @param id The BloomFilter id.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2e8e1c3d/relational_operators/CMakeLists.txt
--
diff --git a/relational_operators/CMakeLists.txt 
b/relational_operators/CMakeLists.txt
index 43a42f9..369deba 100644
--- a/relational_operators/CMakeLists.txt
+++ b/relational_operators/CMakeLists.txt
@@ -34,6 +34,7 @@ add_library(quickstep_relationaloperators_BuildHashOperator 
BuildHashOperator.cp
 add_library(quickstep_relationaloperators_CreateIndexOperator 
CreateIndexOperator.cpp CreateIndexOperator.hpp)
 add_library(quickstep_relationaloperators_CreateTableOperator 
CreateTableOperator.cpp CreateTableOperator.hpp)
 add_library(quickstep_relationaloperators_DeleteOperator DeleteOperator.cpp 
DeleteOperator.hpp)
+add_library(quickstep_relationaloperators_DestroyAggregationStateOperator 
DestroyAggregationStateOperator.cpp DestroyAggregationStateOperator.hpp)
 add_library(quickstep_relationaloperators_DestroyHashOperator 
DestroyHashOperator.cpp DestroyHashOperator.hpp)
 add_library(quickstep_relationaloperators_DropTableOperator 
DropTableOperator.cpp DropTableOperator.hpp)
 add_library(quickstep_relationaloperators_FinalizeAggregationOperator
@@ -146,6 +147,16 @@ 
target_link_libraries(quickstep_relationaloperators_DestroyHashOperator
   quickstep_relationaloperators_WorkOrder_proto
   quickstep_utility_Macros
   tmb)
+target_link_libraries(quickstep_relationaloperators_DestroyAggregationStateOperator
+  glog
+  quickstep_queryexecution_QueryContext
+  quickstep_queryexecution_WorkOrderProtosContainer
+  quickstep_queryexecution_WorkOrdersContainer
+  quickstep_relationaloperators_RelationalOperator
+  quickstep_relationaloperators_WorkOrder
+  quickstep_relationaloperators_WorkOrder_proto
+  quickstep_utility_Macros
+  tmb)
 target_link_libraries(quickstep_relationaloperators_DropTableOperator
   glog
   quickstep_catalog_CatalogDatabase
@@ -484,6 +495,7 @@ target_link_libraries(quickstep_relationaloperators
   quickstep_relationaloperators_CreateIndexOperator
   quickstep_relationaloperators_CreateTableOperator
   quickstep_relationaloperators_DeleteOperator
+  
quickstep_relationaloperators_DestroyAggregationStateOperator
  

[30/73] [abbrv] incubator-quickstep git commit: Minor updates to Shiftboss.

2016-09-06 Thread hbdeshmukh
Minor updates to Shiftboss.


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

Branch: refs/heads/partitioned-aggregation
Commit: e443b2b8409a128cc5ba2bdf1a6d01ebf79e7e74
Parents: bd01748
Author: Zuyu Zhang 
Authored: Mon Aug 8 10:33:10 2016 -0700
Committer: Zuyu Zhang 
Committed: Mon Aug 8 10:33:10 2016 -0700

--
 query_execution/QueryExecutionMessages.proto |  1 +
 query_execution/Shiftboss.cpp| 89 ---
 query_execution/Shiftboss.hpp|  3 +
 3 files changed, 65 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e443b2b8/query_execution/QueryExecutionMessages.proto
--
diff --git a/query_execution/QueryExecutionMessages.proto 
b/query_execution/QueryExecutionMessages.proto
index f6a8b73..f680d35 100644
--- a/query_execution/QueryExecutionMessages.proto
+++ b/query_execution/QueryExecutionMessages.proto
@@ -87,6 +87,7 @@ message ShiftbossRegistrationMessage {
 }
 
 message ShiftbossRegistrationResponseMessage {
+  required uint64 shiftboss_index = 1;
 }
 
 message QueryInitiateMessage {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e443b2b8/query_execution/Shiftboss.cpp
--
diff --git a/query_execution/Shiftboss.cpp b/query_execution/Shiftboss.cpp
index 120e8fb..24c91fe 100644
--- a/query_execution/Shiftboss.cpp
+++ b/query_execution/Shiftboss.cpp
@@ -56,6 +56,7 @@ using std::string;
 using std::unique_ptr;
 using std::vector;
 
+using tmb::MessageBus;
 using tmb::TaggedMessage;
 
 namespace quickstep {
@@ -78,6 +79,13 @@ void Shiftboss::run() {
 switch (annotated_message.tagged_message.message_type()) {
   case kShiftbossRegistrationResponseMessage: {
 foreman_client_id_ = annotated_message.sender;
+
+const TaggedMessage _message = annotated_message.tagged_message;
+
+serialization::ShiftbossRegistrationResponseMessage proto;
+CHECK(proto.ParseFromArray(tagged_message.message(), 
tagged_message.message_bytes()));
+
+shiftboss_index_ = proto.shiftboss_index();
 break;
   }
   case kQueryInitiateMessage: {
@@ -117,10 +125,14 @@ void Shiftboss::run() {
   << "') forwarded WorkOrderMessage (typed '" << 
kWorkOrderMessage
   << "') from Foreman to worker " << worker_index;
 
-QueryExecutionUtil::SendTMBMessage(bus_,
-   shiftboss_client_id_,
-   workers_->getClientID(worker_index),
-   move(worker_tagged_message));
+const MessageBus::SendStatus send_status =
+QueryExecutionUtil::SendTMBMessage(bus_,
+   shiftboss_client_id_,
+   
workers_->getClientID(worker_index),
+   move(worker_tagged_message));
+CHECK(send_status == MessageBus::SendStatus::kOK)
+<< "Message could not be sent from Shiftboss with TMB client ID " 
<< shiftboss_client_id_
+<< " to Worker with TMB client ID " << 
workers_->getClientID(worker_index);
 break;
   }
   case kInitiateRebuildMessage: {
@@ -147,10 +159,14 @@ void Shiftboss::run() {
   << "' message from worker (client " << 
annotated_message.sender << ") to Foreman";
 
 DCHECK_NE(foreman_client_id_, tmb::kClientIdNone);
-QueryExecutionUtil::SendTMBMessage(bus_,
-   shiftboss_client_id_,
-   foreman_client_id_,
-   
move(annotated_message.tagged_message));
+const MessageBus::SendStatus send_status =
+QueryExecutionUtil::SendTMBMessage(bus_,
+   shiftboss_client_id_,
+   foreman_client_id_,
+   
move(annotated_message.tagged_message));
+CHECK(send_status == MessageBus::SendStatus::kOK)
+<< "Message could not be sent from Shiftboss with TMB client ID " 
<< shiftboss_client_id_
+<< " to Foreman with TMB client ID " << foreman_client_id_;
 break;
   }
   case kSaveQueryResultMessage: {
@@ -178,10 +194,14 @@ void Shiftboss::run() {
 

[46/73] [abbrv] incubator-quickstep git commit: Fixed cyclic dependencies. Removed Aggregation unit test. Other minor changes.

2016-09-06 Thread hbdeshmukh
Fixed cyclic dependencies. Removed Aggregation unit test. Other minor changes.


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

Branch: refs/heads/partitioned-aggregation
Commit: 2518a7298060f5207c3e4d292a7244ecc089c36a
Parents: 48dc0e8
Author: rathijit 
Authored: Sun Aug 14 02:59:40 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 expressions/aggregation/CMakeLists.txt|  2 +-
 storage/CMakeLists.txt|  2 --
 storage/FastHashTable.hpp |  4 +---
 storage/FastSeparateChainingHashTable.hpp |  3 ---
 storage/HashTable.hpp | 10 --
 storage/HashTableBase.hpp | 18 +-
 storage/StorageBlock.cpp  | 10 --
 7 files changed, 23 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2518a729/expressions/aggregation/CMakeLists.txt
--
diff --git a/expressions/aggregation/CMakeLists.txt 
b/expressions/aggregation/CMakeLists.txt
index 98222df..9de6833 100644
--- a/expressions/aggregation/CMakeLists.txt
+++ b/expressions/aggregation/CMakeLists.txt
@@ -321,4 +321,4 @@ target_link_libraries(AggregationHandle_tests
   quickstep_types_operations_comparisons_Comparison
   quickstep_types_operations_comparisons_ComparisonFactory
   quickstep_types_operations_comparisons_ComparisonID)
-add_test(AggregationHandle_tests AggregationHandle_tests)
+#add_test(AggregationHandle_tests AggregationHandle_tests)

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2518a729/storage/CMakeLists.txt
--
diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt
index 79a5b87..f05cc46 100644
--- a/storage/CMakeLists.txt
+++ b/storage/CMakeLists.txt
@@ -631,7 +631,6 @@ target_link_libraries(quickstep_storage_EvictionPolicy
   quickstep_utility_Macros)
 target_link_libraries(quickstep_storage_FastHashTable
   quickstep_catalog_CatalogTypedefs
-  quickstep_storage_HashTable
   quickstep_storage_HashTableBase
   quickstep_storage_StorageBlob
   quickstep_storage_StorageBlockInfo
@@ -968,7 +967,6 @@ target_link_libraries(quickstep_storage_StorageBlock
   
quickstep_storage_CompressedColumnStoreTupleStorageSubBlock
   
quickstep_storage_CompressedPackedRowStoreTupleStorageSubBlock
   quickstep_storage_CountedReference
-  quickstep_storage_FastHashTable
   quickstep_storage_HashTableBase
   quickstep_storage_IndexSubBlock
   quickstep_storage_InsertDestinationInterface

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2518a729/storage/FastHashTable.hpp
--
diff --git a/storage/FastHashTable.hpp b/storage/FastHashTable.hpp
index cba039a..e7887ab 100644
--- a/storage/FastHashTable.hpp
+++ b/storage/FastHashTable.hpp
@@ -42,7 +42,6 @@
 #include "utility/BloomFilter.hpp"
 #include "utility/HashPair.hpp"
 #include "utility/Macros.hpp"
-#include "storage/HashTable.hpp"
 
 namespace quickstep {
 
@@ -561,7 +560,7 @@ class FastHashTable : public HashTableBase ,
   ValueAccessor *accessor,
   const std::vector _attr_ids,
-  const bool check_for_null_keys);
+  const bool check_for_null_keys) override;
 
   /**
* @brief Determine the number of entries (key-value pairs) contained in this
@@ -1322,7 +1321,6 @@ class FastHashTable : public HashTableBase

[27/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/README.md
--
diff --git a/README.md b/README.md
index bf9ed8d..af17264 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 ## What is Quickstep?
 Apache Quickstep is high-performance database engine designed to exploit the 
full potential of hardware that is packed in modern computing boxes (servers 
and laptops). The initial version (available now!) targets single-node 
in-memory environments. If your data spills overs the memory limit Quickstep 
will still work, so you don't have to obsessively worry about the in-memory 
part. Also, if your working set fits in memory then Quickstep will 
transparently and automatically figure that out, and cache that hot set to  
deliver in-memory performance.
 
-Distributed execution is the next big feature for Quickstep.  
+Distributed execution is the next big feature for Quickstep.
 
 Quickstep began life in 2011 as a
 [research project at the University of 
Wisconsin](https://www.cs.wisc.edu/~jignesh)
@@ -39,13 +39,13 @@ And, it is **open source!**
 3. Initialize the dependencies: ```git submodule init```
 4. Checkout the dependencies: ```git submodule update```
 5. Go into the build directory: ```cd build```
-6. Create the Makefile: ```cmake -D CMAKE_BUILD_TYPE=Release ..```  
-7. Build: ```make -j4```. Note you may replace the 4 with the number of cores 
+6. Create the Makefile: ```cmake -D CMAKE_BUILD_TYPE=Release ..```
+7. Build: ```make -j4```. Note you may replace the 4 with the number of cores
on your machine.
-8. Start quickstep: ```./quickstep_cli_shell --initialize_db=true```. You can 
-   now fire SQL queries. To quit, you can type in ```quit;``` Your data is 
+8. Start quickstep: ```./quickstep_cli_shell --initialize_db=true```. You can
+   now fire SQL queries. To quit, you can type in ```quit;``` Your data is
stored in the directory ```qsstor```. Note the next time you start 
Quickstep,
-   you can omit the ``` --initialize_db``` flag (as the database has already 
+   you can omit the ``` --initialize_db``` flag (as the database has already
been initialized), and simply start Quickstep as: 
```./quickstep_cli_shell```.
There are also a number of optional flags that you can specify, and to see
the full list, you can type in: ```./quickstep_cli_shell --help```
@@ -87,21 +87,21 @@ CREATE TABLE City (cid Integer, name VARCHAR(80), state 
CHAR(2));
   SELECT cid, MIN(lowTemperature), MAX(highTemperature) FROM Weather GROUP BY 
cid;
   ```
 
-  c. Find the min and max temperature for each city using a nested query, and 
+  c. Find the min and max temperature for each city using a nested query, and
  printing thie city name:
   ```
   SELECT * FROM City C, (SELECT cid, MIN(lowTemperature), MAX(highTemperature) 
FROM Weather GROUP BY cid) AS T WHERE C.cid = T.cid;
   ```
 
 12. Quickstep also supports a COPY TABLE command. If you want to try that, then
-from a separate shell file type in the following: 
+from a separate shell file type in the following:
 
 ```
 echo "3|2015-11-3|49|29" > /tmp/tmp.tbl
 echo "3|2015-11-4|48|28" >> /tmp/tmp.tbl
 echo "3|2015-11-5|47|27" >> /tmp/tmp.tbl
 ```
-   
+
 Then, load this new data by typing the following SQL in the Quickstep 
shell:
 
 ```

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/WORKING_WITH_AN_IDE.md
--
diff --git a/WORKING_WITH_AN_IDE.md b/WORKING_WITH_AN_IDE.md
index f9139ab..017a174 100644
--- a/WORKING_WITH_AN_IDE.md
+++ b/WORKING_WITH_AN_IDE.md
@@ -37,7 +37,7 @@ ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/
 ```
 
 Once you have brew installed, simply use brew to install cmake from the
-Terminal app by typing: 
+Terminal app by typing:
 
 ```
 brew install cmake
@@ -90,13 +90,13 @@ cp -R ../qsstor .
 ```
 
 The above command ensures that you now have the appropriate directory structure
-and a starting catalog file to start Quickstep. The default database is called 
-simply "default" and no relations in it upfront. 
+and a starting catalog file to start Quickstep. The default database is called
+simply "default" and no relations in it upfront.
 
 There are other ways of specifying where Quickstep stores the data and catalog.
 In particular there is a  `-storage_path` option that could be an alternative
 way of specifying the storage path and avoiding the copy above. You can find
-these and other command line options by typing: 
+these and other command line options by typing:
 
 ```
 ./quickstep_cli_shell -help
@@ -104,15 +104,15 @@ these and other command line options by typing:
 
 
 ###4: Debug Quickstep
-Now you can debug as you would any normal process in Xcode. Note the 
+Now you can debug as you would any normal process in Xcode. Note the
 linenoise option in the cmake 

[45/73] [abbrv] incubator-quickstep git commit: Separate Date type from Datetime type.

2016-09-06 Thread hbdeshmukh
Separate Date type from Datetime type.

- Beginning from the parser to the operator execution level, treat Date type
  sepearately than the Datetime type.
- Provide support for the extract function when applied on the Date
  type, implemented in the DateExtractOperation.
- Modified the tests.


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

Branch: refs/heads/partitioned-aggregation
Commit: 1d10422913d7b2ea613c5853585fcea333534ec5
Parents: cdc1e05
Author: Harshad Deshmukh 
Authored: Mon Aug 29 14:03:52 2016 -0500
Committer: Harshad Deshmukh 
Committed: Mon Sep 5 11:02:26 2016 -0500

--
 parser/SqlParser.ypp|   2 +-
 parser/tests/Select.test|  28 +--
 parser/tests/TPCH.test  |  47 ++--
 .../tests/execution_generator/Insert.test   |  19 ++
 .../tests/execution_generator/Select.test   |  32 +--
 query_optimizer/tests/resolver/Select.test  |  71 --
 types/DateOperatorOverloads.hpp |  63 -
 types/DatetimeLit.hpp   |   8 +
 .../binary_operations/AddBinaryOperation.cpp|  84 ++-
 .../operations/binary_operations/CMakeLists.txt |   2 +
 .../SubtractBinaryOperation.cpp |  81 +-
 .../tests/AddBinaryOperation_unittest.cpp   |  23 +-
 .../tests/BinaryOperationTestUtil.hpp   |   4 +-
 .../tests/SubtractBinaryOperation_unittest.cpp  |  23 +-
 .../operations/unary_operations/CMakeLists.txt  |   2 +
 .../unary_operations/DateExtractOperation.cpp   | 246 ---
 .../unary_operations/DateExtractOperation.hpp   |  52 +++-
 .../tests/DateExtractOperation_unittest.cpp |  93 +--
 18 files changed, 708 insertions(+), 172 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/1d104229/parser/SqlParser.ypp
--
diff --git a/parser/SqlParser.ypp b/parser/SqlParser.ypp
index 3f0cc80..547bb40 100644
--- a/parser/SqlParser.ypp
+++ b/parser/SqlParser.ypp
@@ -760,7 +760,7 @@ data_type:
 YYERROR;
   }
   | TOKEN_DATE {
-$$ = new 
quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));
+$$ = new 
quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDate));
   }
   | TOKEN_DATETIME {
 $$ = new 
quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/1d104229/parser/tests/Select.test
--
diff --git a/parser/tests/Select.test b/parser/tests/Select.test
index b614a99..8e47519 100644
--- a/parser/tests/Select.test
+++ b/parser/tests/Select.test
@@ -961,7 +961,7 @@ SelectStatement
   | |   +-StringLiteral[value=1998-12-01]
   | +-SelectListItem
   |   +-Literal
-  | +-StringLiteral[value=1998-12-01,explicit_type=Datetime]
+  | +-StringLiteral[value=1998-12-01,explicit_type=Date]
   +-from_clause=
 +-TableReference[table=test]
 ==
@@ -975,10 +975,10 @@ SelectStatement
   +-select_clause=SelectList
   | +-SelectListItem
   | | +-Literal
-  | |   +-StringLiteral[value=1960-12-12,explicit_type=Datetime]
+  | |   +-StringLiteral[value=1960-12-12,explicit_type=Date]
   | +-SelectListItem
   |   +-Literal
-  | +-StringLiteral[value=1901-12-14,explicit_type=Datetime]
+  | +-StringLiteral[value=1901-12-14,explicit_type=Date]
   +-from_clause=
 +-TableReference[table=test]
 ==
@@ -990,10 +990,10 @@ SelectStatement
   +-select_clause=SelectList
   | +-SelectListItem
   | | +-Literal
-  | |   +-StringLiteral[value=1998-2-12,explicit_type=Datetime]
+  | |   +-StringLiteral[value=1998-2-12,explicit_type=Date]
   | +-SelectListItem
   |   +-Literal
-  | +-StringLiteral[value=1998-12-2,explicit_type=Datetime]
+  | +-StringLiteral[value=1998-12-2,explicit_type=Date]
   +-from_clause=
 +-TableReference[table=test]
 ==
@@ -1007,10 +1007,10 @@ SelectStatement
   +-select_clause=SelectList
   | +-SelectListItem
   | | +-Literal
-  | |   +-StringLiteral[value=+1921-12-12,explicit_type=Datetime]
+  | |   +-StringLiteral[value=+1921-12-12,explicit_type=Date]
   | +-SelectListItem
   |   +-Literal
-  | +-StringLiteral[value=+10001-12-12,explicit_type=Datetime]
+  | +-StringLiteral[value=+10001-12-12,explicit_type=Date]
   +-from_clause=
 +-TableReference[table=test]
 ==
@@ -1059,13 +1059,13 @@ SelectStatement
   +-select_clause=SelectList
   | +-SelectListItem
   | | +-Literal
-  | |   

[33/73] [abbrv] incubator-quickstep git commit: Deserialized Window Aggr WorkOrder.

2016-09-06 Thread hbdeshmukh
Deserialized Window Aggr WorkOrder.


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

Branch: refs/heads/partitioned-aggregation
Commit: 85e02de49205409accfef3737dadfe95aad1f5c0
Parents: 658cb61
Author: Zuyu Zhang 
Authored: Mon Aug 8 23:14:08 2016 -0700
Committer: Zuyu Zhang 
Committed: Mon Aug 8 23:14:08 2016 -0700

--
 relational_operators/CMakeLists.txt   |  1 +
 relational_operators/WorkOrderFactory.cpp | 25 +
 2 files changed, 26 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/85e02de4/relational_operators/CMakeLists.txt
--
diff --git a/relational_operators/CMakeLists.txt 
b/relational_operators/CMakeLists.txt
index 9696392..43a42f9 100644
--- a/relational_operators/CMakeLists.txt
+++ b/relational_operators/CMakeLists.txt
@@ -467,6 +467,7 @@ 
target_link_libraries(quickstep_relationaloperators_WorkOrderFactory
   quickstep_relationaloperators_TableGeneratorOperator
   quickstep_relationaloperators_TextScanOperator
   quickstep_relationaloperators_UpdateOperator
+  quickstep_relationaloperators_WindowAggregationOperator
   quickstep_relationaloperators_WorkOrder_proto
   quickstep_storage_StorageBlockInfo
   quickstep_utility_Macros

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/85e02de4/relational_operators/WorkOrderFactory.cpp
--
diff --git a/relational_operators/WorkOrderFactory.cpp 
b/relational_operators/WorkOrderFactory.cpp
index f920cac..721d735 100644
--- a/relational_operators/WorkOrderFactory.cpp
+++ b/relational_operators/WorkOrderFactory.cpp
@@ -46,6 +46,7 @@
 #include "relational_operators/TableGeneratorOperator.hpp"
 #include "relational_operators/TextScanOperator.hpp"
 #include "relational_operators/UpdateOperator.hpp"
+#include "relational_operators/WindowAggregationOperator.hpp"
 #include "relational_operators/WorkOrder.pb.h"
 #include "storage/StorageBlockInfo.hpp"
 
@@ -419,6 +420,22 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const 
serialization::WorkOrder
   shiftboss_client_id,
   bus);
 }
+case serialization::WINDOW_AGGREGATION: {
+  LOG(INFO) << "Creating WindowAggregationWorkOrder";
+  vector blocks;
+  for (int i = 0; i < 
proto.ExtensionSize(serialization::WindowAggregationWorkOrder::block_ids); ++i) 
{
+blocks.push_back(
+
proto.GetExtension(serialization::WindowAggregationWorkOrder::block_ids, i));
+  }
+
+  return new WindowAggregationWorkOrder(
+  proto.query_id(),
+  query_context->getWindowAggregationState(
+  
proto.GetExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index)),
+  move(blocks),
+  query_context->getInsertDestination(
+  
proto.GetExtension(serialization::FinalizeAggregationWorkOrder::insert_destination_index)));
+}
 default:
   LOG(FATAL) << "Unknown WorkOrder Type in 
WorkOrderFactory::ReconstructFromProto";
   }
@@ -697,6 +714,14 @@ bool WorkOrderFactory::ProtoIsValid(const 
serialization::WorkOrder ,
  
proto.HasExtension(serialization::UpdateWorkOrder::operator_index) &&
  proto.HasExtension(serialization::UpdateWorkOrder::block_id);
 }
+case serialization::WINDOW_AGGREGATION: {
+  return 
proto.HasExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index)
 &&
+ query_context.isValidWindowAggregationStateId(
+ 
proto.GetExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index))
 &&
+ 
proto.HasExtension(serialization::WindowAggregationWorkOrder::insert_destination_index)
 &&
+ query_context.isValidInsertDestinationId(
+ 
proto.GetExtension(serialization::WindowAggregationWorkOrder::insert_destination_index));
+}
 default:
   return false;
   }



[41/73] [abbrv] incubator-quickstep git commit: Refactored OptimizerContext and Optimizer.

2016-09-06 Thread hbdeshmukh
Refactored OptimizerContext and Optimizer.

  * Construct physical generator in query_optimizer once for all queries.


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

Branch: refs/heads/partitioned-aggregation
Commit: 8c811c85e64ddb9889780ad3467dfc5abbfc9f28
Parents: 8ec99ed
Author: Zuyu Zhang 
Authored: Sat Aug 13 01:49:03 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 16 13:26:38 2016 -0700

--
 cli/tests/CMakeLists.txt|  8 +---
 cli/tests/CommandExecutorTestRunner.cpp | 35 ++
 cli/tests/CommandExecutorTestRunner.hpp |  2 +
 query_optimizer/CMakeLists.txt  |  2 +-
 query_optimizer/ExecutionGenerator.cpp  | 35 +-
 query_optimizer/ExecutionGenerator.hpp  | 12 +++---
 query_optimizer/LogicalGenerator.cpp|  3 +-
 query_optimizer/LogicalGenerator.hpp|  5 ++-
 query_optimizer/Optimizer.cpp   | 12 +++---
 query_optimizer/Optimizer.hpp   | 26 +
 query_optimizer/OptimizerContext.hpp| 39 +---
 query_optimizer/QueryProcessor.cpp  |  7 ++--
 query_optimizer/QueryProcessor.hpp  |  3 ++
 query_optimizer/resolver/Resolver.cpp   |  4 +-
 query_optimizer/resolver/Resolver.hpp   |  8 +++-
 query_optimizer/tests/CMakeLists.txt| 12 +-
 .../tests/ExecutionGeneratorTestRunner.cpp  | 35 +-
 .../tests/ExecutionGeneratorTestRunner.hpp  |  3 +-
 query_optimizer/tests/OptimizerTest.cpp |  3 +-
 .../tests/OptimizerTextTestRunner.cpp   |  9 ++---
 20 files changed, 93 insertions(+), 170 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8c811c85/cli/tests/CMakeLists.txt
--
diff --git a/cli/tests/CMakeLists.txt b/cli/tests/CMakeLists.txt
index 3bceba8..99fa3a3 100644
--- a/cli/tests/CMakeLists.txt
+++ b/cli/tests/CMakeLists.txt
@@ -36,19 +36,13 @@ 
target_link_libraries(quickstep_cli_tests_CommandExecutorTest
   quickstep_parser_SqlParserWrapper
   quickstep_queryexecution_AdmitRequestMessage
   quickstep_queryexecution_ForemanSingleNode
-  quickstep_queryexecution_QueryContext
   quickstep_queryexecution_QueryExecutionTypedefs
   quickstep_queryexecution_QueryExecutionUtil
   quickstep_queryexecution_Worker
   quickstep_queryexecution_WorkerDirectory
-  quickstep_queryexecution_WorkerMessage
-  quickstep_queryoptimizer_ExecutionGenerator
-  quickstep_queryoptimizer_LogicalGenerator
+  quickstep_queryoptimizer_Optimizer
   quickstep_queryoptimizer_OptimizerContext
-  quickstep_queryoptimizer_PhysicalGenerator
   quickstep_queryoptimizer_QueryHandle
-  quickstep_queryoptimizer_QueryPlan
-  quickstep_queryoptimizer_physical_Physical
   quickstep_queryoptimizer_tests_TestDatabaseLoader
   quickstep_utility_Macros
   quickstep_utility_MemStream

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8c811c85/cli/tests/CommandExecutorTestRunner.cpp
--
diff --git a/cli/tests/CommandExecutorTestRunner.cpp 
b/cli/tests/CommandExecutorTestRunner.cpp
index 9c701cd..41cc9da 100644
--- a/cli/tests/CommandExecutorTestRunner.cpp
+++ b/cli/tests/CommandExecutorTestRunner.cpp
@@ -31,17 +31,10 @@
 #include "query_execution/AdmitRequestMessage.hpp"
 #include "query_execution/ForemanSingleNode.hpp"
 #include "query_execution/QueryExecutionTypedefs.hpp"
-#include "query_execution/Worker.hpp"
-#include "query_optimizer/ExecutionGenerator.hpp"
-#include "query_optimizer/LogicalGenerator.hpp"
+#include "query_optimizer/Optimizer.hpp"
 #include "query_optimizer/OptimizerContext.hpp"
-#include "query_optimizer/PhysicalGenerator.hpp"
 #include "query_optimizer/QueryHandle.hpp"
-#include "query_optimizer/QueryPlan.hpp"
-#include "query_optimizer/physical/Physical.hpp"
-#include "utility/Macros.hpp"
 #include "utility/MemStream.hpp"
-#include "utility/PtrList.hpp"
 #include "utility/SqlError.hpp"
 
 #include "glog/logging.h"
@@ -53,8 +46,6 @@ namespace quickstep {
 

[62/73] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/expressions/aggregation/AggregationHandleMin.hpp
--
diff --git a/expressions/aggregation/AggregationHandleMin.hpp 
b/expressions/aggregation/AggregationHandleMin.hpp
index 4e0c72b..4a0eca4 100644
--- a/expressions/aggregation/AggregationHandleMin.hpp
+++ b/expressions/aggregation/AggregationHandleMin.hpp
@@ -28,8 +28,8 @@
 #include "catalog/CatalogTypedefs.hpp"
 #include "expressions/aggregation/AggregationConcreteHandle.hpp"
 #include "expressions/aggregation/AggregationHandle.hpp"
-#include "storage/HashTableBase.hpp"
 #include "storage/FastHashTable.hpp"
+#include "storage/HashTableBase.hpp"
 #include "threading/SpinMutex.hpp"
 #include "types/Type.hpp"
 #include "types/TypedValue.hpp"
@@ -56,19 +56,18 @@ class AggregationStateMin : public AggregationState {
   /**
* @brief Copy constructor (ignores mutex).
*/
-  AggregationStateMin(const AggregationStateMin )
-  : min_(orig.min_) {
-  }
+  AggregationStateMin(const AggregationStateMin ) : min_(orig.min_) {}
 
   /**
* @brief Destructor.
*/
   ~AggregationStateMin() override {}
 
-  size_t getPayloadSize() const {
- return sizeof(TypedValue);
-  }
+  std::size_t getPayloadSize() const { return sizeof(TypedValue); }
 
+  const std::uint8_t *getPayloadAddress() const {
+return reinterpret_cast(_);
+  }
 
  private:
   friend class AggregationHandleMin;
@@ -76,9 +75,7 @@ class AggregationStateMin : public AggregationState {
   explicit AggregationStateMin(const Type )
   : min_(type.getNullableVersion().makeNullValue()) {}
 
-  explicit AggregationStateMin(TypedValue &)
-  : min_(std::move(value)) {
-  }
+  explicit AggregationStateMin(TypedValue &) : min_(std::move(value)) {}
 
   TypedValue min_;
   SpinMutex mutex_;
@@ -89,8 +86,7 @@ class AggregationStateMin : public AggregationState {
  **/
 class AggregationHandleMin : public AggregationConcreteHandle {
  public:
-  ~AggregationHandleMin() override {
-  }
+  ~AggregationHandleMin() override {}
 
   AggregationState* createInitialState() const override {
 return new AggregationStateMin(type_);
@@ -98,45 +94,46 @@ class AggregationHandleMin : public 
AggregationConcreteHandle {
 
   AggregationStateHashTableBase* createGroupByHashTable(
   const HashTableImplType hash_table_impl,
-  const std::vector _by_types,
+  const std::vector _by_types,
   const std::size_t estimated_num_groups,
   StorageManager *storage_manager) const override;
 
   /**
* @brief Iterate with min aggregation state.
*/
-  inline void iterateUnaryInl(AggregationStateMin *state, const TypedValue 
) const {
+  inline void iterateUnaryInl(AggregationStateMin *state,
+  const TypedValue ) const {
 DCHECK(value.isPlausibleInstanceOf(type_.getSignature()));
 compareAndUpdate(state, value);
   }
 
-  inline void iterateUnaryInlFast(const TypedValue , uint8_t *byte_ptr) 
const {
-  DCHECK(value.isPlausibleInstanceOf(type_.getSignature()));
-  TypedValue *min_ptr = reinterpret_cast(byte_ptr);
-  compareAndUpdateFast(min_ptr, value);
+  inline void iterateUnaryInlFast(const TypedValue ,
+  std::uint8_t *byte_ptr) const {
+DCHECK(value.isPlausibleInstanceOf(type_.getSignature()));
+TypedValue *min_ptr = reinterpret_cast(byte_ptr);
+compareAndUpdateFast(min_ptr, value);
   }
 
-  inline void iterateInlFast(const std::vector , uint8_t 
*byte_ptr) const override {
-if (block_update) return;
-iterateUnaryInlFast(arguments.front(), byte_ptr);
+  inline void updateState(const std::vector ,
+  std::uint8_t *byte_ptr) const override {
+if (!block_update_) {
+  iterateUnaryInlFast(arguments.front(), byte_ptr);
+}
   }
 
-  void BlockUpdate() override {
-  block_update = true;
-  }
+  void blockUpdate() override { block_update_ = true; }
 
-  void AllowUpdate() override {
-  block_update = false;
-  }
+  void allowUpdate() override { block_update_ = false; }
 
-  void initPayload(uint8_t *byte_ptr) const override {
+  void initPayload(std::uint8_t *byte_ptr) const override {
 TypedValue *min_ptr = reinterpret_cast(byte_ptr);
 TypedValue t1 = (type_.getNullableVersion().makeNullValue());
 *min_ptr = t1;
   }
 
   AggregationState* accumulateColumnVectors(
-  const std::vector _vectors) const 
override;
+  const std::vector _vectors)
+  const override;
 
 #ifdef QUICKSTEP_ENABLE_VECTOR_COPY_ELISION_SELECTION
   AggregationState* accumulateValueAccessor(
@@ -153,18 +150,20 @@ class AggregationHandleMin : public 
AggregationConcreteHandle {
   void mergeStates(const AggregationState ,
AggregationState *destination) const override;
 
-  void mergeStatesFast(const uint8_t *source,
-   uint8_t *destination) const 

[37/73] [abbrv] incubator-quickstep git commit: Fixed a bug in deserializing WindowAggrWorkOrder.

2016-09-06 Thread hbdeshmukh
Fixed a bug in deserializing WindowAggrWorkOrder.


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

Branch: refs/heads/partitioned-aggregation
Commit: 6ee9842fbebd8dac38c35c383bad018b1b7fcb09
Parents: d9135a8
Author: Zuyu Zhang 
Authored: Fri Aug 12 08:59:12 2016 -0700
Committer: Zuyu Zhang 
Committed: Fri Aug 12 08:59:12 2016 -0700

--
 relational_operators/WorkOrderFactory.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6ee9842f/relational_operators/WorkOrderFactory.cpp
--
diff --git a/relational_operators/WorkOrderFactory.cpp 
b/relational_operators/WorkOrderFactory.cpp
index 7d7af59..6970486 100644
--- a/relational_operators/WorkOrderFactory.cpp
+++ b/relational_operators/WorkOrderFactory.cpp
@@ -434,7 +434,7 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const 
serialization::WorkOrder
   
proto.GetExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index)),
   move(blocks),
   query_context->getInsertDestination(
-  
proto.GetExtension(serialization::FinalizeAggregationWorkOrder::insert_destination_index)));
+  
proto.GetExtension(serialization::WindowAggregationWorkOrder::insert_destination_index)));
 }
 default:
   LOG(FATAL) << "Unknown WorkOrder Type in 
WorkOrderFactory::ReconstructFromProto";



[06/73] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/transaction/DeadLockDetector.cpp
--
diff --git a/transaction/DeadLockDetector.cpp b/transaction/DeadLockDetector.cpp
index 26ab115..f213e1a 100644
--- a/transaction/DeadLockDetector.cpp
+++ b/transaction/DeadLockDetector.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "transaction/DeadLockDetector.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/transaction/DeadLockDetector.hpp
--
diff --git a/transaction/DeadLockDetector.hpp b/transaction/DeadLockDetector.hpp
index 6897afb..08a0c25 100644
--- a/transaction/DeadLockDetector.hpp
+++ b/transaction/DeadLockDetector.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_TRANSACTION_DEAD_LOCK_DETECTOR_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/transaction/DirectedGraph.hpp
--
diff --git a/transaction/DirectedGraph.hpp b/transaction/DirectedGraph.hpp
index 16b551a..ad209ac 100644
--- a/transaction/DirectedGraph.hpp
+++ b/transaction/DirectedGraph.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the 

[52/63] [abbrv] incubator-quickstep git commit: Fixed 4 failures on unit tests

2016-09-06 Thread hbdeshmukh
Fixed 4 failures on unit tests


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

Branch: refs/heads/quickstep-28-29
Commit: 48dc0e819b7b595ac89676fdc74745c36ea3707a
Parents: 169ae32
Author: rathijit 
Authored: Fri Aug 5 06:00:12 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 .../aggregation/AggregationConcreteHandle.cpp   | 14 +++---
 .../aggregation/AggregationConcreteHandle.hpp   | 41 ++--
 expressions/aggregation/AggregationHandle.hpp   |  6 ++-
 .../aggregation/AggregationHandleAvg.cpp| 14 +++---
 .../aggregation/AggregationHandleAvg.hpp| 15 +-
 .../aggregation/AggregationHandleCount.cpp  |  7 +--
 .../aggregation/AggregationHandleCount.hpp  | 19 ++--
 .../aggregation/AggregationHandleDistinct.cpp   |  2 +-
 .../aggregation/AggregationHandleDistinct.hpp   |  2 +-
 .../aggregation/AggregationHandleMax.cpp| 14 +++---
 .../aggregation/AggregationHandleMax.hpp| 13 -
 .../aggregation/AggregationHandleMin.cpp| 14 +++---
 .../aggregation/AggregationHandleMin.hpp| 15 +-
 .../aggregation/AggregationHandleSum.cpp| 15 +++---
 .../aggregation/AggregationHandleSum.hpp| 15 +-
 storage/AggregationOperationState.cpp   | 51 +++-
 storage/CMakeLists.txt  |  1 -
 storage/FastHashTable.hpp   | 41 +++-
 storage/FastSeparateChainingHashTable.hpp   | 16 +++---
 19 files changed, 221 insertions(+), 94 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/48dc0e81/expressions/aggregation/AggregationConcreteHandle.cpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.cpp 
b/expressions/aggregation/AggregationConcreteHandle.cpp
index 1efe010..ac5148b 100644
--- a/expressions/aggregation/AggregationConcreteHandle.cpp
+++ b/expressions/aggregation/AggregationConcreteHandle.cpp
@@ -52,17 +52,17 @@ void 
AggregationConcreteHandle::insertValueAccessorIntoDistinctifyHashTable(
 AggregationStateHashTableBase *distinctify_hash_table) const {
   // If the key-value pair is already there, we don't need to update the value,
   // which should always be "true". I.e. the value is just a placeholder.
-//  const auto noop_upserter = [](const auto , const bool *value) -> 
void {};
+  //  const auto noop_upserter = [](const auto , const bool *value) 
-> void {};
 
   AggregationStateFastHashTable *hash_table =
   static_cast(distinctify_hash_table);
   if (key_ids.size() == 1) {
-// TODO(rathijit): fix
-//hash_table->upsertValueAccessor(accessor,
-//key_ids[0],
-//true /* check_for_null_keys */,
-//true /* initial_value */,
-//_upserter);
+std::vector args;
+args.emplace_back(key_ids);
+hash_table->upsertValueAccessorFast(args,
+accessor,
+key_ids[0],
+true /* check_for_null_keys */);
   } else {
 std::vector empty_args;
 empty_args.resize(1);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/48dc0e81/expressions/aggregation/AggregationConcreteHandle.hpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.hpp 
b/expressions/aggregation/AggregationConcreteHandle.hpp
index d332ec9..609937a 100644
--- a/expressions/aggregation/AggregationConcreteHandle.hpp
+++ b/expressions/aggregation/AggregationConcreteHandle.hpp
@@ -27,6 +27,7 @@
 #include "catalog/CatalogTypedefs.hpp"
 #include "expressions/aggregation/AggregationHandle.hpp"
 #include "storage/HashTable.hpp"
+#include "storage/FastHashTable.hpp"
 #include "storage/HashTableBase.hpp"
 #include "types/TypedValue.hpp"
 #include "types/containers/ColumnVector.hpp"
@@ -278,6 +279,11 @@ class AggregationConcreteHandle : public AggregationHandle 
{
   const AggregationStateHashTableBase _hash_table) const;
 
   template 
+  StateT* aggregateOnDistinctifyHashTableForSingleUnaryHelperFast(
+  const AggregationStateHashTableBase _hash_table) const;
+
+  template 
   void aggregateOnDistinctifyHashTableForGroupByUnaryHelper(
@@ -289,7 +295,7 @@ class AggregationConcreteHandle : public 

[42/63] [abbrv] incubator-quickstep git commit: Minor fixes to the distributed query execution engine.

2016-09-06 Thread hbdeshmukh
Minor fixes to the distributed query execution engine.


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

Branch: refs/heads/quickstep-28-29
Commit: 59f4dab26aa31a7e2aa9dfdc60524e56060f935b
Parents: 8c811c8
Author: Zuyu Zhang 
Authored: Tue Aug 16 13:17:01 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 16 13:30:41 2016 -0700

--
 query_execution/ForemanDistributed.cpp  | 2 +-
 query_execution/ForemanDistributed.hpp  | 2 +-
 query_execution/QueryManagerDistributed.cpp | 2 +-
 query_execution/QueryManagerDistributed.hpp | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/59f4dab2/query_execution/ForemanDistributed.cpp
--
diff --git a/query_execution/ForemanDistributed.cpp 
b/query_execution/ForemanDistributed.cpp
index 29f5b9b..9c20465 100644
--- a/query_execution/ForemanDistributed.cpp
+++ b/query_execution/ForemanDistributed.cpp
@@ -279,7 +279,7 @@ void 
ForemanDistributed::printWorkOrderProfilingResults(const std::size_t query_
 }
 
 void ForemanDistributed::processShiftbossRegistrationMessage(const client_id 
shiftboss_client_id,
-  const 
std::size_t work_order_capacity) {
+ const std::size_t 
work_order_capacity) {
   S::ShiftbossRegistrationResponseMessage proto;
   proto.set_shiftboss_index(shiftboss_directory_.size());
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/59f4dab2/query_execution/ForemanDistributed.hpp
--
diff --git a/query_execution/ForemanDistributed.hpp 
b/query_execution/ForemanDistributed.hpp
index f9a326a..fc1ede5 100644
--- a/query_execution/ForemanDistributed.hpp
+++ b/query_execution/ForemanDistributed.hpp
@@ -102,7 +102,7 @@ class ForemanDistributed final : public ForemanBase {
 const serialization::WorkOrderMessage );
 
   void processShiftbossRegistrationMessage(const tmb::client_id 
shiftboss_client_id,
-const std::size_t 
work_order_capacity);
+   const std::size_t 
work_order_capacity);
 
   void processSaveQueryResultResponseMessage(const tmb::client_id cli_id,
  const relation_id 
result_relation_id);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/59f4dab2/query_execution/QueryManagerDistributed.cpp
--
diff --git a/query_execution/QueryManagerDistributed.cpp 
b/query_execution/QueryManagerDistributed.cpp
index e300ce5..7d45933 100644
--- a/query_execution/QueryManagerDistributed.cpp
+++ b/query_execution/QueryManagerDistributed.cpp
@@ -47,7 +47,7 @@ using std::unique_ptr;
 namespace quickstep {
 
 QueryManagerDistributed::QueryManagerDistributed(QueryHandle *query_handle,
- ShiftbossDirectory 
*shiftboss_directory,
+ const ShiftbossDirectory 
*shiftboss_directory,
  const tmb::client_id 
foreman_client_id,
  tmb::MessageBus *bus)
 : QueryManagerBase(query_handle),

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/59f4dab2/query_execution/QueryManagerDistributed.hpp
--
diff --git a/query_execution/QueryManagerDistributed.hpp 
b/query_execution/QueryManagerDistributed.hpp
index b448528..e609ab8 100644
--- a/query_execution/QueryManagerDistributed.hpp
+++ b/query_execution/QueryManagerDistributed.hpp
@@ -58,7 +58,7 @@ class QueryManagerDistributed final : public QueryManagerBase 
{
* @param bus The TMB used for communication.
**/
   QueryManagerDistributed(QueryHandle *query_handle,
-  ShiftbossDirectory *shiftboss_directory,
+  const ShiftbossDirectory *shiftboss_directory,
   const tmb::client_id foreman_client_id,
   tmb::MessageBus *bus);
 
@@ -105,7 +105,7 @@ class QueryManagerDistributed final : public 
QueryManagerBase {
(query_exec_state_->getNumRebuildWorkOrders(index) == 0);
   }
 
-  ShiftbossDirectory *shiftboss_directory_;
+  const 

[20/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/PhysicalGenerator.hpp
--
diff --git a/query_optimizer/PhysicalGenerator.hpp 
b/query_optimizer/PhysicalGenerator.hpp
index 484900a..886a173 100644
--- a/query_optimizer/PhysicalGenerator.hpp
+++ b/query_optimizer/PhysicalGenerator.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_GENERATOR_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/QueryHandle.hpp
--
diff --git a/query_optimizer/QueryHandle.hpp b/query_optimizer/QueryHandle.hpp
index 55427cd..1ca6021 100644
--- a/query_optimizer/QueryHandle.hpp
+++ b/query_optimizer/QueryHandle.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015-2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_QUERY_HANDLE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/QueryOptimizerConfig.h.in
--
diff --git a/query_optimizer/QueryOptimizerConfig.h.in 
b/query_optimizer/QueryOptimizerConfig.h.in
index da0fa18..3bdb6ce 100644
--- a/query_optimizer/QueryOptimizerConfig.h.in
+++ b/query_optimizer/QueryOptimizerConfig.h.in
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   

[62/63] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/expressions/aggregation/AggregationHandleMin.hpp
--
diff --git a/expressions/aggregation/AggregationHandleMin.hpp 
b/expressions/aggregation/AggregationHandleMin.hpp
index 4e0c72b..4a0eca4 100644
--- a/expressions/aggregation/AggregationHandleMin.hpp
+++ b/expressions/aggregation/AggregationHandleMin.hpp
@@ -28,8 +28,8 @@
 #include "catalog/CatalogTypedefs.hpp"
 #include "expressions/aggregation/AggregationConcreteHandle.hpp"
 #include "expressions/aggregation/AggregationHandle.hpp"
-#include "storage/HashTableBase.hpp"
 #include "storage/FastHashTable.hpp"
+#include "storage/HashTableBase.hpp"
 #include "threading/SpinMutex.hpp"
 #include "types/Type.hpp"
 #include "types/TypedValue.hpp"
@@ -56,19 +56,18 @@ class AggregationStateMin : public AggregationState {
   /**
* @brief Copy constructor (ignores mutex).
*/
-  AggregationStateMin(const AggregationStateMin )
-  : min_(orig.min_) {
-  }
+  AggregationStateMin(const AggregationStateMin ) : min_(orig.min_) {}
 
   /**
* @brief Destructor.
*/
   ~AggregationStateMin() override {}
 
-  size_t getPayloadSize() const {
- return sizeof(TypedValue);
-  }
+  std::size_t getPayloadSize() const { return sizeof(TypedValue); }
 
+  const std::uint8_t *getPayloadAddress() const {
+return reinterpret_cast(_);
+  }
 
  private:
   friend class AggregationHandleMin;
@@ -76,9 +75,7 @@ class AggregationStateMin : public AggregationState {
   explicit AggregationStateMin(const Type )
   : min_(type.getNullableVersion().makeNullValue()) {}
 
-  explicit AggregationStateMin(TypedValue &)
-  : min_(std::move(value)) {
-  }
+  explicit AggregationStateMin(TypedValue &) : min_(std::move(value)) {}
 
   TypedValue min_;
   SpinMutex mutex_;
@@ -89,8 +86,7 @@ class AggregationStateMin : public AggregationState {
  **/
 class AggregationHandleMin : public AggregationConcreteHandle {
  public:
-  ~AggregationHandleMin() override {
-  }
+  ~AggregationHandleMin() override {}
 
   AggregationState* createInitialState() const override {
 return new AggregationStateMin(type_);
@@ -98,45 +94,46 @@ class AggregationHandleMin : public 
AggregationConcreteHandle {
 
   AggregationStateHashTableBase* createGroupByHashTable(
   const HashTableImplType hash_table_impl,
-  const std::vector _by_types,
+  const std::vector _by_types,
   const std::size_t estimated_num_groups,
   StorageManager *storage_manager) const override;
 
   /**
* @brief Iterate with min aggregation state.
*/
-  inline void iterateUnaryInl(AggregationStateMin *state, const TypedValue 
) const {
+  inline void iterateUnaryInl(AggregationStateMin *state,
+  const TypedValue ) const {
 DCHECK(value.isPlausibleInstanceOf(type_.getSignature()));
 compareAndUpdate(state, value);
   }
 
-  inline void iterateUnaryInlFast(const TypedValue , uint8_t *byte_ptr) 
const {
-  DCHECK(value.isPlausibleInstanceOf(type_.getSignature()));
-  TypedValue *min_ptr = reinterpret_cast(byte_ptr);
-  compareAndUpdateFast(min_ptr, value);
+  inline void iterateUnaryInlFast(const TypedValue ,
+  std::uint8_t *byte_ptr) const {
+DCHECK(value.isPlausibleInstanceOf(type_.getSignature()));
+TypedValue *min_ptr = reinterpret_cast(byte_ptr);
+compareAndUpdateFast(min_ptr, value);
   }
 
-  inline void iterateInlFast(const std::vector , uint8_t 
*byte_ptr) const override {
-if (block_update) return;
-iterateUnaryInlFast(arguments.front(), byte_ptr);
+  inline void updateState(const std::vector ,
+  std::uint8_t *byte_ptr) const override {
+if (!block_update_) {
+  iterateUnaryInlFast(arguments.front(), byte_ptr);
+}
   }
 
-  void BlockUpdate() override {
-  block_update = true;
-  }
+  void blockUpdate() override { block_update_ = true; }
 
-  void AllowUpdate() override {
-  block_update = false;
-  }
+  void allowUpdate() override { block_update_ = false; }
 
-  void initPayload(uint8_t *byte_ptr) const override {
+  void initPayload(std::uint8_t *byte_ptr) const override {
 TypedValue *min_ptr = reinterpret_cast(byte_ptr);
 TypedValue t1 = (type_.getNullableVersion().makeNullValue());
 *min_ptr = t1;
   }
 
   AggregationState* accumulateColumnVectors(
-  const std::vector _vectors) const 
override;
+  const std::vector _vectors)
+  const override;
 
 #ifdef QUICKSTEP_ENABLE_VECTOR_COPY_ELISION_SELECTION
   AggregationState* accumulateValueAccessor(
@@ -153,18 +150,20 @@ class AggregationHandleMin : public 
AggregationConcreteHandle {
   void mergeStates(const AggregationState ,
AggregationState *destination) const override;
 
-  void mergeStatesFast(const uint8_t *source,
-   uint8_t *destination) const 

[26/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/cli/DropRelation.hpp
--
diff --git a/cli/DropRelation.hpp b/cli/DropRelation.hpp
index e82e246..91cea43 100644
--- a/cli/DropRelation.hpp
+++ b/cli/DropRelation.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_CLI_DROP_RELATION_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/cli/InputParserUtil.cpp
--
diff --git a/cli/InputParserUtil.cpp b/cli/InputParserUtil.cpp
index 352883e..0538afc 100644
--- a/cli/InputParserUtil.cpp
+++ b/cli/InputParserUtil.cpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "cli/InputParserUtil.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/cli/InputParserUtil.hpp
--
diff --git a/cli/InputParserUtil.hpp b/cli/InputParserUtil.hpp
index ebb32d2..d34dbed 100644
--- a/cli/InputParserUtil.hpp
+++ b/cli/InputParserUtil.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
- *  

[08/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/src/java/CancelMessages.java
--
diff --git a/third_party/tmb/src/java/CancelMessages.java 
b/third_party/tmb/src/java/CancelMessages.java
index 0465f43..86a1d6a 100644
--- a/third_party/tmb/src/java/CancelMessages.java
+++ b/third_party/tmb/src/java/CancelMessages.java
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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 tmb.voltdb;
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/src/java/ConnectClient.java
--
diff --git a/third_party/tmb/src/java/ConnectClient.java 
b/third_party/tmb/src/java/ConnectClient.java
index 5980895..34f443e 100644
--- a/third_party/tmb/src/java/ConnectClient.java
+++ b/third_party/tmb/src/java/ConnectClient.java
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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 tmb.voltdb;
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/src/java/DeleteMessages.java
--
diff --git a/third_party/tmb/src/java/DeleteMessages.java 
b/third_party/tmb/src/java/DeleteMessages.java
index a7507db..9fe0a65 100644
--- a/third_party/tmb/src/java/DeleteMessages.java
+++ b/third_party/tmb/src/java/DeleteMessages.java
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache 

[06/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/transaction/DeadLockDetector.cpp
--
diff --git a/transaction/DeadLockDetector.cpp b/transaction/DeadLockDetector.cpp
index 26ab115..f213e1a 100644
--- a/transaction/DeadLockDetector.cpp
+++ b/transaction/DeadLockDetector.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "transaction/DeadLockDetector.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/transaction/DeadLockDetector.hpp
--
diff --git a/transaction/DeadLockDetector.hpp b/transaction/DeadLockDetector.hpp
index 6897afb..08a0c25 100644
--- a/transaction/DeadLockDetector.hpp
+++ b/transaction/DeadLockDetector.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_TRANSACTION_DEAD_LOCK_DETECTOR_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/transaction/DirectedGraph.hpp
--
diff --git a/transaction/DirectedGraph.hpp b/transaction/DirectedGraph.hpp
index 16b551a..ad209ac 100644
--- a/transaction/DirectedGraph.hpp
+++ b/transaction/DirectedGraph.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the 

[36/63] [abbrv] incubator-quickstep git commit: Logged all sent messages using glog.

2016-09-06 Thread hbdeshmukh
Logged all sent messages using glog.


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

Branch: refs/heads/quickstep-28-29
Commit: d9135a8a2d11a1eabf6705c88391c498f4be38bb
Parents: 6168996
Author: Zuyu Zhang 
Authored: Mon Aug 8 22:49:59 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 9 19:48:01 2016 -0700

--
 query_execution/ForemanSingleNode.cpp | 14 ++--
 query_execution/PolicyEnforcerDistributed.cpp | 38 --
 query_execution/QueryExecutionUtil.hpp|  6 +-
 query_execution/Shiftboss.cpp | 86 +-
 query_execution/Worker.cpp|  6 +-
 relational_operators/DeleteOperator.cpp   | 10 +--
 relational_operators/RebuildWorkOrder.hpp |  7 +-
 relational_operators/UpdateOperator.cpp   | 10 +--
 relational_operators/WorkOrder.hpp|  7 +-
 storage/InsertDestination.cpp | 18 +++--
 storage/InsertDestination.hpp | 10 +--
 11 files changed, 92 insertions(+), 120 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d9135a8a/query_execution/ForemanSingleNode.cpp
--
diff --git a/query_execution/ForemanSingleNode.cpp 
b/query_execution/ForemanSingleNode.cpp
index d064a6f..7596b00 100644
--- a/query_execution/ForemanSingleNode.cpp
+++ b/query_execution/ForemanSingleNode.cpp
@@ -168,16 +168,15 @@ void ForemanSingleNode::run() {
   // Signal the main thread that there are no queries to be executed.
   // Currently the message doesn't have any real content.
   TaggedMessage completion_tagged_message(kWorkloadCompletionMessage);
+  DLOG(INFO) << "ForemanSingleNode sent WorkloadCompletionMessage (typed 
'" << kWorkloadCompletionMessage
+ << "') to CLI with TMB client ID " << main_thread_client_id_;
   const tmb::MessageBus::SendStatus send_status =
   QueryExecutionUtil::SendTMBMessage(
   bus_,
   foreman_client_id_,
   main_thread_client_id_,
   move(completion_tagged_message));
-  CHECK(send_status == tmb::MessageBus::SendStatus::kOK)
-  << "Message could not be sent from Foreman with TMB client ID "
-  << foreman_client_id_ << " to main thread with TMB client ID"
-  << main_thread_client_id_;
+  CHECK(send_status == tmb::MessageBus::SendStatus::kOK);
 }
   }
 }
@@ -225,15 +224,14 @@ void ForemanSingleNode::sendWorkerMessage(const size_t 
worker_thread_index,
   }
   TaggedMessage worker_tagged_message(, sizeof(message), type);
 
+  DLOG(INFO) << "ForemanSingleNode sent WorkOrderMessage (typed '" << type
+ << "') to Worker with TMB client ID " << 
worker_directory_->getClientID(worker_thread_index);
   const tmb::MessageBus::SendStatus send_status =
   QueryExecutionUtil::SendTMBMessage(bus_,
  foreman_client_id_,
  
worker_directory_->getClientID(worker_thread_index),
  move(worker_tagged_message));
-  CHECK(send_status == tmb::MessageBus::SendStatus::kOK) <<
-  "Message could not be sent from Foreman with TMB client ID "
-  << foreman_client_id_ << " to Foreman with TMB client ID "
-  << worker_directory_->getClientID(worker_thread_index);
+  CHECK(send_status == tmb::MessageBus::SendStatus::kOK);
 }
 
 const std::vector& ForemanSingleNode

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/d9135a8a/query_execution/PolicyEnforcerDistributed.cpp
--
diff --git a/query_execution/PolicyEnforcerDistributed.cpp 
b/query_execution/PolicyEnforcerDistributed.cpp
index 6d0de47..c76a9e1 100644
--- a/query_execution/PolicyEnforcerDistributed.cpp
+++ b/query_execution/PolicyEnforcerDistributed.cpp
@@ -170,25 +170,22 @@ void 
PolicyEnforcerDistributed::initiateQueryInShiftboss(QueryHandle *query_hand
 kQueryInitiateMessage);
   free(proto_bytes);
 
-  LOG(INFO) << "PolicyEnforcerDistributed sent QueryInitiateMessage (typed '" 
<< kQueryInitiateMessage
-<< "') to Shiftboss 0";
-
   // TODO(zuyu): Multiple Shiftbosses support.
+  DLOG(INFO) << "PolicyEnforcerDistributed sent QueryInitiateMessage (typed '" 
<< kQueryInitiateMessage
+ << "') to Shiftboss with TMB client ID " << 
shiftboss_directory_->getClientId(0);
   const tmb::MessageBus::SendStatus send_status =
   

[39/63] [abbrv] incubator-quickstep git commit: Added ForemanDistributed.

2016-09-06 Thread hbdeshmukh
Added ForemanDistributed.


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

Branch: refs/heads/quickstep-28-29
Commit: 203d3ea66e4c1f72f7edc858b5b243ae9db33eba
Parents: 1325a6a
Author: Zuyu Zhang 
Authored: Sat Aug 13 23:37:59 2016 -0700
Committer: Zuyu Zhang 
Committed: Mon Aug 15 13:48:32 2016 -0700

--
 query_execution/CMakeLists.txt |  24 ++
 query_execution/ForemanDistributed.cpp | 335 
 query_execution/ForemanDistributed.hpp | 130 +++
 3 files changed, 489 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/203d3ea6/query_execution/CMakeLists.txt
--
diff --git a/query_execution/CMakeLists.txt b/query_execution/CMakeLists.txt
index 4033594..1b27194 100644
--- a/query_execution/CMakeLists.txt
+++ b/query_execution/CMakeLists.txt
@@ -33,6 +33,9 @@ if (ENABLE_DISTRIBUTED)
   add_library(quickstep_queryexecution_BlockLocator BlockLocator.cpp 
BlockLocator.hpp)
 endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_ForemanBase ../empty_src.cpp 
ForemanBase.hpp)
+if (ENABLE_DISTRIBUTED)
+  add_library(quickstep_queryexecution_ForemanDistributed 
ForemanDistributed.cpp ForemanDistributed.hpp)
+endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_ForemanSingleNode ForemanSingleNode.cpp 
ForemanSingleNode.hpp)
 add_library(quickstep_queryexecution_PolicyEnforcerBase PolicyEnforcerBase.cpp 
PolicyEnforcerBase.hpp)
 if (ENABLE_DISTRIBUTED)
@@ -86,6 +89,26 @@ target_link_libraries(quickstep_queryexecution_ForemanBase
   quickstep_threading_Thread
   quickstep_utility_Macros
   tmb)
+if (ENABLE_DISTRIBUTED)
+  target_link_libraries(quickstep_queryexecution_ForemanDistributed
+glog
+quickstep_catalog_CatalogDatabase
+quickstep_catalog_CatalogRelation
+quickstep_catalog_CatalogTypedefs
+quickstep_catalog_Catalog_proto
+quickstep_queryexecution_AdmitRequestMessage
+quickstep_queryexecution_ForemanBase
+quickstep_queryexecution_PolicyEnforcerDistributed
+quickstep_queryexecution_QueryExecutionMessages_proto
+quickstep_queryexecution_QueryExecutionTypedefs
+quickstep_queryexecution_QueryExecutionUtil
+quickstep_queryexecution_ShiftbossDirectory
+quickstep_threading_ThreadUtil
+quickstep_utility_EqualsAnyConstant
+quickstep_utility_Macros
+tmb
+${GFLAGS_LIB_NAME})
+endif(ENABLE_DISTRIBUTED)
 target_link_libraries(quickstep_queryexecution_ForemanSingleNode
   glog
   quickstep_queryexecution_AdmitRequestMessage
@@ -316,6 +339,7 @@ target_link_libraries(quickstep_queryexecution
 if (ENABLE_DISTRIBUTED)
   target_link_libraries(quickstep_queryexecution
 quickstep_queryexecution_BlockLocator
+quickstep_queryexecution_ForemanDistributed
 quickstep_queryexecution_PolicyEnforcerDistributed
 quickstep_queryexecution_QueryManagerDistributed
 quickstep_queryexecution_Shiftboss

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/203d3ea6/query_execution/ForemanDistributed.cpp
--
diff --git a/query_execution/ForemanDistributed.cpp 
b/query_execution/ForemanDistributed.cpp
new file mode 100644
index 000..29f5b9b
--- /dev/null
+++ b/query_execution/ForemanDistributed.cpp
@@ -0,0 +1,335 @@
+/**
+ * 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 at
+ *
+ *   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.
+ **/
+
+#include "query_execution/ForemanDistributed.hpp"
+
+#include 
+#include 
+#include 

[47/63] [abbrv] incubator-quickstep git commit: Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, some more optimizations are pending.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/storage/FastSeparateChainingHashTable.hpp
--
diff --git a/storage/FastSeparateChainingHashTable.hpp 
b/storage/FastSeparateChainingHashTable.hpp
new file mode 100644
index 000..64c4979
--- /dev/null
+++ b/storage/FastSeparateChainingHashTable.hpp
@@ -0,0 +1,1761 @@
+/**
+ *   Copyright 2011-2015 Quickstep Technologies LLC.
+ *   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.
+ *   You may obtain a copy of the License at
+ *
+ *   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.
+ **/
+
+#ifndef QUICKSTEP_STORAGE_FAST_SEPARATE_CHAINING_HASH_TABLE_HPP_
+#define QUICKSTEP_STORAGE_FAST_SEPARATE_CHAINING_HASH_TABLE_HPP_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "storage/HashTable.hpp"
+#include "storage/FastHashTable.hpp"
+#include "storage/HashTableBase.hpp"
+#include "storage/HashTableKeyManager.hpp"
+#include "storage/StorageBlob.hpp"
+#include "storage/StorageBlockInfo.hpp"
+#include "storage/StorageConstants.hpp"
+#include "storage/StorageManager.hpp"
+#include "threading/SpinSharedMutex.hpp"
+#include "types/Type.hpp"
+#include "types/TypedValue.hpp"
+#include "utility/Alignment.hpp"
+#include "utility/Macros.hpp"
+#include "utility/PrimeNumber.hpp"
+
+namespace quickstep {
+
+/** \addtogroup Storage
+ *  @{
+ */
+
+/**
+ * @brief A hash table implementation which uses separate chaining for buckets.
+ **/
+template 
+class FastSeparateChainingHashTable : public FastHashTable {
+ public:
+  FastSeparateChainingHashTable(const std::vector _types,
+const std::size_t num_entries,
+const std::vector _sizes,
+const std::vector ,
+StorageManager *storage_manager);
+
+  FastSeparateChainingHashTable(const std::vector _types,
+void *hash_table_memory,
+const std::size_t hash_table_memory_size,
+const bool new_hash_table,
+const bool hash_table_memory_zeroed);
+
+  // Delegating constructors for single scalar keys.
+  FastSeparateChainingHashTable(const Type _type,
+const std::size_t num_entries,
+StorageManager *storage_manager)
+  : FastSeparateChainingHashTable(std::vector(1, _type),
+  num_entries,
+  storage_manager) {
+  }
+
+  FastSeparateChainingHashTable(const Type _type,
+void *hash_table_memory,
+const std::size_t hash_table_memory_size,
+const bool new_hash_table,
+const bool hash_table_memory_zeroed)
+  : FastSeparateChainingHashTable(std::vector(1, _type),
+  hash_table_memory,
+  hash_table_memory_size,
+  new_hash_table,
+  hash_table_memory_zeroed) {
+  }
+
+  ~FastSeparateChainingHashTable() override {
+DestroyValues(buckets_,
+  header_->buckets_allocated.load(std::memory_order_relaxed),
+  bucket_size_);
+std::free(init_payload_);
+  }
+
+  void clear() override;
+
+  std::size_t numEntries() const override {
+return header_->buckets_allocated.load(std::memory_order_relaxed);
+  }
+
+  const uint8_t* getSingle(const TypedValue ) const override;
+  const uint8_t* getSingleCompositeKey(const std::vector ) 
const override;
+  const uint8_t* getSingleCompositeKey(const std::vector , int 
index) const override;
+
+  void getAll(const TypedValue ,
+  std::vector *values) const override;
+  void getAllCompositeKey(const std::vector ,
+  std::vector *values) const override;
+
+ protected:
+  HashTablePutResult putInternal(const TypedValue ,
+ const std::size_t variable_key_size,
+ const uint8_t ,
+ HashTablePreallocationState *prealloc_state) 
override;
+  

[35/63] [abbrv] incubator-quickstep git commit: Removed an unused message type.

2016-09-06 Thread hbdeshmukh
Removed an unused message type.


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

Branch: refs/heads/quickstep-28-29
Commit: 6168996216af8278d5c789c67aa4ec8325fab483
Parents: 2c0ce6a
Author: Zuyu Zhang 
Authored: Mon Aug 8 15:32:34 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 9 10:44:50 2016 -0700

--
 query_execution/ForemanSingleNode.cpp|  4 +---
 query_execution/PolicyEnforcerBase.cpp   | 13 -
 query_execution/QueryExecutionMessages.proto |  5 -
 query_execution/QueryExecutionTypedefs.hpp   |  1 -
 query_execution/Shiftboss.cpp|  1 -
 query_execution/Shiftboss.hpp|  1 -
 query_execution/Worker.hpp   |  1 -
 7 files changed, 1 insertion(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/ForemanSingleNode.cpp
--
diff --git a/query_execution/ForemanSingleNode.cpp 
b/query_execution/ForemanSingleNode.cpp
index 23db379..d064a6f 100644
--- a/query_execution/ForemanSingleNode.cpp
+++ b/query_execution/ForemanSingleNode.cpp
@@ -87,7 +87,6 @@ ForemanSingleNode::ForemanSingleNode(
   kPoisonMessage,
   kRebuildWorkOrderCompleteMessage,
   kWorkOrderFeedbackMessage,
-  kWorkOrdersAvailableMessage,
   kWorkOrderCompleteMessage};
 
   for (const auto message_type : receiver_message_types) {
@@ -122,8 +121,7 @@ void ForemanSingleNode::run() {
   case kDataPipelineMessage:
   case kRebuildWorkOrderCompleteMessage:
   case kWorkOrderCompleteMessage:
-  case kWorkOrderFeedbackMessage:
-  case kWorkOrdersAvailableMessage: {
+  case kWorkOrderFeedbackMessage: {
 policy_enforcer_->processMessage(tagged_message);
 break;
   }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/PolicyEnforcerBase.cpp
--
diff --git a/query_execution/PolicyEnforcerBase.cpp 
b/query_execution/PolicyEnforcerBase.cpp
index 78f7b44..4174bd6 100644
--- a/query_execution/PolicyEnforcerBase.cpp
+++ b/query_execution/PolicyEnforcerBase.cpp
@@ -107,19 +107,6 @@ void PolicyEnforcerBase::processMessage(const 
TaggedMessage _message) {
   op_index, proto.block_id(), proto.relation_id());
   break;
 }
-case kWorkOrdersAvailableMessage: {
-  serialization::WorkOrdersAvailableMessage proto;
-  CHECK(proto.ParseFromArray(tagged_message.message(),
- tagged_message.message_bytes()));
-  query_id = proto.query_id();
-  DCHECK(admitted_queries_.find(query_id) != admitted_queries_.end());
-
-  op_index = proto.operator_index();
-
-  // Check if new work orders are available.
-  admitted_queries_[query_id]->fetchNormalWorkOrders(op_index);
-  break;
-}
 case kWorkOrderFeedbackMessage: {
   WorkOrder::FeedbackMessage msg(
   const_cast(tagged_message.message()),

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/QueryExecutionMessages.proto
--
diff --git a/query_execution/QueryExecutionMessages.proto 
b/query_execution/QueryExecutionMessages.proto
index 20b684e..060efa1 100644
--- a/query_execution/QueryExecutionMessages.proto
+++ b/query_execution/QueryExecutionMessages.proto
@@ -74,11 +74,6 @@ message DataPipelineMessage {
   required uint64 query_id = 4;
 }
 
-message WorkOrdersAvailableMessage {
-  required uint64 operator_index = 1;
-  required uint64 query_id = 2;
-}
-
 // Distributed version related messages.
 message ShiftbossRegistrationMessage {
   // The total Work Order processing capacity in Shiftboss, which equals to the

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/61689962/query_execution/QueryExecutionTypedefs.hpp
--
diff --git a/query_execution/QueryExecutionTypedefs.hpp 
b/query_execution/QueryExecutionTypedefs.hpp
index d154d84..33a93b0 100644
--- a/query_execution/QueryExecutionTypedefs.hpp
+++ b/query_execution/QueryExecutionTypedefs.hpp
@@ -69,7 +69,6 @@ enum QueryExecutionMessageType : message_type_id {
   kWorkOrderCompleteMessage,  // From Worker to Foreman.
   kCatalogRelationNewBlockMessage,  // From InsertDestination to Foreman.
   kDataPipelineMessage,  // From InsertDestination or some WorkOrders to 
Foreman.
-  

[22/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/parser/ParseSimpleTableReference.cpp
--
diff --git a/parser/ParseSimpleTableReference.cpp 
b/parser/ParseSimpleTableReference.cpp
index e56af06..518dc20 100644
--- a/parser/ParseSimpleTableReference.cpp
+++ b/parser/ParseSimpleTableReference.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "parser/ParseSimpleTableReference.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/parser/ParseSimpleTableReference.hpp
--
diff --git a/parser/ParseSimpleTableReference.hpp 
b/parser/ParseSimpleTableReference.hpp
index 5e6815e..4ff92a5 100644
--- a/parser/ParseSimpleTableReference.hpp
+++ b/parser/ParseSimpleTableReference.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_PARSER_PARSE_SIMPLE_TABLE_REFERENCE_HPP_
@@ -41,7 +43,7 @@ class ParseTreeNode;
 class ParseSimpleTableReference : public ParseTableReference {
  public:
   /**
-   * @brief Constructor. 
+   * @brief Constructor.
* @note Takes ownership of \p table_name and \p sample.
*
* @param line_number The line number of the first token of the table 
reference.
@@ -97,4 +99,4 @@ class ParseSimpleTableReference : public ParseTableReference {
 
 }  // namespace quickstep
 
-#endif /* QUICKSTEP_PARSER_PARSE_SIMPLE_TABLE_REFERENCE_HPP_ */
+#endif  // QUICKSTEP_PARSER_PARSE_SIMPLE_TABLE_REFERENCE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/parser/ParseStatement.hpp
--
diff --git a/parser/ParseStatement.hpp b/parser/ParseStatement.hpp
index 61475a9..cb5a1b5 100644
--- a/parser/ParseStatement.hpp
+++ b/parser/ParseStatement.hpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research 

[56/63] [abbrv] incubator-quickstep git commit: Fixed signed-unsigned comparison failure. Minor code cleanup.

2016-09-06 Thread hbdeshmukh
Fixed signed-unsigned comparison failure. Minor code cleanup.


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

Branch: refs/heads/quickstep-28-29
Commit: e269e031ba1cc325c588a240aed31c776ee2f22f
Parents: 2518a72
Author: rathijit 
Authored: Sun Aug 14 16:14:36 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 storage/AggregationOperationState.cpp | 36 ++
 storage/FastHashTable.hpp | 20 +
 2 files changed, 8 insertions(+), 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e269e031/storage/AggregationOperationState.cpp
--
diff --git a/storage/AggregationOperationState.cpp 
b/storage/AggregationOperationState.cpp
index 833b707..90b8fcc 100644
--- a/storage/AggregationOperationState.cpp
+++ b/storage/AggregationOperationState.cpp
@@ -94,13 +94,6 @@ AggregationOperationState::AggregationOperationState(
 handles_.emplace_back(new AggregationHandleDistinct());
 arguments_.push_back({});
 is_distinct_.emplace_back(false);
-
- /*   group_by_hashtable_pools_.emplace_back(std::unique_ptr(
-new HashTablePool(estimated_num_entries,
-  hash_table_impl_type,
-  group_by_types,
-  handles_.back().get(),
-  storage_manager)));*/
 group_by_hashtable_pools_.emplace_back(std::unique_ptr(
 new HashTablePool(estimated_num_entries,
   hash_table_impl_type,
@@ -136,19 +129,12 @@ AggregationOperationState::AggregationOperationState(
   handles_.emplace_back((*agg_func_it)->createHandle(argument_types));
 
   if (!group_by_list_.empty()) {
-// Aggregation with GROUP BY: create a HashTable pool for per-group 
states.
- /*   
group_by_hashtable_pools_.emplace_back(std::unique_ptr(
-new HashTablePool(estimated_num_entries,
-  hash_table_impl_type,
-  group_by_types,
-  handles_.back().get(),
-  storage_manager)));*/
+// Aggregation with GROUP BY: combined payload is partially updated in 
the presence of DISTINCT.
  if (*is_distinct_it) {
 handles_.back()->BlockUpdate();
  }
  group_by_handles.emplace_back(handles_.back());
  payload_sizes.emplace_back(group_by_handles.back()->getPayloadSize());
-
   } else {
 // Aggregation without GROUP BY: create a single global state.
 single_states_.emplace_back(handles_.back()->createInitialState());
@@ -183,23 +169,13 @@ AggregationOperationState::AggregationOperationState(
 // the number of entries in the distinctify hash table. We may estimate
 // for each distinct aggregation an estimated_num_distinct_keys value 
during
 // query optimization, if it worths.
- /*   distinctify_hashtables_.emplace_back(
-handles_.back()->createDistinctifyHashTable(
-*distinctify_hash_table_impl_types_it,
-key_types,
-estimated_num_entries,
-storage_manager));*/
-
-std::vector local;
-// local.emplace_back(handles_.back());
-local.clear();
 distinctify_hashtables_.emplace_back(
 AggregationStateFastHashTableFactory::CreateResizable(
 *distinctify_hash_table_impl_types_it,
 key_types,
 estimated_num_entries,
 {0},
-local,
+{},
 storage_manager));
 ++distinctify_hash_table_impl_types_it;
   } else {
@@ -455,13 +431,6 @@ void 
AggregationOperationState::aggregateBlockHashTable(const block_id input_blo
   DCHECK(group_by_hashtable_pools_[0] != nullptr);
   AggregationStateHashTableBase *agg_hash_table = 
group_by_hashtable_pools_[0]->getHashTableFast();
   DCHECK(agg_hash_table != nullptr);
- /* block->aggregateGroupBy(*handles_[agg_idx],
-  arguments_[agg_idx],
-  group_by_list_,
-  predicate_.get(),
-  agg_hash_table,
-  _matches,
-  _group_by_vectors);*/
   block->aggregateGroupByFast(arguments_,
   group_by_list_,
 

[34/63] [abbrv] incubator-quickstep git commit: Fixed bugs in creating WorkOrderProtos.

2016-09-06 Thread hbdeshmukh
Fixed bugs in creating WorkOrderProtos.


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

Branch: refs/heads/quickstep-28-29
Commit: 2c0ce6a3bcf2ec40b0c32d077552cda3e225f787
Parents: 85e02de
Author: Zuyu Zhang 
Authored: Mon Aug 8 18:42:32 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 9 10:42:25 2016 -0700

--
 relational_operators/HashJoinOperator.cpp | 1 +
 relational_operators/WorkOrderFactory.cpp | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2c0ce6a3/relational_operators/HashJoinOperator.cpp
--
diff --git a/relational_operators/HashJoinOperator.cpp 
b/relational_operators/HashJoinOperator.cpp
index 7851f41..779c0fe 100644
--- a/relational_operators/HashJoinOperator.cpp
+++ b/relational_operators/HashJoinOperator.cpp
@@ -393,6 +393,7 @@ bool 
HashJoinOperator::getAllOuterJoinWorkOrderProtos(WorkOrderProtosContainer *
 serialization::WorkOrder* 
HashJoinOperator::createOuterJoinWorkOrderProto(const block_id block) {
   serialization::WorkOrder *proto = new serialization::WorkOrder;
   proto->set_work_order_type(serialization::HASH_JOIN);
+  proto->set_query_id(query_id_);
 
   
proto->SetExtension(serialization::HashJoinWorkOrder::hash_join_work_order_type,
   serialization::HashJoinWorkOrder::HASH_OUTER_JOIN);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2c0ce6a3/relational_operators/WorkOrderFactory.cpp
--
diff --git a/relational_operators/WorkOrderFactory.cpp 
b/relational_operators/WorkOrderFactory.cpp
index 721d735..7d7af59 100644
--- a/relational_operators/WorkOrderFactory.cpp
+++ b/relational_operators/WorkOrderFactory.cpp
@@ -533,13 +533,11 @@ bool WorkOrderFactory::ProtoIsValid(const 
serialization::WorkOrder ,
 return false;
   }
 
-  const CatalogRelationSchema _relation = 
catalog_database.getRelationSchemaById(build_relation_id);
   const CatalogRelationSchema _relation = 
catalog_database.getRelationSchemaById(probe_relation_id);
   for (int i = 0; i < 
proto.ExtensionSize(serialization::HashJoinWorkOrder::join_key_attributes); 
++i) {
 const attribute_id attr_id =
 
proto.GetExtension(serialization::HashJoinWorkOrder::join_key_attributes, i);
-if (!build_relation.hasAttributeWithId(attr_id) ||
-!probe_relation.hasAttributeWithId(attr_id)) {
+if (!probe_relation.hasAttributeWithId(attr_id)) {
   return false;
 }
   }



[17/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/physical/InsertTuple.cpp
--
diff --git a/query_optimizer/physical/InsertTuple.cpp 
b/query_optimizer/physical/InsertTuple.cpp
index c49fa8a..3085389 100644
--- a/query_optimizer/physical/InsertTuple.cpp
+++ b/query_optimizer/physical/InsertTuple.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "query_optimizer/physical/InsertTuple.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/physical/InsertTuple.hpp
--
diff --git a/query_optimizer/physical/InsertTuple.hpp 
b/query_optimizer/physical/InsertTuple.hpp
index 1c1799e..40f2582 100644
--- a/query_optimizer/physical/InsertTuple.hpp
+++ b/query_optimizer/physical/InsertTuple.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_PHYSICAL_INSERT_TUPLE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/physical/Join.hpp
--
diff --git a/query_optimizer/physical/Join.hpp 
b/query_optimizer/physical/Join.hpp
index d583dbd..305aa52 100644
--- a/query_optimizer/physical/Join.hpp
+++ b/query_optimizer/physical/Join.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not 

[48/63] [abbrv] incubator-quickstep git commit: Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, some more optimizations are pending.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/storage/FastHashTableFactory.hpp
--
diff --git a/storage/FastHashTableFactory.hpp b/storage/FastHashTableFactory.hpp
new file mode 100644
index 000..6ad3212
--- /dev/null
+++ b/storage/FastHashTableFactory.hpp
@@ -0,0 +1,300 @@
+/**
+ *   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.
+ *   You may obtain a copy of the License at
+ *
+ *   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.
+ **/
+
+#ifndef QUICKSTEP_STORAGE_FAST_HASH_TABLE_FACTORY_HPP_
+#define QUICKSTEP_STORAGE_FAST_HASH_TABLE_FACTORY_HPP_
+
+#include 
+#include 
+#include 
+
+#include "storage/HashTable.hpp"
+#include "storage/FastHashTable.hpp"
+#include "storage/HashTableBase.hpp"
+#include "storage/HashTableFactory.hpp"
+#include "storage/HashTable.pb.h"
+#include "storage/LinearOpenAddressingHashTable.hpp"
+#include "storage/SeparateChainingHashTable.hpp"
+#include "storage/FastSeparateChainingHashTable.hpp"
+#include "storage/SimpleScalarSeparateChainingHashTable.hpp"
+#include "storage/TupleReference.hpp"
+#include "types/TypeFactory.hpp"
+#include "utility/BloomFilter.hpp"
+#include "utility/Macros.hpp"
+
+#include "glog/logging.h"
+
+namespace quickstep {
+
+class StorageManager;
+class Type;
+
+/** \addtogroup Storage
+ *  @{
+ */
+
+/**
+ * @brief Templated all-static factory class that makes it easier to
+ *instantiate HashTables with the particular HashTable implementation
+ *chosen at runtime. All template parameters are exactly the same as
+ *those of HashTable.
+ **/
+template 
+class FastHashTableFactory {
+ public:
+  /**
+   * @brief Create a new resizable HashTable, with the type selected by
+   *hash_table_type. Other parameters are forwarded to the HashTable's
+   *constructor.
+   *
+   * @param hash_table_type The specific HashTable implementation that should
+   *be used.
+   * @param key_types A vector of one or more types (>1 indicates a composite
+   *key). Forwarded as-is to the HashTable's constructor.
+   * @param num_entries The estimated number of entries the HashTable will
+   *hold. Forwarded as-is to the HashTable's constructor.
+   * @param storage_manager The StorageManager to use (a StorageBlob will be
+   *allocated to hold the HashTable's contents). Forwarded as-is to the
+   *HashTable's constructor.
+   * @return A new resizable HashTable.
+   **/
+  static FastHashTable*
+  CreateResizable(const HashTableImplType hash_table_type,
+  const std::vector _types,
+  const std::size_t num_entries,
+  const std::vector _sizes,
+  const std::vector ,
+  StorageManager *storage_manager) {
+DCHECK(resizable);
+
+switch (hash_table_type) {
+  case HashTableImplType::kSeparateChaining:
+return new FastSeparateChainingHashTable<
+resizable,
+serializable,
+force_key_copy,
+allow_duplicate_keys>(key_types, num_entries, payload_sizes, 
handles, storage_manager);
+  case HashTableImplType::kLinearOpenAddressing:
+/*return new LinearOpenAddressingHashTable<
+ValueT,
+resizable,
+serializable,
+force_key_copy,
+allow_duplicate_keys>(key_types, num_entries, storage_manager);*/
+return new FastSeparateChainingHashTable<
+resizable,
+serializable,
+force_key_copy,
+allow_duplicate_keys>(key_types, num_entries, payload_sizes, 
handles, storage_manager);
+  case HashTableImplType::kSimpleScalarSeparateChaining:
+return new FastSeparateChainingHashTable<
+resizable,
+serializable,
+force_key_copy,
+allow_duplicate_keys>(key_types, num_entries, payload_sizes, 
handles, storage_manager);
+/*return new SimpleScalarSeparateChainingHashTable<
+ValueT,
+resizable,
+serializable,
+force_key_copy,
+allow_duplicate_keys>(key_types, num_entries, storage_manager);*/
+  default: {
+LOG(FATAL) << "Unrecognized HashTableImplType in 
HashTableFactory::createResizable()\n";
+  }
+}
+  }
+
+  /**
+   * @brief Create a new fixed-sized HashTable, 

[07/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/tests/memory_mirror_message_bus_with_zookeeper_unittest.cc
--
diff --git 
a/third_party/tmb/tests/memory_mirror_message_bus_with_zookeeper_unittest.cc 
b/third_party/tmb/tests/memory_mirror_message_bus_with_zookeeper_unittest.cc
index 801c530..69d1327 100644
--- a/third_party/tmb/tests/memory_mirror_message_bus_with_zookeeper_unittest.cc
+++ b/third_party/tmb/tests/memory_mirror_message_bus_with_zookeeper_unittest.cc
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ **/
 
 #include "gtest/gtest.h"
 #include "tests/message_bus_unittest_common.h"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/tests/message_bus_unittest_common.h
--
diff --git a/third_party/tmb/tests/message_bus_unittest_common.h 
b/third_party/tmb/tests/message_bus_unittest_common.h
index b47f7ae..e0994da 100644
--- a/third_party/tmb/tests/message_bus_unittest_common.h
+++ b/third_party/tmb/tests/message_bus_unittest_common.h
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//   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.
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ **/
 
 #ifndef TESTS_MESSAGE_BUS_UNITTEST_COMMON_H_
 #define TESTS_MESSAGE_BUS_UNITTEST_COMMON_H_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/third_party/tmb/tests/native_logging_message_bus_async_unittest.cc
--
diff --git a/third_party/tmb/tests/native_logging_message_bus_async_unittest.cc 
b/third_party/tmb/tests/native_logging_message_bus_async_unittest.cc
index a6be8e9..62b4aeb 100644
--- a/third_party/tmb/tests/native_logging_message_bus_async_unittest.cc
+++ b/third_party/tmb/tests/native_logging_message_bus_async_unittest.cc
@@ -1,16 +1,21 @@
-//   Copyright 2014-2015 Quickstep Technologies LLC.
-//
-//   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 at
-//
-//

[40/63] [abbrv] incubator-quickstep git commit: Fix IWYU for ExecutionDAGVisualizer

2016-09-06 Thread hbdeshmukh
Fix IWYU for ExecutionDAGVisualizer


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

Branch: refs/heads/quickstep-28-29
Commit: 8ec99ed8b95a909d68de9c3f8b87d2a3b74372a6
Parents: 203d3ea
Author: Jianqiao Zhu 
Authored: Tue Aug 16 12:37:30 2016 -0500
Committer: Zuyu Zhang 
Committed: Tue Aug 16 11:17:37 2016 -0700

--
 query_execution/ForemanSingleNode.cpp  | 2 --
 query_execution/ForemanSingleNode.hpp  | 2 +-
 query_execution/PolicyEnforcerBase.hpp | 3 +--
 query_execution/QueryExecutionTypedefs.hpp | 1 +
 utility/CMakeLists.txt | 2 ++
 utility/ExecutionDAGVisualizer.cpp | 3 ++-
 6 files changed, 7 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/ForemanSingleNode.cpp
--
diff --git a/query_execution/ForemanSingleNode.cpp 
b/query_execution/ForemanSingleNode.cpp
index 7596b00..4661c37 100644
--- a/query_execution/ForemanSingleNode.cpp
+++ b/query_execution/ForemanSingleNode.cpp
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -245,7 +244,6 @@ void 
ForemanSingleNode::printWorkOrderProfilingResults(const std::size_t query_i
   policy_enforcer_->getProfilingResults(query_id);
   fputs("Query ID,Worker ID,NUMA Socket,Operator ID,Time (microseconds)\n", 
out);
   for (auto workorder_entry : recorded_times) {
-// Note: Index of the "worker thread index" in the tuple is 0.
 const std::size_t worker_id = workorder_entry.worker_id;
 fprintf(out,
 "%lu,%lu,%d,%lu,%lu\n",

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/ForemanSingleNode.hpp
--
diff --git a/query_execution/ForemanSingleNode.hpp 
b/query_execution/ForemanSingleNode.hpp
index 71ce99d..5a368aa 100644
--- a/query_execution/ForemanSingleNode.hpp
+++ b/query_execution/ForemanSingleNode.hpp
@@ -84,7 +84,7 @@ class ForemanSingleNode final : public ForemanBase {
*query.
*
* @param query_id The ID of the query for which the results are to be 
printed.
-   * @return A vector of tuples, each being a single profiling entry.
+   * @return A vector of records, each being a single profiling entry.
**/
   const std::vector& getWorkOrderProfilingResults(
   const std::size_t query_id) const;

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/PolicyEnforcerBase.hpp
--
diff --git a/query_execution/PolicyEnforcerBase.hpp 
b/query_execution/PolicyEnforcerBase.hpp
index e95799e..62906e9 100644
--- a/query_execution/PolicyEnforcerBase.hpp
+++ b/query_execution/PolicyEnforcerBase.hpp
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -126,7 +125,7 @@ class PolicyEnforcerBase {
* @param query_id The ID of the query for which the profiling results are
*requested.
*
-   * @return A vector of tuples, each being a single profiling entry.
+   * @return A vector of records, each being a single profiling entry.
**/
   inline const std::vector& getProfilingResults(
   const std::size_t query_id) const {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/query_execution/QueryExecutionTypedefs.hpp
--
diff --git a/query_execution/QueryExecutionTypedefs.hpp 
b/query_execution/QueryExecutionTypedefs.hpp
index bba67e3..22c0ae1 100644
--- a/query_execution/QueryExecutionTypedefs.hpp
+++ b/query_execution/QueryExecutionTypedefs.hpp
@@ -20,6 +20,7 @@
 #ifndef QUICKSTEP_QUERY_EXECUTION_QUERY_EXECUTION_TYPEDEFS_HPP_
 #define QUICKSTEP_QUERY_EXECUTION_QUERY_EXECUTION_TYPEDEFS_HPP_
 
+#include 
 #include 
 #include 
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/8ec99ed8/utility/CMakeLists.txt
--
diff --git a/utility/CMakeLists.txt b/utility/CMakeLists.txt
index ae1179d..ddaae45 100644
--- a/utility/CMakeLists.txt
+++ b/utility/CMakeLists.txt
@@ -238,6 +238,8 @@ 
target_link_libraries(quickstep_utility_ExecutionDAGVisualizer
   quickstep_relationaloperators_BuildHashOperator
   quickstep_relationaloperators_HashJoinOperator
   quickstep_relationaloperators_SelectOperator
+   

[50/63] [abbrv] incubator-quickstep git commit: Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, some more optimizations are pending.

2016-09-06 Thread hbdeshmukh
Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, 
some more optimizations are pending.


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

Branch: refs/heads/quickstep-28-29
Commit: 169ae326ab4b896ba68a2b157a363929aee2875d
Parents: 1d10422
Author: rathijit 
Authored: Mon Jul 4 02:44:48 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 .../aggregation/AggregationConcreteHandle.cpp   |   29 +-
 .../aggregation/AggregationConcreteHandle.hpp   |  223 ++
 expressions/aggregation/AggregationHandle.hpp   |8 +-
 .../aggregation/AggregationHandleAvg.cpp|   40 +-
 .../aggregation/AggregationHandleAvg.hpp|   62 +-
 .../aggregation/AggregationHandleCount.cpp  |   38 +-
 .../aggregation/AggregationHandleCount.hpp  |   50 +-
 .../aggregation/AggregationHandleDistinct.cpp   |2 +-
 .../aggregation/AggregationHandleDistinct.hpp   |2 +-
 .../aggregation/AggregationHandleMax.cpp|   29 +-
 .../aggregation/AggregationHandleMax.hpp|   39 +-
 .../aggregation/AggregationHandleMin.cpp|   30 +-
 .../aggregation/AggregationHandleMin.hpp|   44 +-
 .../aggregation/AggregationHandleSum.cpp|   31 +-
 .../aggregation/AggregationHandleSum.hpp|   52 +-
 expressions/aggregation/CMakeLists.txt  |7 +
 storage/AggregationOperationState.cpp   |   95 +-
 storage/AggregationOperationState.hpp   |7 +-
 storage/CMakeLists.txt  |   58 +
 storage/FastHashTable.hpp   | 2640 ++
 storage/FastHashTableFactory.hpp|  300 ++
 storage/FastSeparateChainingHashTable.hpp   | 1761 
 storage/HashTableBase.hpp   |2 +-
 storage/HashTablePool.hpp   |   42 +
 storage/StorageBlock.cpp|   88 +-
 storage/StorageBlock.hpp|8 +
 threading/SpinMutex.hpp |2 +
 27 files changed, 5587 insertions(+), 102 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/expressions/aggregation/AggregationConcreteHandle.cpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.cpp 
b/expressions/aggregation/AggregationConcreteHandle.cpp
index 719920f..1efe010 100644
--- a/expressions/aggregation/AggregationConcreteHandle.cpp
+++ b/expressions/aggregation/AggregationConcreteHandle.cpp
@@ -24,6 +24,7 @@
 
 #include "catalog/CatalogTypedefs.hpp"
 #include "storage/HashTable.hpp"
+#include "storage/FastHashTable.hpp"
 #include "storage/HashTableFactory.hpp"
 
 namespace quickstep {
@@ -51,22 +52,24 @@ void 
AggregationConcreteHandle::insertValueAccessorIntoDistinctifyHashTable(
 AggregationStateHashTableBase *distinctify_hash_table) const {
   // If the key-value pair is already there, we don't need to update the value,
   // which should always be "true". I.e. the value is just a placeholder.
-  const auto noop_upserter = [](const auto , const bool *value) -> 
void {};
+//  const auto noop_upserter = [](const auto , const bool *value) -> 
void {};
 
-  AggregationStateHashTable *hash_table =
-  static_cast(distinctify_hash_table);
+  AggregationStateFastHashTable *hash_table =
+  static_cast(distinctify_hash_table);
   if (key_ids.size() == 1) {
-hash_table->upsertValueAccessor(accessor,
-key_ids[0],
-true /* check_for_null_keys */,
-true /* initial_value */,
-_upserter);
+// TODO(rathijit): fix
+//hash_table->upsertValueAccessor(accessor,
+//key_ids[0],
+//true /* check_for_null_keys */,
+//true /* initial_value */,
+//_upserter);
   } else {
-hash_table->upsertValueAccessorCompositeKey(accessor,
-key_ids,
-true /* check_for_null_keys */,
-true /* initial_value */,
-_upserter);
+std::vector empty_args;
+empty_args.resize(1);
+

[57/63] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/storage/HashTableBase.hpp
--
diff --git a/storage/HashTableBase.hpp b/storage/HashTableBase.hpp
index 5526164..b908d6f 100644
--- a/storage/HashTableBase.hpp
+++ b/storage/HashTableBase.hpp
@@ -23,8 +23,8 @@
 #include 
 #include 
 
-#include "utility/Macros.hpp"
 #include "ValueAccessor.hpp"
+#include "utility/Macros.hpp"
 
 namespace quickstep {
 
@@ -57,11 +57,7 @@ struct HashTablePreallocationState {
  * @brief Codes which indicate the result of a call to put() or
  *putCompositeKey().
  **/
-enum class HashTablePutResult {
-  kOK = 0,
-  kDuplicateKey,
-  kOutOfSpace
-};
+enum class HashTablePutResult { kOK = 0, kDuplicateKey, kOutOfSpace };
 
 /**
  * @brief An ultra-minimal base class that HashTables with different ValueT
@@ -76,17 +72,19 @@ template 
 class HashTableBase {
  public:
-  virtual ~HashTableBase() {
-  }
+  virtual ~HashTableBase() {}
+
   virtual bool upsertValueAccessorCompositeKeyFast(
   const std::vector ,
   ValueAccessor *accessor,
   const std::vector _attr_ids,
-  const bool check_for_null_keys) {return false;}
- protected:
-  HashTableBase() {
+  const bool check_for_null_keys) {
+return false;
   }
 
+ protected:
+  HashTableBase() {}
+
  private:
   DISALLOW_COPY_AND_ASSIGN(HashTableBase);
 };



[21/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_execution/PolicyEnforcerSingleNode.hpp
--
diff --git a/query_execution/PolicyEnforcerSingleNode.hpp 
b/query_execution/PolicyEnforcerSingleNode.hpp
index 671fd83..870df95 100644
--- a/query_execution/PolicyEnforcerSingleNode.hpp
+++ b/query_execution/PolicyEnforcerSingleNode.hpp
@@ -1,15 +1,20 @@
 /**
- *   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 at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
+ *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_EXECUTION_POLICY_ENFORCER_SINGLE_NODE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_execution/QueryContext.cpp
--
diff --git a/query_execution/QueryContext.cpp b/query_execution/QueryContext.cpp
index 7019b6a..2572e18 100644
--- a/query_execution/QueryContext.cpp
+++ b/query_execution/QueryContext.cpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "query_execution/QueryContext.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_execution/QueryContext.hpp
--
diff --git a/query_execution/QueryContext.hpp b/query_execution/QueryContext.hpp
index 9171250..c54c7ff 100644
--- a/query_execution/QueryContext.hpp
+++ b/query_execution/QueryContext.hpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may 

[05/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/IntervalParser.hpp
--
diff --git a/types/IntervalParser.hpp b/types/IntervalParser.hpp
index 0b9d499..bafd6e1 100644
--- a/types/IntervalParser.hpp
+++ b/types/IntervalParser.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_TYPES_INTERVAL_PARSER_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/LongType.cpp
--
diff --git a/types/LongType.cpp b/types/LongType.cpp
index feedb9d..fbf8d30 100644
--- a/types/LongType.cpp
+++ b/types/LongType.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef __STDC_FORMAT_MACROS

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/LongType.hpp
--
diff --git a/types/LongType.hpp b/types/LongType.hpp
index 0721035..a90dd32 100644
--- a/types/LongType.hpp
+++ b/types/LongType.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under 

[61/63] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/expressions/aggregation/tests/AggregationHandleMax_unittest.cpp
--
diff --git a/expressions/aggregation/tests/AggregationHandleMax_unittest.cpp 
b/expressions/aggregation/tests/AggregationHandleMax_unittest.cpp
index b7cf02a..31511d6 100644
--- a/expressions/aggregation/tests/AggregationHandleMax_unittest.cpp
+++ b/expressions/aggregation/tests/AggregationHandleMax_unittest.cpp
@@ -31,6 +31,8 @@
 #include "expressions/aggregation/AggregationHandle.hpp"
 #include "expressions/aggregation/AggregationHandleMax.hpp"
 #include "expressions/aggregation/AggregationID.hpp"
+#include "storage/AggregationOperationState.hpp"
+#include "storage/FastHashTableFactory.hpp"
 #include "storage/HashTableBase.hpp"
 #include "storage/StorageManager.hpp"
 #include "types/CharType.hpp"
@@ -70,54 +72,59 @@ class AggregationHandleMaxTest : public ::testing::Test {
   // Helper method that calls AggregationHandleMax::iterateUnaryInl() to
   // aggregate 'value' into '*state'.
   void iterateHandle(AggregationState *state, const TypedValue ) {
-static_cast(*aggregation_handle_max_).iterateUnaryInl(
-static_cast(state),
-value);
+static_cast(*aggregation_handle_max_)
+.iterateUnaryInl(static_cast(state), value);
   }
 
   void initializeHandle(const Type ) {
 aggregation_handle_max_.reset(
-AggregateFunctionFactory::Get(AggregationID::kMax).createHandle(
-std::vector(1, )));
+AggregateFunctionFactory::Get(AggregationID::kMax)
+.createHandle(std::vector(1, )));
 aggregation_handle_max_state_.reset(
 aggregation_handle_max_->createInitialState());
   }
 
   static bool ApplyToTypesTest(TypeID typeID) {
-const Type  = (typeID == kChar || typeID == kVarChar) ?
-TypeFactory::GetType(typeID, static_cast(10)) :
-TypeFactory::GetType(typeID);
+const Type  =
+(typeID == kChar || typeID == kVarChar)
+? TypeFactory::GetType(typeID, static_cast(10))
+: TypeFactory::GetType(typeID);
 
-return AggregateFunctionFactory::Get(AggregationID::kMax).canApplyToTypes(
-std::vector(1, ));
+return AggregateFunctionFactory::Get(AggregationID::kMax)
+.canApplyToTypes(std::vector(1, ));
   }
 
   static bool ResultTypeForArgumentTypeTest(TypeID input_type_id,
 TypeID output_type_id) {
-const Type *result_type
-= 
AggregateFunctionFactory::Get(AggregationID::kMax).resultTypeForArgumentTypes(
-std::vector(1, ::GetType(input_type_id)));
+const Type *result_type =
+AggregateFunctionFactory::Get(AggregationID::kMax)
+.resultTypeForArgumentTypes(std::vector(
+1, ::GetType(input_type_id)));
 return (result_type->getTypeID() == output_type_id);
   }
 
   template 
-  static void CheckMaxValue(
-  CppType expected,
-  const AggregationHandle ,
-  const AggregationState ) {
+  static void CheckMaxValue(CppType expected,
+const AggregationHandle ,
+const AggregationState ) {
 EXPECT_EQ(expected, handle.finalize(state).getLiteral());
   }
 
-  static void CheckMaxString(
-  const std::string ,
-  const AggregationHandle ,
-  const AggregationState ) {
+  template 
+  static void CheckMaxValue(CppType expected, const TypedValue ) {
+EXPECT_EQ(expected, value.getLiteral());
+  }
+
+  static void CheckMaxString(const std::string ,
+ const AggregationHandle ,
+ const AggregationState ) {
 TypedValue value = handle.finalize(state);
 
 ASSERT_EQ(expected.length(), value.getAsciiStringLength());
-EXPECT_EQ(0, std::strncmp(expected.c_str(),
-  static_cast(value.getDataPtr()),
-  value.getAsciiStringLength()));
+EXPECT_EQ(0,
+  std::strncmp(expected.c_str(),
+   static_cast(value.getDataPtr()),
+   value.getAsciiStringLength()));
   }
 
   // Static templated method to initialize data types.
@@ -130,7 +137,9 @@ class AggregationHandleMaxTest : public ::testing::Test {
   void checkAggregationMaxGeneric() {
 const GenericType  = GenericType::Instance(true);
 initializeHandle(type);
-
EXPECT_TRUE(aggregation_handle_max_->finalize(*aggregation_handle_max_state_).isNull());
+EXPECT_TRUE(
+aggregation_handle_max_->finalize(*aggregation_handle_max_state_)
+.isNull());
 
 typename GenericType::cpptype val;
 typename GenericType::cpptype max;
@@ -142,16 +151,18 @@ class AggregationHandleMaxTest : public ::testing::Test {
 if (type.getTypeID() == kInt || type.getTypeID() == kLong) {
   SetDataType(i * kNumSamples + j - 10, 

[38/63] [abbrv] incubator-quickstep git commit: Minor fixes for the distributed version.

2016-09-06 Thread hbdeshmukh
Minor fixes for the distributed version.


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

Branch: refs/heads/quickstep-28-29
Commit: 1325a6ae2c909fbadb4b0661478f42a5e6687932
Parents: 6ee9842
Author: Zuyu Zhang 
Authored: Sat Aug 13 23:22:41 2016 -0700
Committer: Zuyu Zhang 
Committed: Sat Aug 13 23:22:41 2016 -0700

--
 query_execution/CMakeLists.txt  | 16 +++---
 query_execution/PolicyEnforcerDistributed.cpp   | 10 -
 query_execution/PolicyEnforcerDistributed.hpp   |  6 +++---
 query_execution/QueryExecutionTypedefs.hpp  |  4 ++--
 query_execution/Shiftboss.cpp   | 20 +++---
 query_execution/Shiftboss.hpp   | 22 +---
 .../tests/execution_generator/CMakeLists.txt|  2 +-
 7 files changed, 51 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/1325a6ae/query_execution/CMakeLists.txt
--
diff --git a/query_execution/CMakeLists.txt b/query_execution/CMakeLists.txt
index 74fcafb..4033594 100644
--- a/query_execution/CMakeLists.txt
+++ b/query_execution/CMakeLists.txt
@@ -31,7 +31,7 @@ endif()
 add_library(quickstep_queryexecution_AdmitRequestMessage ../empty_src.cpp 
AdmitRequestMessage.hpp)
 if (ENABLE_DISTRIBUTED)
   add_library(quickstep_queryexecution_BlockLocator BlockLocator.cpp 
BlockLocator.hpp)
-endif()
+endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_ForemanBase ../empty_src.cpp 
ForemanBase.hpp)
 add_library(quickstep_queryexecution_ForemanSingleNode ForemanSingleNode.cpp 
ForemanSingleNode.hpp)
 add_library(quickstep_queryexecution_PolicyEnforcerBase PolicyEnforcerBase.cpp 
PolicyEnforcerBase.hpp)
@@ -52,12 +52,12 @@ add_library(quickstep_queryexecution_QueryExecutionUtil 
../empty_src.cpp QueryEx
 add_library(quickstep_queryexecution_QueryManagerBase QueryManagerBase.cpp 
QueryManagerBase.hpp)
 if (ENABLE_DISTRIBUTED)
   add_library(quickstep_queryexecution_QueryManagerDistributed 
QueryManagerDistributed.cpp QueryManagerDistributed.hpp)
-endif()
+endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_QueryManagerSingleNode 
QueryManagerSingleNode.cpp QueryManagerSingleNode.hpp)
 if (ENABLE_DISTRIBUTED)
   add_library(quickstep_queryexecution_Shiftboss Shiftboss.cpp Shiftboss.hpp)
   add_library(quickstep_queryexecution_ShiftbossDirectory ../empty_src.cpp 
ShiftbossDirectory.hpp)
-endif()
+endif(ENABLE_DISTRIBUTED)
 add_library(quickstep_queryexecution_WorkOrderProtosContainer ../empty_src.cpp 
WorkOrderProtosContainer.hpp)
 add_library(quickstep_queryexecution_WorkOrdersContainer 
WorkOrdersContainer.cpp WorkOrdersContainer.hpp)
 add_library(quickstep_queryexecution_Worker Worker.cpp Worker.hpp)
@@ -80,7 +80,7 @@ if (ENABLE_DISTRIBUTED)
 quickstep_threading_ThreadUtil
 quickstep_utility_Macros
 tmb)
-endif()
+endif(ENABLE_DISTRIBUTED)
 target_link_libraries(quickstep_queryexecution_ForemanBase
   glog
   quickstep_threading_Thread
@@ -223,7 +223,7 @@ if (ENABLE_DISTRIBUTED)
 quickstep_utility_DAG
 quickstep_utility_Macros
 tmb)
-endif()
+endif(ENABLE_DISTRIBUTED)
 target_link_libraries(quickstep_queryexecution_QueryManagerSingleNode
   quickstep_catalog_CatalogTypedefs
   quickstep_queryexecution_QueryContext
@@ -262,7 +262,7 @@ if (ENABLE_DISTRIBUTED)
   target_link_libraries(quickstep_queryexecution_ShiftbossDirectory
 quickstep_utility_Macros
 tmb)
-endif()
+endif(ENABLE_DISTRIBUTED)
 target_link_libraries(quickstep_queryexecution_WorkOrderProtosContainer
   glog
   quickstep_relationaloperators_WorkOrder_proto
@@ -320,7 +320,7 @@ if (ENABLE_DISTRIBUTED)
 quickstep_queryexecution_QueryManagerDistributed
 quickstep_queryexecution_Shiftboss
 quickstep_queryexecution_ShiftbossDirectory)
-endif()
+endif(ENABLE_DISTRIBUTED)
 
 # Tests:
 if (ENABLE_DISTRIBUTED)
@@ -346,7 +346,7 @@ if (ENABLE_DISTRIBUTED)
 tmb
 ${LIBS})
   add_test(BlockLocator_unittest BlockLocator_unittest)
-endif()
+endif(ENABLE_DISTRIBUTED)
 
 add_executable(QueryManagerSingleNode_unittest
   

[23/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/window_aggregation/WindowAggregationHandle.cpp
--
diff --git a/expressions/window_aggregation/WindowAggregationHandle.cpp 
b/expressions/window_aggregation/WindowAggregationHandle.cpp
index 835eaff..f26656d 100644
--- a/expressions/window_aggregation/WindowAggregationHandle.cpp
+++ b/expressions/window_aggregation/WindowAggregationHandle.cpp
@@ -1,20 +1,20 @@
 /**
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you 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 at
- * 
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
  **/
 
 #include "expressions/window_aggregation/WindowAggregationHandle.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/window_aggregation/WindowAggregationHandle.hpp
--
diff --git a/expressions/window_aggregation/WindowAggregationHandle.hpp 
b/expressions/window_aggregation/WindowAggregationHandle.hpp
index 41d1d96..3569123 100644
--- a/expressions/window_aggregation/WindowAggregationHandle.hpp
+++ b/expressions/window_aggregation/WindowAggregationHandle.hpp
@@ -1,20 +1,20 @@
 /**
- *   Licensed to the Apache Software Foundation (ASF) under one
- *   or more contributor license agreements.  See the NOTICE file
- *   distributed with this work for additional information
- *   regarding copyright ownership.  The ASF licenses this file
- *   to you 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 at
- * 
- * 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.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
  **/
 
 #ifndef QUICKSTEP_EXPRESSIONS_WINDOW_AGGREGATION_WINDOW_AGGREGATION_HANDLE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
--
diff --git a/expressions/window_aggregation/WindowAggregationHandleAvg.cpp 
b/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
index e6a4b3f..b1c6e3b 100644
--- a/expressions/window_aggregation/WindowAggregationHandleAvg.cpp
+++ 

[27/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/README.md
--
diff --git a/README.md b/README.md
index bf9ed8d..af17264 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
 ## What is Quickstep?
 Apache Quickstep is high-performance database engine designed to exploit the 
full potential of hardware that is packed in modern computing boxes (servers 
and laptops). The initial version (available now!) targets single-node 
in-memory environments. If your data spills overs the memory limit Quickstep 
will still work, so you don't have to obsessively worry about the in-memory 
part. Also, if your working set fits in memory then Quickstep will 
transparently and automatically figure that out, and cache that hot set to  
deliver in-memory performance.
 
-Distributed execution is the next big feature for Quickstep.  
+Distributed execution is the next big feature for Quickstep.
 
 Quickstep began life in 2011 as a
 [research project at the University of 
Wisconsin](https://www.cs.wisc.edu/~jignesh)
@@ -39,13 +39,13 @@ And, it is **open source!**
 3. Initialize the dependencies: ```git submodule init```
 4. Checkout the dependencies: ```git submodule update```
 5. Go into the build directory: ```cd build```
-6. Create the Makefile: ```cmake -D CMAKE_BUILD_TYPE=Release ..```  
-7. Build: ```make -j4```. Note you may replace the 4 with the number of cores 
+6. Create the Makefile: ```cmake -D CMAKE_BUILD_TYPE=Release ..```
+7. Build: ```make -j4```. Note you may replace the 4 with the number of cores
on your machine.
-8. Start quickstep: ```./quickstep_cli_shell --initialize_db=true```. You can 
-   now fire SQL queries. To quit, you can type in ```quit;``` Your data is 
+8. Start quickstep: ```./quickstep_cli_shell --initialize_db=true```. You can
+   now fire SQL queries. To quit, you can type in ```quit;``` Your data is
stored in the directory ```qsstor```. Note the next time you start 
Quickstep,
-   you can omit the ``` --initialize_db``` flag (as the database has already 
+   you can omit the ``` --initialize_db``` flag (as the database has already
been initialized), and simply start Quickstep as: 
```./quickstep_cli_shell```.
There are also a number of optional flags that you can specify, and to see
the full list, you can type in: ```./quickstep_cli_shell --help```
@@ -87,21 +87,21 @@ CREATE TABLE City (cid Integer, name VARCHAR(80), state 
CHAR(2));
   SELECT cid, MIN(lowTemperature), MAX(highTemperature) FROM Weather GROUP BY 
cid;
   ```
 
-  c. Find the min and max temperature for each city using a nested query, and 
+  c. Find the min and max temperature for each city using a nested query, and
  printing thie city name:
   ```
   SELECT * FROM City C, (SELECT cid, MIN(lowTemperature), MAX(highTemperature) 
FROM Weather GROUP BY cid) AS T WHERE C.cid = T.cid;
   ```
 
 12. Quickstep also supports a COPY TABLE command. If you want to try that, then
-from a separate shell file type in the following: 
+from a separate shell file type in the following:
 
 ```
 echo "3|2015-11-3|49|29" > /tmp/tmp.tbl
 echo "3|2015-11-4|48|28" >> /tmp/tmp.tbl
 echo "3|2015-11-5|47|27" >> /tmp/tmp.tbl
 ```
-   
+
 Then, load this new data by typing the following SQL in the Quickstep 
shell:
 
 ```

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/WORKING_WITH_AN_IDE.md
--
diff --git a/WORKING_WITH_AN_IDE.md b/WORKING_WITH_AN_IDE.md
index f9139ab..017a174 100644
--- a/WORKING_WITH_AN_IDE.md
+++ b/WORKING_WITH_AN_IDE.md
@@ -37,7 +37,7 @@ ruby -e "$(curl -fsSL 
https://raw.githubusercontent.com/Homebrew/install/master/
 ```
 
 Once you have brew installed, simply use brew to install cmake from the
-Terminal app by typing: 
+Terminal app by typing:
 
 ```
 brew install cmake
@@ -90,13 +90,13 @@ cp -R ../qsstor .
 ```
 
 The above command ensures that you now have the appropriate directory structure
-and a starting catalog file to start Quickstep. The default database is called 
-simply "default" and no relations in it upfront. 
+and a starting catalog file to start Quickstep. The default database is called
+simply "default" and no relations in it upfront.
 
 There are other ways of specifying where Quickstep stores the data and catalog.
 In particular there is a  `-storage_path` option that could be an alternative
 way of specifying the storage path and avoiding the copy above. You can find
-these and other command line options by typing: 
+these and other command line options by typing:
 
 ```
 ./quickstep_cli_shell -help
@@ -104,15 +104,15 @@ these and other command line options by typing:
 
 
 ###4: Debug Quickstep
-Now you can debug as you would any normal process in Xcode. Note the 
+Now you can debug as you would any normal process in Xcode. Note the
 linenoise option in the cmake 

[15/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
--
diff --git a/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp 
b/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
index d1d9380..b8cd02a 100644
--- a/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
+++ b/query_optimizer/tests/ExecutionGeneratorTestRunner.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_TESTS_EXECUTION_GENERATOR_TEST_RUNNER_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
--
diff --git a/query_optimizer/tests/ExecutionHeuristics_unittest.cpp 
b/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
index 815c13e..73b3e84 100644
--- a/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
+++ b/query_optimizer/tests/ExecutionHeuristics_unittest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/tests/OptimizerTest.cpp
--
diff --git a/query_optimizer/tests/OptimizerTest.cpp 
b/query_optimizer/tests/OptimizerTest.cpp
index 57e2d67..a93db3e 100644
--- a/query_optimizer/tests/OptimizerTest.cpp
+++ b/query_optimizer/tests/OptimizerTest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file 

[24/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/predicate/TrivialPredicates.hpp
--
diff --git a/expressions/predicate/TrivialPredicates.hpp 
b/expressions/predicate/TrivialPredicates.hpp
index 273c0a4..4e44976 100644
--- a/expressions/predicate/TrivialPredicates.hpp
+++ b/expressions/predicate/TrivialPredicates.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_EXPRESSIONS_PREDICATE_TRIVIAL_PREDICATES_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/predicate/tests/Predicate_unittest.cpp
--
diff --git a/expressions/predicate/tests/Predicate_unittest.cpp 
b/expressions/predicate/tests/Predicate_unittest.cpp
index 54c4bb2..3c2889d 100644
--- a/expressions/predicate/tests/Predicate_unittest.cpp
+++ b/expressions/predicate/tests/Predicate_unittest.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/scalar/CMakeLists.txt
--
diff --git a/expressions/scalar/CMakeLists.txt 
b/expressions/scalar/CMakeLists.txt
index 3c8ace1..8f509da 100644
--- a/expressions/scalar/CMakeLists.txt
+++ b/expressions/scalar/CMakeLists.txt
@@ -1,17 +1,19 @@
-#   Copyright 2011-2015 Quickstep Technologies LLC.
-#   Copyright 2015 Pivotal Software, Inc.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you 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 at
 #
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you 

[25/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/aggregation/AggregateFunctionFactory.cpp
--
diff --git a/expressions/aggregation/AggregateFunctionFactory.cpp 
b/expressions/aggregation/AggregateFunctionFactory.cpp
index f973cc3..faedac3 100644
--- a/expressions/aggregation/AggregateFunctionFactory.cpp
+++ b/expressions/aggregation/AggregateFunctionFactory.cpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "expressions/aggregation/AggregateFunctionFactory.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/aggregation/AggregateFunctionFactory.hpp
--
diff --git a/expressions/aggregation/AggregateFunctionFactory.hpp 
b/expressions/aggregation/AggregateFunctionFactory.hpp
index 0553542..89d3540 100644
--- a/expressions/aggregation/AggregateFunctionFactory.hpp
+++ b/expressions/aggregation/AggregateFunctionFactory.hpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATE_FUNCTION_FACTORY_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/expressions/aggregation/AggregateFunctionMax.cpp
--
diff --git a/expressions/aggregation/AggregateFunctionMax.cpp 
b/expressions/aggregation/AggregateFunctionMax.cpp
index 7d3290a..cc04bf4 100644
--- a/expressions/aggregation/AggregateFunctionMax.cpp
+++ b/expressions/aggregation/AggregateFunctionMax.cpp
@@ -1,17 +1,20 @@
 /**
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   Licensed under the Apache 

[58/63] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/storage/FastSeparateChainingHashTable.hpp
--
diff --git a/storage/FastSeparateChainingHashTable.hpp 
b/storage/FastSeparateChainingHashTable.hpp
index 0670993..886a8ca 100644
--- a/storage/FastSeparateChainingHashTable.hpp
+++ b/storage/FastSeparateChainingHashTable.hpp
@@ -27,8 +27,8 @@
 #include 
 #include 
 
-#include "storage/HashTable.hpp"
 #include "storage/FastHashTable.hpp"
+#include "storage/HashTable.hpp"
 #include "storage/HashTableBase.hpp"
 #include "storage/HashTableKeyManager.hpp"
 #include "storage/StorageBlob.hpp"
@@ -55,43 +55,42 @@ template 
-class FastSeparateChainingHashTable : public FastHashTable {
+class FastSeparateChainingHashTable
+: public FastHashTable {
  public:
-  FastSeparateChainingHashTable(const std::vector _types,
-const std::size_t num_entries,
-const std::vector _sizes,
-const std::vector ,
-StorageManager *storage_manager);
-
-  FastSeparateChainingHashTable(const std::vector _types,
-void *hash_table_memory,
-const std::size_t hash_table_memory_size,
-const bool new_hash_table,
-const bool hash_table_memory_zeroed);
+  FastSeparateChainingHashTable(const std::vector _types,
+const std::size_t num_entries,
+const std::vector _sizes,
+const std::vector 
,
+StorageManager *storage_manager);
+
+  FastSeparateChainingHashTable(const std::vector _types,
+void *hash_table_memory,
+const std::size_t hash_table_memory_size,
+const bool new_hash_table,
+const bool hash_table_memory_zeroed);
 
   // Delegating constructors for single scalar keys.
   FastSeparateChainingHashTable(const Type _type,
-const std::size_t num_entries,
-StorageManager *storage_manager)
-  : FastSeparateChainingHashTable(std::vector(1, _type),
-  num_entries,
-  storage_manager) {
-  }
+const std::size_t num_entries,
+StorageManager *storage_manager)
+  : FastSeparateChainingHashTable(std::vector(1, _type),
+  num_entries,
+  storage_manager) {}
 
   FastSeparateChainingHashTable(const Type _type,
-void *hash_table_memory,
-const std::size_t hash_table_memory_size,
-const bool new_hash_table,
-const bool hash_table_memory_zeroed)
-  : FastSeparateChainingHashTable(std::vector(1, _type),
-  hash_table_memory,
-  hash_table_memory_size,
-  new_hash_table,
-  hash_table_memory_zeroed) {
-  }
+void *hash_table_memory,
+const std::size_t hash_table_memory_size,
+const bool new_hash_table,
+const bool hash_table_memory_zeroed)
+  : FastSeparateChainingHashTable(std::vector(1, _type),
+  hash_table_memory,
+  hash_table_memory_size,
+  new_hash_table,
+  hash_table_memory_zeroed) {}
 
   ~FastSeparateChainingHashTable() override {
 DestroyValues(buckets_,
@@ -106,48 +105,54 @@ class FastSeparateChainingHashTable : public 
FastHashTablebuckets_allocated.load(std::memory_order_relaxed);
   }
 
-  const uint8_t* getSingle(const TypedValue ) const override;
-  const uint8_t* getSingleCompositeKey(const std::vector ) 
const override;
-  const uint8_t* getSingleCompositeKey(const std::vector , int 
index) const override;
+  const std::uint8_t* getSingle(const TypedValue ) const override;
+  const std::uint8_t* getSingleCompositeKey(
+  const std::vector ) const override;
+  const std::uint8_t* getSingleCompositeKey(const std::vector 

[51/63] [abbrv] incubator-quickstep git commit: reinterpreted byte to SpinMutex before locking. This removes the need to have an additional function accepting a pointer in the SpinMutex class

2016-09-06 Thread hbdeshmukh
reinterpreted byte to SpinMutex before locking. This removes the need to have 
an additional function accepting a pointer in the SpinMutex class


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

Branch: refs/heads/quickstep-28-29
Commit: 3c4e2ab038c7ffea35030502419764c7f21ba616
Parents: e269e03
Author: rathijit 
Authored: Sun Aug 14 19:54:50 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 storage/FastHashTable.hpp | 12 ++--
 threading/SpinMutex.hpp   |  2 --
 2 files changed, 6 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/3c4e2ab0/storage/FastHashTable.hpp
--
diff --git a/storage/FastHashTable.hpp b/storage/FastHashTable.hpp
index 8d8d82b..c659a20 100644
--- a/storage/FastHashTable.hpp
+++ b/storage/FastHashTable.hpp
@@ -1900,7 +1900,7 @@ bool FastHashTablemergeStatesFast(source_state + 
payload_offsets_[k], value + payload_offsets_[k]);
 }
@@ -1914,7 +1914,7 @@ bool FastHashTablemergeStatesFast(source_state + payload_offsets_[k], 
value + payload_offsets_[k]);
   }
@@ -2017,7 +2017,7 @@ bool FastHashTable

[63/63] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
Modified Aggregation unit test. Ran clang-format.


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

Branch: refs/heads/quickstep-28-29
Commit: 63a65249150145f01bf47b34b57e30807aa2e4a0
Parents: a0eedcb
Author: rathijit 
Authored: Sun Aug 21 05:33:40 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:40:00 2016 -0500

--
 .../aggregation/AggregationConcreteHandle.hpp   |  153 +-
 expressions/aggregation/AggregationHandle.hpp   |   48 +-
 .../aggregation/AggregationHandleAvg.cpp|   96 +-
 .../aggregation/AggregationHandleAvg.hpp|  130 +-
 .../aggregation/AggregationHandleCount.cpp  |  150 +-
 .../aggregation/AggregationHandleCount.hpp  |  118 +-
 .../aggregation/AggregationHandleDistinct.hpp   |   28 +-
 .../aggregation/AggregationHandleMax.cpp|   71 +-
 .../aggregation/AggregationHandleMax.hpp|   98 +-
 .../aggregation/AggregationHandleMin.cpp|   73 +-
 .../aggregation/AggregationHandleMin.hpp|  101 +-
 .../aggregation/AggregationHandleSum.cpp|   87 +-
 .../aggregation/AggregationHandleSum.hpp|  113 +-
 expressions/aggregation/CMakeLists.txt  |   85 +-
 .../tests/AggregationHandleAvg_unittest.cpp |  255 ++--
 .../tests/AggregationHandleCount_unittest.cpp   |  311 ++--
 .../tests/AggregationHandleMax_unittest.cpp |  382 +++--
 .../tests/AggregationHandleMin_unittest.cpp |  378 +++--
 .../tests/AggregationHandleSum_unittest.cpp |  291 ++--
 storage/AggregationOperationState.cpp   |  263 ++--
 storage/AggregationOperationState.hpp   |   42 +-
 storage/FastHashTable.hpp   | 1419 ++
 storage/FastSeparateChainingHashTable.hpp   | 1171 +--
 storage/HashTableBase.hpp   |   20 +-
 24 files changed, 3268 insertions(+), 2615 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/expressions/aggregation/AggregationConcreteHandle.hpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.hpp 
b/expressions/aggregation/AggregationConcreteHandle.hpp
index 5b47e93..ac37bae 100644
--- a/expressions/aggregation/AggregationConcreteHandle.hpp
+++ b/expressions/aggregation/AggregationConcreteHandle.hpp
@@ -21,18 +21,18 @@
 #define QUICKSTEP_EXPRESSIONS_AGGREGATION_AGGREGATION_CONCRETE_HANDLE_HPP_
 
 #include 
-#include 
 #include 
+#include 
 
 #include "catalog/CatalogTypedefs.hpp"
 #include "expressions/aggregation/AggregationHandle.hpp"
-#include "storage/HashTable.hpp"
 #include "storage/FastHashTable.hpp"
+#include "storage/HashTable.hpp"
 #include "storage/HashTableBase.hpp"
+#include "threading/SpinMutex.hpp"
 #include "types/TypedValue.hpp"
 #include "types/containers/ColumnVector.hpp"
 #include "utility/Macros.hpp"
-#include "threading/SpinMutex.hpp"
 
 #include "glog/logging.h"
 
@@ -61,7 +61,8 @@ class HashTableStateUpserterFast {
*table. The corresponding state (for the same key) in the 
destination
*hash table will be upserted.
**/
-  HashTableStateUpserterFast(const HandleT , const uint8_t 
*source_state)
+  HashTableStateUpserterFast(const HandleT ,
+ const std::uint8_t *source_state)
   : handle_(handle), source_state_(source_state) {}
 
   /**
@@ -70,13 +71,13 @@ class HashTableStateUpserterFast {
* @param destination_state The aggregation state in the aggregation hash
*table that is being upserted.
**/
-  void operator()(uint8_t *destination_state) {
+  void operator()(std::uint8_t *destination_state) {
 handle_.mergeStatesFast(source_state_, destination_state);
   }
 
  private:
   const HandleT _;
-  const uint8_t *source_state_;
+  const std::uint8_t *source_state_;
 
   DISALLOW_COPY_AND_ASSIGN(HashTableStateUpserterFast);
 };
@@ -108,13 +109,15 @@ class AggregationConcreteHandle : public 
AggregationHandle {
*/
   AggregationStateHashTableBase* createDistinctifyHashTable(
   const HashTableImplType hash_table_impl,
-  const std::vector _types,
+  const std::vector _types,
   const std::size_t estimated_num_distinct_keys,
   StorageManager *storage_manager) const override;
 
   /**
-   * @brief Implementaion for 
AggregationHandle::insertValueAccessorIntoDistinctifyHashTable()
-   *that inserts the GROUP BY expressions and aggregation arguments 
together
+   * @brief Implementaion for
+   * 

[18/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/logical/Logical.hpp
--
diff --git a/query_optimizer/logical/Logical.hpp 
b/query_optimizer/logical/Logical.hpp
index a1e9155..6396f15 100644
--- a/query_optimizer/logical/Logical.hpp
+++ b/query_optimizer/logical/Logical.hpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_LOGICAL_LOGICAL_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/logical/LogicalType.hpp
--
diff --git a/query_optimizer/logical/LogicalType.hpp 
b/query_optimizer/logical/LogicalType.hpp
index c82fb47..d1011b0 100644
--- a/query_optimizer/logical/LogicalType.hpp
+++ b/query_optimizer/logical/LogicalType.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_QUERY_OPTIMIZER_LOGICAL_LOGICAL_TYPE_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/query_optimizer/logical/MultiwayCartesianJoin.cpp
--
diff --git a/query_optimizer/logical/MultiwayCartesianJoin.cpp 
b/query_optimizer/logical/MultiwayCartesianJoin.cpp
index e672f7f..60a0e22 100644
--- a/query_optimizer/logical/MultiwayCartesianJoin.cpp
+++ b/query_optimizer/logical/MultiwayCartesianJoin.cpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file 

[13/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/relational_operators/TableGeneratorOperator.hpp
--
diff --git a/relational_operators/TableGeneratorOperator.hpp 
b/relational_operators/TableGeneratorOperator.hpp
index ad3a9ff..7639966 100644
--- a/relational_operators/TableGeneratorOperator.hpp
+++ b/relational_operators/TableGeneratorOperator.hpp
@@ -1,19 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
- *   Copyright 2016 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_RELATIONAL_OPERATORS_TABLE_GENERATOR_OPERATOR_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/relational_operators/TextScanOperator.cpp
--
diff --git a/relational_operators/TextScanOperator.cpp 
b/relational_operators/TextScanOperator.cpp
index 49c9150..1a0b715 100644
--- a/relational_operators/TextScanOperator.cpp
+++ b/relational_operators/TextScanOperator.cpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #include "relational_operators/TextScanOperator.hpp"

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/relational_operators/TextScanOperator.hpp
--
diff --git a/relational_operators/TextScanOperator.hpp 
b/relational_operators/TextScanOperator.hpp
index 6890d7d..24af844 100644
--- a/relational_operators/TextScanOperator.hpp
+++ b/relational_operators/TextScanOperator.hpp
@@ -1,20 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015-2016 Pivotal Software, Inc.
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- * University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See 

[55/63] [abbrv] incubator-quickstep git commit: Fixed cyclic dependencies. Removed Aggregation unit test. Other minor changes.

2016-09-06 Thread hbdeshmukh
Fixed cyclic dependencies. Removed Aggregation unit test. Other minor changes.


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

Branch: refs/heads/quickstep-28-29
Commit: 2518a7298060f5207c3e4d292a7244ecc089c36a
Parents: 48dc0e8
Author: rathijit 
Authored: Sun Aug 14 02:59:40 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 expressions/aggregation/CMakeLists.txt|  2 +-
 storage/CMakeLists.txt|  2 --
 storage/FastHashTable.hpp |  4 +---
 storage/FastSeparateChainingHashTable.hpp |  3 ---
 storage/HashTable.hpp | 10 --
 storage/HashTableBase.hpp | 18 +-
 storage/StorageBlock.cpp  | 10 --
 7 files changed, 23 insertions(+), 26 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2518a729/expressions/aggregation/CMakeLists.txt
--
diff --git a/expressions/aggregation/CMakeLists.txt 
b/expressions/aggregation/CMakeLists.txt
index 98222df..9de6833 100644
--- a/expressions/aggregation/CMakeLists.txt
+++ b/expressions/aggregation/CMakeLists.txt
@@ -321,4 +321,4 @@ target_link_libraries(AggregationHandle_tests
   quickstep_types_operations_comparisons_Comparison
   quickstep_types_operations_comparisons_ComparisonFactory
   quickstep_types_operations_comparisons_ComparisonID)
-add_test(AggregationHandle_tests AggregationHandle_tests)
+#add_test(AggregationHandle_tests AggregationHandle_tests)

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2518a729/storage/CMakeLists.txt
--
diff --git a/storage/CMakeLists.txt b/storage/CMakeLists.txt
index 79a5b87..f05cc46 100644
--- a/storage/CMakeLists.txt
+++ b/storage/CMakeLists.txt
@@ -631,7 +631,6 @@ target_link_libraries(quickstep_storage_EvictionPolicy
   quickstep_utility_Macros)
 target_link_libraries(quickstep_storage_FastHashTable
   quickstep_catalog_CatalogTypedefs
-  quickstep_storage_HashTable
   quickstep_storage_HashTableBase
   quickstep_storage_StorageBlob
   quickstep_storage_StorageBlockInfo
@@ -968,7 +967,6 @@ target_link_libraries(quickstep_storage_StorageBlock
   
quickstep_storage_CompressedColumnStoreTupleStorageSubBlock
   
quickstep_storage_CompressedPackedRowStoreTupleStorageSubBlock
   quickstep_storage_CountedReference
-  quickstep_storage_FastHashTable
   quickstep_storage_HashTableBase
   quickstep_storage_IndexSubBlock
   quickstep_storage_InsertDestinationInterface

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/2518a729/storage/FastHashTable.hpp
--
diff --git a/storage/FastHashTable.hpp b/storage/FastHashTable.hpp
index cba039a..e7887ab 100644
--- a/storage/FastHashTable.hpp
+++ b/storage/FastHashTable.hpp
@@ -42,7 +42,6 @@
 #include "utility/BloomFilter.hpp"
 #include "utility/HashPair.hpp"
 #include "utility/Macros.hpp"
-#include "storage/HashTable.hpp"
 
 namespace quickstep {
 
@@ -561,7 +560,7 @@ class FastHashTable : public HashTableBase ,
   ValueAccessor *accessor,
   const std::vector _attr_ids,
-  const bool check_for_null_keys);
+  const bool check_for_null_keys) override;
 
   /**
* @brief Determine the number of entries (key-value pairs) contained in this
@@ -1322,7 +1321,6 @@ class FastHashTable : public HashTableBase

[43/63] [abbrv] incubator-quickstep git commit: Added unit tests for the distributed version.

2016-09-06 Thread hbdeshmukh
Added unit tests for the distributed version.


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

Branch: refs/heads/quickstep-28-29
Commit: cdc1e053b34aff46104397405642cd9c64b7d5f1
Parents: 59f4dab
Author: Zuyu Zhang 
Authored: Sun Aug 14 00:02:20 2016 -0700
Committer: Zuyu Zhang 
Committed: Tue Aug 16 13:33:54 2016 -0700

--
 query_optimizer/tests/CMakeLists.txt|  35 
 .../tests/DistributedExecutionGeneratorTest.cpp |  62 +++
 .../DistributedExecutionGeneratorTestRunner.cpp | 162 +++
 .../DistributedExecutionGeneratorTestRunner.hpp | 118 ++
 .../tests/execution_generator/CMakeLists.txt|  70 
 5 files changed, 447 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/cdc1e053/query_optimizer/tests/CMakeLists.txt
--
diff --git a/query_optimizer/tests/CMakeLists.txt 
b/query_optimizer/tests/CMakeLists.txt
index 4969ada..597dbe0 100644
--- a/query_optimizer/tests/CMakeLists.txt
+++ b/query_optimizer/tests/CMakeLists.txt
@@ -80,6 +80,14 @@ 
target_link_libraries(quickstep_queryoptimizer_tests_TestDatabaseLoader
   quickstep_utility_Macros
   tmb)
 
+if (ENABLE_DISTRIBUTED)
+  
add_executable(quickstep_queryoptimizer_tests_DistributedExecutionGeneratorTest
+ DistributedExecutionGeneratorTest.cpp
+ DistributedExecutionGeneratorTestRunner.cpp
+ DistributedExecutionGeneratorTestRunner.hpp
+ 
"${PROJECT_SOURCE_DIR}/utility/textbased_test/TextBasedTest.cpp"
+ 
"${PROJECT_SOURCE_DIR}/utility/textbased_test/TextBasedTest.hpp")
+endif(ENABLE_DISTRIBUTED)
 add_executable(quickstep_queryoptimizer_tests_ExecutionGeneratorTest
ExecutionGeneratorTest.cpp
ExecutionGeneratorTestRunner.cpp
@@ -109,6 +117,33 @@ 
add_executable(quickstep_queryoptimizer_tests_OptimizerTextTest
"${PROJECT_SOURCE_DIR}/utility/textbased_test/TextBasedTest.cpp"

"${PROJECT_SOURCE_DIR}/utility/textbased_test/TextBasedTest.hpp")
 
+if (ENABLE_DISTRIBUTED)
+  
target_link_libraries(quickstep_queryoptimizer_tests_DistributedExecutionGeneratorTest
+glog
+gtest
+quickstep_catalog_CatalogTypedefs
+quickstep_cli_DropRelation
+quickstep_cli_PrintToScreen
+quickstep_parser_ParseStatement
+quickstep_parser_SqlParserWrapper
+quickstep_queryexecution_ForemanDistributed
+quickstep_queryexecution_QueryExecutionTypedefs
+quickstep_queryexecution_QueryExecutionUtil
+quickstep_queryexecution_Shiftboss
+quickstep_queryexecution_Worker
+quickstep_queryexecution_WorkerDirectory
+quickstep_queryoptimizer_Optimizer
+quickstep_queryoptimizer_OptimizerContext
+quickstep_queryoptimizer_QueryHandle
+quickstep_queryoptimizer_tests_TestDatabaseLoader
+quickstep_utility_Macros
+quickstep_utility_MemStream
+quickstep_utility_SqlError
+quickstep_utility_TextBasedTestDriver
+tmb
+${GFLAGS_LIB_NAME}
+${LIBS})
+endif(ENABLE_DISTRIBUTED)
 target_link_libraries(quickstep_queryoptimizer_tests_ExecutionGeneratorTest
   glog
   gtest

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/cdc1e053/query_optimizer/tests/DistributedExecutionGeneratorTest.cpp
--
diff --git a/query_optimizer/tests/DistributedExecutionGeneratorTest.cpp 
b/query_optimizer/tests/DistributedExecutionGeneratorTest.cpp
new file mode 100644
index 000..af310bc
--- /dev/null
+++ b/query_optimizer/tests/DistributedExecutionGeneratorTest.cpp
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * 

[59/63] [abbrv] incubator-quickstep git commit: Modified Aggregation unit test. Ran clang-format.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/63a65249/storage/FastHashTable.hpp
--
diff --git a/storage/FastHashTable.hpp b/storage/FastHashTable.hpp
index 909fcc0..9b67734 100644
--- a/storage/FastHashTable.hpp
+++ b/storage/FastHashTable.hpp
@@ -35,8 +35,8 @@
 #include "storage/TupleReference.hpp"
 #include "storage/ValueAccessor.hpp"
 #include "storage/ValueAccessorUtil.hpp"
-#include "threading/SpinSharedMutex.hpp"
 #include "threading/SpinMutex.hpp"
+#include "threading/SpinSharedMutex.hpp"
 #include "types/Type.hpp"
 #include "types/TypedValue.hpp"
 #include "utility/BloomFilter.hpp"
@@ -115,9 +115,9 @@ template 
 class FastHashTable : public HashTableBase {
+   serializable,
+   force_key_copy,
+   allow_duplicate_keys> {
   static_assert(!(serializable && resizable && !force_key_copy),
 "A HashTable must have force_key_copy=true when serializable "
 "and resizable are both true.");
@@ -129,7 +129,7 @@ class FastHashTable : public HashTableBasegetID();
 blob_.release();
@@ -212,8 +213,7 @@ class FastHashTable : public HashTableBase 
_ids,
-   ValueAccessor *accessor,
-   const attribute_id key_attr_id,
-   const bool check_for_null_keys);
+  bool upsertValueAccessorFast(
+  const std::vector _ids,
+  ValueAccessor *accessor,
+  const 

[54/63] [abbrv] incubator-quickstep git commit: Removed some dead code and made minor updates.

2016-09-06 Thread hbdeshmukh
Removed some dead code and made 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/a0eedcb9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/a0eedcb9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/a0eedcb9

Branch: refs/heads/quickstep-28-29
Commit: a0eedcb9097ca97e8b0fe07eae0f4f4af8726ba4
Parents: 3c4e2ab
Author: rathijit 
Authored: Mon Aug 15 06:28:36 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:39:59 2016 -0500

--
 .../aggregation/AggregationConcreteHandle.hpp   | 418 +--
 expressions/aggregation/AggregationHandle.hpp   |  24 +-
 .../aggregation/AggregationHandleAvg.cpp|  30 +-
 .../aggregation/AggregationHandleAvg.hpp|  11 +-
 .../aggregation/AggregationHandleCount.cpp  |  30 +-
 .../aggregation/AggregationHandleCount.hpp  |  13 +-
 .../aggregation/AggregationHandleDistinct.cpp   |   5 +-
 .../aggregation/AggregationHandleDistinct.hpp   |  13 +-
 .../aggregation/AggregationHandleMax.cpp|  24 +-
 .../aggregation/AggregationHandleMax.hpp|  11 +-
 .../aggregation/AggregationHandleMin.cpp|  24 +-
 .../aggregation/AggregationHandleMin.hpp|  11 +-
 .../aggregation/AggregationHandleSum.cpp|  21 +-
 .../aggregation/AggregationHandleSum.hpp|  14 +-
 expressions/aggregation/CMakeLists.txt  |  82 ++--
 storage/AggregationOperationState.cpp   |  21 +-
 storage/FastHashTable.hpp   | 293 ++---
 storage/FastSeparateChainingHashTable.hpp   | 213 +-
 18 files changed, 136 insertions(+), 1122 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/a0eedcb9/expressions/aggregation/AggregationConcreteHandle.hpp
--
diff --git a/expressions/aggregation/AggregationConcreteHandle.hpp 
b/expressions/aggregation/AggregationConcreteHandle.hpp
index 609937a..5b47e93 100644
--- a/expressions/aggregation/AggregationConcreteHandle.hpp
+++ b/expressions/aggregation/AggregationConcreteHandle.hpp
@@ -50,37 +50,6 @@ class ValueAccessor;
  * @brief An upserter class for modifying the destination hash table while
  *merging two group by hash tables.
  **/
-template 
-class HashTableStateUpserter {
- public:
-  /**
-   * @brief Constructor.
-   *
-   * @param handle The aggregation handle being used.
-   * @param source_state The aggregation state in the source aggregation hash
-   *table. The corresponding state (for the same key) in the 
destination
-   *hash table will be upserted.
-   **/
-  HashTableStateUpserter(const HandleT , const StateT _state)
-  : handle_(handle), source_state_(source_state) {}
-
-  /**
-   * @brief The operator for the functor required for the upsert.
-   *
-   * @param destination_state The aggregation state in the aggregation hash
-   *table that is being upserted.
-   **/
-  void operator()(StateT *destination_state) {
-handle_.mergeStates(source_state_, destination_state);
-  }
-
- private:
-  const HandleT _;
-  const StateT _state_;
-
-  DISALLOW_COPY_AND_ASSIGN(HashTableStateUpserter);
-};
-
 template 
 class HashTableStateUpserterFast {
  public:
@@ -113,103 +82,6 @@ class HashTableStateUpserterFast {
 };
 
 /**
- * @brief A class to support the functor for merging group by hash tables.
- **/
-template 
-class HashTableMerger {
- public:
-  /**
-   * @brief Constructor
-   *
-   * @param handle The Aggregation handle being used.
-   * @param destination_hash_table The destination hash table to which other
-   *hash tables will be merged.
-   **/
-  HashTableMerger(const HandleT ,
-  AggregationStateHashTableBase *destination_hash_table)
-  : handle_(handle),
-destination_hash_table_(
-static_cast(destination_hash_table)) {}
-
-  /**
-   * @brief The operator for the functor.
-   *
-   * @param group_by_key The group by key being merged.
-   * @param source_state The aggregation state for the given key in the source
-   *aggregation hash table.
-   **/
-  inline void operator()(const std::vector _by_key,
- const StateT _state) {
-const StateT *original_state =
-destination_hash_table_->getSingleCompositeKey(group_by_key);
-if (original_state != nullptr) {
-  HashTableStateUpserter upserter(
-  handle_, source_state);
-  // The CHECK is required as upsertCompositeKey can return false if the
-  // hash table runs out of space during the upsert process. The ideal
-  // solution will be to retry again if the 

[53/63] [abbrv] incubator-quickstep git commit: Removed some dead code and made minor updates.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/a0eedcb9/storage/FastSeparateChainingHashTable.hpp
--
diff --git a/storage/FastSeparateChainingHashTable.hpp 
b/storage/FastSeparateChainingHashTable.hpp
index 49cea5b..0670993 100644
--- a/storage/FastSeparateChainingHashTable.hpp
+++ b/storage/FastSeparateChainingHashTable.hpp
@@ -120,25 +120,15 @@ class FastSeparateChainingHashTable : public 
FastHashTable
-::putCompositeKeyInternal(const std::vector ,
-  const std::size_t variable_key_size,
-  const uint8_t ,
-  HashTablePreallocationState *prealloc_state) 
{
-  DEBUG_ASSERT(this->key_types_.size() == key.size());
-
-  if (prealloc_state == nullptr) {
-// Early check for a free bucket.
-if (header_->buckets_allocated.load(std::memory_order_relaxed) >= 
header_->num_buckets) {
-  return HashTablePutResult::kOutOfSpace;
-}
-
-// TODO(chasseur): If allow_duplicate_keys is true, avoid storing more than
-// one copy of the same variable-length key.
-if (!key_manager_.allocateVariableLengthKeyStorage(variable_key_size)) {
-  // Ran out of variable-length key storage space.
-  return HashTablePutResult::kOutOfSpace;
-}
-  }
-
-  const std::size_t hash_code = this->hashCompositeKey(key);
-  void *bucket = nullptr;
-  std::atomic *pending_chain_ptr;
-  std::size_t pending_chain_ptr_finish_value;
-  for (;;) {
-if (locateBucketForInsertion(hash_code,
- 0,
- ,
- _chain_ptr,
- _chain_ptr_finish_value,
- prealloc_state)) {
-  // Found an empty bucket.
-  break;
-} else if (bucket == nullptr) {
-  // Ran out of buckets. Deallocate any variable space that we were unable
-  // to use.
-  DEBUG_ASSERT(prealloc_state == nullptr);
-  key_manager_.deallocateVariableLengthKeyStorage(variable_key_size);
-  return HashTablePutResult::kOutOfSpace;
-} else {
-  // Hash collision found, and duplicates aren't allowed.
-  DEBUG_ASSERT(!allow_duplicate_keys);
-  DEBUG_ASSERT(prealloc_state == nullptr);
-  if (key_manager_.compositeKeyCollisionCheck(key, bucket)) {
-// Duplicate key. Deallocate any variable storage space and return.
-key_manager_.deallocateVariableLengthKeyStorage(variable_key_size);
-return HashTablePutResult::kDuplicateKey;
-  }
-}
-  }
-
-  // Write the key and hash.
-  writeCompositeKeyToBucket(key, hash_code, bucket, prealloc_state);
-
-  // Store the value by using placement new with ValueT's copy constructor.
-  new(static_cast(bucket) + kValueOffset) uint8_t(value);
-
-  // Update the previous chain pointer to point to the new bucket.
-  pending_chain_ptr->store(pending_chain_ptr_finish_value, 
std::memory_order_release);
-
-  // We're all done.
-  return HashTablePutResult::kOK;
-}
-
-template 

[46/63] [abbrv] incubator-quickstep git commit: Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, some more optimizations are pending.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/storage/StorageBlock.hpp
--
diff --git a/storage/StorageBlock.hpp b/storage/StorageBlock.hpp
index 97b4773..8b59a3c 100644
--- a/storage/StorageBlock.hpp
+++ b/storage/StorageBlock.hpp
@@ -468,6 +468,14 @@ class StorageBlock : public StorageBlockBase {
 std::vector
 *reuse_group_by_vectors) const;
 
+
+  void aggregateGroupByFast(const 
std::vector> ,
+const std::vector 
_by,
+const Predicate *predicate,
+AggregationStateHashTableBase *hash_table,
+std::unique_ptr *reuse_matches,
+std::vector
+*reuse_group_by_vectors) const;
   /**
* @brief Inserts the GROUP BY expressions and aggregation arguments together
*as keys into the distinctify hash table.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/threading/SpinMutex.hpp
--
diff --git a/threading/SpinMutex.hpp b/threading/SpinMutex.hpp
index 5ed1405..106ef13 100644
--- a/threading/SpinMutex.hpp
+++ b/threading/SpinMutex.hpp
@@ -44,6 +44,8 @@ class SpinMutex {
   SpinMutex() : locked_(false) {
   }
 
+  explicit SpinMutex(uint8_t *ptr): locked_(*ptr) {}
+
   /**
* @note This call does NOT yield when contended. SpinMutex is intended
*   mainly for cases where locks are held briefly and it is better to



[33/63] [abbrv] incubator-quickstep git commit: Deserialized Window Aggr WorkOrder.

2016-09-06 Thread hbdeshmukh
Deserialized Window Aggr WorkOrder.


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

Branch: refs/heads/quickstep-28-29
Commit: 85e02de49205409accfef3737dadfe95aad1f5c0
Parents: 658cb61
Author: Zuyu Zhang 
Authored: Mon Aug 8 23:14:08 2016 -0700
Committer: Zuyu Zhang 
Committed: Mon Aug 8 23:14:08 2016 -0700

--
 relational_operators/CMakeLists.txt   |  1 +
 relational_operators/WorkOrderFactory.cpp | 25 +
 2 files changed, 26 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/85e02de4/relational_operators/CMakeLists.txt
--
diff --git a/relational_operators/CMakeLists.txt 
b/relational_operators/CMakeLists.txt
index 9696392..43a42f9 100644
--- a/relational_operators/CMakeLists.txt
+++ b/relational_operators/CMakeLists.txt
@@ -467,6 +467,7 @@ 
target_link_libraries(quickstep_relationaloperators_WorkOrderFactory
   quickstep_relationaloperators_TableGeneratorOperator
   quickstep_relationaloperators_TextScanOperator
   quickstep_relationaloperators_UpdateOperator
+  quickstep_relationaloperators_WindowAggregationOperator
   quickstep_relationaloperators_WorkOrder_proto
   quickstep_storage_StorageBlockInfo
   quickstep_utility_Macros

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/85e02de4/relational_operators/WorkOrderFactory.cpp
--
diff --git a/relational_operators/WorkOrderFactory.cpp 
b/relational_operators/WorkOrderFactory.cpp
index f920cac..721d735 100644
--- a/relational_operators/WorkOrderFactory.cpp
+++ b/relational_operators/WorkOrderFactory.cpp
@@ -46,6 +46,7 @@
 #include "relational_operators/TableGeneratorOperator.hpp"
 #include "relational_operators/TextScanOperator.hpp"
 #include "relational_operators/UpdateOperator.hpp"
+#include "relational_operators/WindowAggregationOperator.hpp"
 #include "relational_operators/WorkOrder.pb.h"
 #include "storage/StorageBlockInfo.hpp"
 
@@ -419,6 +420,22 @@ WorkOrder* WorkOrderFactory::ReconstructFromProto(const 
serialization::WorkOrder
   shiftboss_client_id,
   bus);
 }
+case serialization::WINDOW_AGGREGATION: {
+  LOG(INFO) << "Creating WindowAggregationWorkOrder";
+  vector blocks;
+  for (int i = 0; i < 
proto.ExtensionSize(serialization::WindowAggregationWorkOrder::block_ids); ++i) 
{
+blocks.push_back(
+
proto.GetExtension(serialization::WindowAggregationWorkOrder::block_ids, i));
+  }
+
+  return new WindowAggregationWorkOrder(
+  proto.query_id(),
+  query_context->getWindowAggregationState(
+  
proto.GetExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index)),
+  move(blocks),
+  query_context->getInsertDestination(
+  
proto.GetExtension(serialization::FinalizeAggregationWorkOrder::insert_destination_index)));
+}
 default:
   LOG(FATAL) << "Unknown WorkOrder Type in 
WorkOrderFactory::ReconstructFromProto";
   }
@@ -697,6 +714,14 @@ bool WorkOrderFactory::ProtoIsValid(const 
serialization::WorkOrder ,
  
proto.HasExtension(serialization::UpdateWorkOrder::operator_index) &&
  proto.HasExtension(serialization::UpdateWorkOrder::block_id);
 }
+case serialization::WINDOW_AGGREGATION: {
+  return 
proto.HasExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index)
 &&
+ query_context.isValidWindowAggregationStateId(
+ 
proto.GetExtension(serialization::WindowAggregationWorkOrder::window_aggr_state_index))
 &&
+ 
proto.HasExtension(serialization::WindowAggregationWorkOrder::insert_destination_index)
 &&
+ query_context.isValidInsertDestinationId(
+ 
proto.GetExtension(serialization::WindowAggregationWorkOrder::insert_destination_index));
+}
 default:
   return false;
   }



[49/63] [abbrv] incubator-quickstep git commit: Initial commit for QUICKSTEP-28 and QUICKSTEP-29. Code refactoring and cleanup, some more optimizations are pending.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/169ae326/storage/FastHashTable.hpp
--
diff --git a/storage/FastHashTable.hpp b/storage/FastHashTable.hpp
new file mode 100644
index 000..12e447f
--- /dev/null
+++ b/storage/FastHashTable.hpp
@@ -0,0 +1,2640 @@
+/**
+ *   Copyright 2011-2015 Quickstep Technologies LLC.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
+ *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
+ * University of Wisconsin—Madison.
+ *
+ *   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 at
+ *
+ *   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.
+ **/
+
+#ifndef QUICKSTEP_STORAGE_FAST_HASH_TABLE_HPP_
+#define QUICKSTEP_STORAGE_FAST_HASH_TABLE_HPP_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "catalog/CatalogTypedefs.hpp"
+#include "storage/HashTableBase.hpp"
+#include "storage/StorageBlob.hpp"
+#include "storage/StorageBlockInfo.hpp"
+#include "storage/StorageConstants.hpp"
+#include "storage/StorageManager.hpp"
+#include "storage/TupleReference.hpp"
+#include "storage/ValueAccessor.hpp"
+#include "storage/ValueAccessorUtil.hpp"
+#include "expressions/aggregation/AggregationHandleAvg.hpp"
+#include "threading/SpinSharedMutex.hpp"
+#include "threading/SpinMutex.hpp"
+#include "types/Type.hpp"
+#include "types/TypedValue.hpp"
+#include "utility/BloomFilter.hpp"
+#include "utility/HashPair.hpp"
+#include "utility/Macros.hpp"
+#include "storage/HashTable.hpp"
+
+namespace quickstep {
+
+/** \addtogroup Storage
+ *  @{
+ */
+
+/**
+ * @brief Base class for hash table.
+ *
+ * This class is templated so that the core hash-table logic can be reused in
+ * different contexts requiring different value types and semantics (e.g.
+ * hash-joins vs. hash-based grouping for aggregates vs. hash-based indices).
+ * The base template defines the interface that HashTables provide to clients
+ * and implements some common functionality for all HashTables. There a few
+ * different (also templated) implementation classes that inherit from this
+ * base class and have different physical layouts with different performance
+ * characteristics. As of this writing, they are:
+ *  1. LinearOpenAddressingHashTable - All keys/values are stored directly
+ * in a single array of buckets. Collisions are handled by simply
+ * advancing to the "next" adjacent bucket until an empty bucket is
+ * found. This implementation is vulnerable to performance degradation
+ * due to the formation of bucket chains when there are many duplicate
+ * and/or consecutive keys.
+ *  2. SeparateChainingHashTable - Keys/values are stored in a separate
+ * region of memory from the base hash table slot array. Every bucket
+ * has a "next" pointer so that entries that collide (i.e. map to the
+ * same base slot) form chains of pointers with each other. Although
+ * this implementation has some extra indirection compared to
+ * LinearOpenAddressingHashTable, it does not have the same
+ * vulnerabilities to key skew, and it additionally supports a very
+ * efficient bucket-preallocation mechanism that minimizes cache
+ * coherency overhead when multiple threads are building a HashTable
+ * as part of a hash-join.
+ *  3. SimpleScalarSeparateChainingHashTable - A simplified version of
+ * SeparateChainingHashTable that is only usable for single, scalar
+ * keys with a reversible hash function. This implementation exploits
+ * the reversible hash to avoid storing separate copies of keys at all,
+ * and to skip an extra key comparison when hash codes collide.
+ *
+ * @note If you need to create a HashTable and not just use it as a client, see
+ *   HashTableFactory, which simplifies the process of creating a
+ *   HashTable.
+ *
+ * @param ValueT The mapped value in this hash table. Must be
+ *copy-constructible. For a serializable hash table, ValueT must also
+ *be trivially copyable and trivially destructible (and beware of
+ *pointers to external memory).
+ * @param resizable Whether this hash table is resizable (using memory from a
+ *StorageManager) or not (using a private, fixed memory allocation).
+ * @param serializable If true, this hash table can safely be saved to and
+ *loaded from disk. If false, some out of band memory may be 

[03/63] [abbrv] incubator-quickstep git commit: QUICKSTEP-40: Fix Copyright notice to confirm to Apache.

2016-09-06 Thread hbdeshmukh
http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/operations/comparisons/NotEqualComparison.hpp
--
diff --git a/types/operations/comparisons/NotEqualComparison.hpp 
b/types/operations/comparisons/NotEqualComparison.hpp
index 995eaf3..560f613 100644
--- a/types/operations/comparisons/NotEqualComparison.hpp
+++ b/types/operations/comparisons/NotEqualComparison.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef QUICKSTEP_TYPES_OPERATIONS_COMPARISONS_NOT_EQUAL_COMPARISON_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/operations/comparisons/PatternMatchingComparators-inl.hpp
--
diff --git a/types/operations/comparisons/PatternMatchingComparators-inl.hpp 
b/types/operations/comparisons/PatternMatchingComparators-inl.hpp
index 6188a52..617eadf 100644
--- a/types/operations/comparisons/PatternMatchingComparators-inl.hpp
+++ b/types/operations/comparisons/PatternMatchingComparators-inl.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- *   University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
  *
- *   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 at
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- *   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.
+ * 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.
  **/
 
 #ifndef 
QUICKSTEP_TYPES_OPERATIONS_COMPARISONS_PATTERN_MATCHING_COMPARATORS_INL_HPP_

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/918167a4/types/operations/comparisons/PatternMatchingComparators.hpp
--
diff --git a/types/operations/comparisons/PatternMatchingComparators.hpp 
b/types/operations/comparisons/PatternMatchingComparators.hpp
index ed105a6..bb2af97 100644
--- a/types/operations/comparisons/PatternMatchingComparators.hpp
+++ b/types/operations/comparisons/PatternMatchingComparators.hpp
@@ -1,18 +1,20 @@
 /**
- *   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
- *   University of Wisconsin—Madison.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * 

incubator-quickstep git commit: Introduced DestroyAggregationState operator [Forced Update!]

2016-09-06 Thread hbdeshmukh
Repository: incubator-quickstep
Updated Branches:
  refs/heads/destroy-agg-state-operator b162047b6 -> 590ba4dac (forced update)


Introduced DestroyAggregationState operator

- Similar to the pattern with DestroyHash, this operator destroys the
  AggregationState once the Finalize aggregation operator finishes its
  execution.
- Optimizer support for DestroyAggregationState operator.
- Removed unused QueryContext::releaseAggregationState method.


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

Branch: refs/heads/destroy-agg-state-operator
Commit: 590ba4dacfe0c65a1d254e79daaecbf4f1f5854b
Parents: 1d10422
Author: Harshad Deshmukh 
Authored: Tue Aug 23 11:00:57 2016 -0500
Committer: Harshad Deshmukh 
Committed: Tue Sep 6 10:21:39 2016 -0500

--
 query_execution/QueryContext.hpp|  10 +-
 query_optimizer/CMakeLists.txt  |   1 +
 query_optimizer/ExecutionGenerator.cpp  |  10 ++
 relational_operators/CMakeLists.txt |  16 +++
 .../DestroyAggregationStateOperator.cpp |  64 ++
 .../DestroyAggregationStateOperator.hpp | 120 +++
 .../FinalizeAggregationOperator.cpp |   2 +-
 .../FinalizeAggregationOperator.hpp |   3 +-
 relational_operators/WorkOrder.proto|   7 ++
 relational_operators/WorkOrderFactory.cpp   |  16 ++-
 .../tests/AggregationOperator_unittest.cpp  |  25 
 11 files changed, 264 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/590ba4da/query_execution/QueryContext.hpp
--
diff --git a/query_execution/QueryContext.hpp b/query_execution/QueryContext.hpp
index c54c7ff..393b55e 100644
--- a/query_execution/QueryContext.hpp
+++ b/query_execution/QueryContext.hpp
@@ -182,16 +182,14 @@ class QueryContext {
   }
 
   /**
-   * @brief Release the given AggregationOperationState.
+   * @brief Destroy the given aggregation state.
*
-   * @param id The id of the AggregationOperationState to destroy.
-   *
-   * @return The AggregationOperationState, alreadly created in the 
constructor.
+   * @param id The ID of the AggregationOperationState to destroy.
**/
-  inline AggregationOperationState* releaseAggregationState(const 
aggregation_state_id id) {
+  inline void destroyAggregationState(const aggregation_state_id id) {
 DCHECK_LT(id, aggregation_states_.size());
 DCHECK(aggregation_states_[id]);
-return aggregation_states_[id].release();
+aggregation_states_[id].reset(nullptr);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/590ba4da/query_optimizer/CMakeLists.txt
--
diff --git a/query_optimizer/CMakeLists.txt b/query_optimizer/CMakeLists.txt
index 56ae52f..32f7885 100644
--- a/query_optimizer/CMakeLists.txt
+++ b/query_optimizer/CMakeLists.txt
@@ -118,6 +118,7 @@ 
target_link_libraries(quickstep_queryoptimizer_ExecutionGenerator
   quickstep_relationaloperators_CreateIndexOperator
   quickstep_relationaloperators_CreateTableOperator
   quickstep_relationaloperators_DeleteOperator
+  
quickstep_relationaloperators_DestroyAggregationStateOperator
   quickstep_relationaloperators_DestroyHashOperator
   quickstep_relationaloperators_DropTableOperator
   quickstep_relationaloperators_FinalizeAggregationOperator

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/590ba4da/query_optimizer/ExecutionGenerator.cpp
--
diff --git a/query_optimizer/ExecutionGenerator.cpp 
b/query_optimizer/ExecutionGenerator.cpp
index 2e03e09..130134c 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -94,6 +94,7 @@
 #include "relational_operators/CreateIndexOperator.hpp"
 #include "relational_operators/CreateTableOperator.hpp"
 #include "relational_operators/DeleteOperator.hpp"
+#include "relational_operators/DestroyAggregationStateOperator.hpp"
 #include "relational_operators/DestroyHashOperator.hpp"
 #include "relational_operators/DropTableOperator.hpp"
 #include "relational_operators/FinalizeAggregationOperator.hpp"
@@ -1464,6 +1465,15 @@ void ExecutionGenerator::convertAggregate(
   std::forward_as_tuple(finalize_aggregation_operator_index, 

incubator-quickstep git commit: Some additional changes for the size change.

2016-09-06 Thread hakanmemisoglu
Repository: incubator-quickstep
Updated Branches:
  refs/heads/date-representation 2f5b6ddfd -> 92555fc43


Some additional changes for the size change.


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

Branch: refs/heads/date-representation
Commit: 92555fc4311d8efdee4b66faeb4fb0cd48938595
Parents: 2f5b6dd
Author: Hakan Memisoglu 
Authored: Tue Sep 6 09:02:40 2016 -0500
Committer: Hakan Memisoglu 
Committed: Tue Sep 6 09:02:40 2016 -0500

--
 types/DatetimeLit.hpp  | 6 ++
 types/TypedValue.cpp   | 9 ++---
 types/TypedValue.hpp   | 4 +++-
 types/TypedValue.proto | 8 +---
 4 files changed, 12 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/92555fc4/types/DatetimeLit.hpp
--
diff --git a/types/DatetimeLit.hpp b/types/DatetimeLit.hpp
index 7ce7177..c99dae4 100644
--- a/types/DatetimeLit.hpp
+++ b/types/DatetimeLit.hpp
@@ -73,6 +73,12 @@ struct DateLit {
 return date;
   }
 
+  static DateLit Create(const std::uint32_t serialized) {
+DateLit date;
+date.year_month_day = serialized;
+return date;
+  }
+
   inline bool operator< (const DateLit& rhs) const {
 return year_month_day < rhs.year_month_day;
   }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/92555fc4/types/TypedValue.cpp
--
diff --git a/types/TypedValue.cpp b/types/TypedValue.cpp
index d7b4956..ada69c6 100644
--- a/types/TypedValue.cpp
+++ b/types/TypedValue.cpp
@@ -110,10 +110,7 @@ serialization::TypedValue TypedValue::getProto() const {
 case kDate:
   proto.set_type_id(serialization::Type::DATE);
   if (!isNull()) {
-serialization::TypedValue::DateLit *literal_date_proto = 
proto.mutable_date_value();
-literal_date_proto->set_year(value_union_.date_value.yearField());
-literal_date_proto->set_month(value_union_.date_value.monthField());
-literal_date_proto->set_day(value_union_.date_value.dayField());
+proto.set_date_value(getLiteral().year_month_day);
   }
   break;
 case kDatetime:
@@ -185,9 +182,7 @@ TypedValue TypedValue::ReconstructFromProto(const 
serialization::TypedValue 
   TypedValue(kDouble);
 case serialization::Type::DATE:
   if (proto.has_date_value()) {
-return TypedValue(DateLit::Create(proto.date_value().year(),
-  proto.date_value().month(),
-  proto.date_value().day()));
+return TypedValue(DateLit::Create(proto.date_value()));
   } else {
 return TypedValue(kDate);
   }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/92555fc4/types/TypedValue.hpp
--
diff --git a/types/TypedValue.hpp b/types/TypedValue.hpp
index d75720a..dae8bd8 100644
--- a/types/TypedValue.hpp
+++ b/types/TypedValue.hpp
@@ -393,10 +393,10 @@ class TypedValue {
 switch (getTypeID()) {
   case kInt:
   case kFloat:
+  case kDate:
 return sizeof(int);
   case kLong:
   case kDouble:
-  case kDate:
   case kDatetime:
   case kDatetimeInterval:
   case kYearMonthInterval:
@@ -552,6 +552,8 @@ class TypedValue {
   // 4 bytes byte-for-byte copy.
   *static_cast(destination) = value_union_.int_value;
   break;
+case kDate:
+  *static_cast(destination) = value_union_.date_value;
 default:
   // 8 bytes byte-for-byte copy.
   *static_cast(destination) = value_union_;

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/92555fc4/types/TypedValue.proto
--
diff --git a/types/TypedValue.proto b/types/TypedValue.proto
index 7f3ab7a..0164688 100644
--- a/types/TypedValue.proto
+++ b/types/TypedValue.proto
@@ -34,11 +34,5 @@ message TypedValue {
   optional int64 datetime_interval_value = 8;
   optional int64 year_month_interval_value = 9;
 
-  message DateLit {
-required int32 year = 1;
-required uint32 month = 2;
-required uint32 day = 3;
-  }
-
-  optional DateLit date_value = 10;
+  optional uint32 date_value = 10;
 }