Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 0fc7c20

Browse files
authored
Merge branch 'master' into ubuntu-cmake
2 parents 551edb6 + aaaa621 commit 0fc7c20

39 files changed

+2037
-1491
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ script:
133133
# create build directory
134134
- mkdir build
135135
- cd build
136-
# run cmake
136+
# run cmake. NOTE: the PATH is made explicit to avoid automatic selection of the preinstalled llvm version in the Travis trusty image
137137
- PATH=/usr/lib/llvm-3.7/bin:/usr/bin:$PATH cmake -DCOVERALLS=$COVERALLS -DCMAKE_PREFIX_PATH=`llvm-config-3.7 --prefix` -DCMAKE_BUILD_TYPE=$PELOTON_BUILD_TYPE -DUSE_SANITIZER=Address ..
138138
# build
139139
- make -j4

Jenkinsfile

Lines changed: 237 additions & 36 deletions
Large diffs are not rendered by default.

script/docker/debian-stretch/Dockerfile-jenkins

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Debug
1212
RUN echo -n "Peloton Release build with "; g++ --version | head -1
1313
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
1414

15-
RUN echo -n "Peloton Debug build with "; clang++-3.7 --version | head -1
16-
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang-3.7 CXX=clang++-3.7 cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install
15+
RUN echo -n "Peloton Debug build with "; clang++ --version | head -1
16+
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=False .. && make -j4 && make install
1717

18-
RUN echo -n "Peloton Release build with "; clang++-3.7 --version | head -1
19-
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang-3.7 CXX=clang++-3.7 cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install
18+
RUN echo -n "Peloton Release build with "; clang++ --version | head -1
19+
RUN rm -rf /peloton/build && mkdir /peloton/build && cd /peloton/build && CC=clang CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release -DCOVERALLS=False .. && make -j4 && make install

script/installation/packages.sh

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,33 @@ if [ "$DISTRO" = "UBUNTU" ]; then
7777
libedit-dev \
7878
postgresql-client
7979

80+
## ------------------------------------------------
81+
## DEBIAN
82+
## ------------------------------------------------
83+
elif [ "$DISTRO" = "DEBIAN OS" ]; then
84+
sudo apt-get -qq --ignore-missing -y install \
85+
git \
86+
g++ \
87+
clang \
88+
cmake \
89+
libgflags-dev \
90+
libprotobuf-dev \
91+
protobuf-compiler \
92+
bison \
93+
flex \
94+
libevent-dev \
95+
libboost-dev \
96+
libboost-thread-dev \
97+
libboost-filesystem-dev \
98+
libjemalloc-dev \
99+
libssl-dev \
100+
valgrind \
101+
lcov \
102+
libpqxx-dev \
103+
llvm-dev \
104+
libedit-dev \
105+
postgresql-client
106+
80107
## ------------------------------------------------
81108
## FEDORA
82109
## ------------------------------------------------
@@ -147,7 +174,7 @@ elif [[ "$DISTRO" == *"REDHAT"* ]] && [[ "${DISTRO_VER%.*}" == "7" ]]; then
147174
git \
148175
gcc-c++ \
149176
make \
150-
cmake \
177+
cmake3 \
151178
flex \
152179
bison \
153180
libevent-devel \

src/binder/binder_context.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,16 @@ bool BinderContext::GetColumnPosTuple(
8282
const std::string &col_name,
8383
std::shared_ptr<catalog::TableCatalogObject> table_obj,
8484
std::tuple<oid_t, oid_t, oid_t> &col_pos_tuple, type::TypeId &value_type) {
85-
try {
86-
auto column_object = table_obj->GetColumnObject(col_name);
87-
if (column_object == nullptr) {
88-
return false;
89-
}
90-
91-
oid_t col_pos = column_object->GetColumnId();
92-
col_pos_tuple = std::make_tuple(table_obj->GetDatabaseOid(),
93-
table_obj->GetTableOid(), col_pos);
94-
value_type = column_object->GetColumnType();
95-
return true;
96-
} catch (CatalogException &e) {
97-
LOG_TRACE("Can't find table %d! Return false", std::get<1>(table_id_tuple));
85+
auto column_object = table_obj->GetColumnObject(col_name);
86+
if (column_object == nullptr) {
9887
return false;
9988
}
89+
90+
oid_t col_pos = column_object->GetColumnId();
91+
col_pos_tuple = std::make_tuple(table_obj->GetDatabaseOid(),
92+
table_obj->GetTableOid(), col_pos);
93+
value_type = column_object->GetColumnType();
94+
return true;
10095
}
10196

10297
bool BinderContext::GetColumnPosTuple(

src/executor/create_executor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ bool CreateExecutor::CreateDatabase(const planner::CreatePlan &node) {
9494
database_name, txn);
9595
txn->SetResult(result);
9696
LOG_TRACE("Result is: %s",
97-
ResultTypeToString(current_txn->GetResult()).c_str());
97+
ResultTypeToString(txn->GetResult()).c_str());
9898
return (true);
9999
}
100100

src/include/expression/tuple_value_expression.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ class TupleValueExpression : public AbstractExpression {
138138

139139
std::string GetColumnName() const { return col_name_; }
140140

141+
std::string GetColFullName() const {
142+
if (!table_name_.empty()) {
143+
return table_name_ + "." + col_name_;
144+
}
145+
return col_name_;
146+
}
147+
141148
void SetTableName(std::string table_alias) { table_name_ = table_alias; }
142149

143150
void SetColName(std::string col_name) { col_name_ = col_name; }
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Peloton
4+
//
5+
// cost_and_stats_calculator.h
6+
//
7+
// Identification: src/include/optimizer/stats_calculator.h
8+
//
9+
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#pragma once
14+
15+
#include "optimizer/operator_visitor.h"
16+
17+
namespace peloton {
18+
19+
namespace expression {
20+
class AbstractExpression;
21+
}
22+
namespace optimizer {
23+
24+
class Memo;
25+
26+
// Derive child stats that has not yet been calculated for a logical group
27+
// expression
28+
class ChildStatsDeriver : public OperatorVisitor {
29+
public:
30+
std::vector<ExprSet> DeriveInputStats(
31+
GroupExpression *gexpr,
32+
ExprSet required_cols, Memo *memo);
33+
34+
void Visit(const LogicalQueryDerivedGet *) override;
35+
void Visit(const LogicalInnerJoin *) override;
36+
void Visit(const LogicalLeftJoin *) override;
37+
void Visit(const LogicalRightJoin *) override;
38+
void Visit(const LogicalOuterJoin *) override;
39+
void Visit(const LogicalSemiJoin *) override;
40+
void Visit(const LogicalAggregateAndGroupBy *) override;
41+
42+
private:
43+
void PassDownRequiredCols();
44+
void PassDownColumn(expression::AbstractExpression* col);
45+
ExprSet required_cols_;
46+
GroupExpression *gexpr_;
47+
Memo *memo_;
48+
49+
std::vector<ExprSet> output_;
50+
};
51+
52+
} // namespace optimizer
53+
} // namespace peloton

src/include/optimizer/cost_and_stats_calculator.h

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/include/optimizer/cost_calculator.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@
1717
namespace peloton {
1818
namespace optimizer {
1919

20+
class Memo;
2021
// Derive cost for a physical group expressionh
2122
class CostCalculator : public OperatorVisitor {
2223
public:
23-
double CalculatorCost(
24-
GroupExpression* gexpr,
25-
const PropertySet *output_properties);
24+
double CalculateCost(GroupExpression *gexpr, Memo *memo);
2625

2726
void Visit(const DummyScan *) override;
2827
void Visit(const PhysicalSeqScan *) override;
@@ -48,10 +47,12 @@ class CostCalculator : public OperatorVisitor {
4847
void Visit(const PhysicalAggregate *) override;
4948

5049
private:
51-
// We cannot use reference here because otherwise we have to initialize them
52-
// when constructing the class
53-
GroupExpression* gexpr_;
54-
const PropertySet *output_properties_;
50+
double HashCost();
51+
double SortCost();
52+
double GroupByCost();
53+
54+
GroupExpression *gexpr_;
55+
Memo *memo_;
5556
double output_cost_ = 0;
5657
};
5758

0 commit comments

Comments
 (0)