Merge branch 'master' of github.com:yandex/ClickHouse

This commit is contained in:
Alexey Milovidov 2017-05-05 16:35:08 -07:00
commit 32a75147f5
7 changed files with 44 additions and 22 deletions

View File

@ -286,7 +286,7 @@ private:
ParserString dot_p(".");
ParserNumber number_p;
auto pos = pattern.data();
const char * pos = pattern.data();
const auto begin = pos;
const auto end = pos + pattern.size();

View File

@ -41,10 +41,17 @@ Block CastTypeBlockInputStream::readImpl()
if (!block || cast_types.empty())
return block;
Block res;
size_t s = block.columns();
size_t block_size = block.columns();
for (size_t i = 0; i < s; ++i)
if (block_size != cast_types.size())
{
LOG_ERROR(log, "Number of columns do not match, skipping cast");
return block;
}
Block res;
for (size_t i = 0; i < block_size; ++i)
{
const auto & elem = block.getByPosition(i);

View File

@ -2,6 +2,7 @@
#include <DataStreams/IProfilingBlockInputStream.h>
#include <common/logger_useful.h>
#include <experimental/optional>
#include <vector>
@ -34,6 +35,7 @@ private:
const Context & context;
std::vector<std::experimental::optional<NameAndTypePair>> cast_types;
std::vector<std::shared_ptr<IFunction>> cast_functions; /// Used to perform type conversions.
Logger * log = &Logger::get("CastTypeBlockInputStream");
};
}

View File

@ -104,7 +104,7 @@ ColumnsDescription<true> ColumnsDescription<true>::parse(const String & str)
ASTPtr default_expr;
Expected expected{};
auto begin = default_expr_str.data();
const char * begin = default_expr_str.data();
const auto end = begin + default_expr_str.size();
const char * max_parsed_pos = begin;
if (!expr_parser.parse(begin, end, default_expr, max_parsed_pos, expected))

View File

@ -160,7 +160,7 @@ def main(args):
report_testcase.append(stderr_element)
print(stderr)
if 'Connection refused' in stderr or 'Attempt to read after eof' in stderr:
if args.stop and ('Connection refused' in stderr or 'Attempt to read after eof' in stderr) and not 'Received exception from server' in stderr:
SERVER_DIED = True
elif stderr:
@ -235,6 +235,7 @@ if __name__ == '__main__':
group.add_argument('--no-zookeeper', action = 'store_false', default = None, dest = 'zookeeper', help = 'Do not run zookeeper related tests')
group.add_argument('--shard', action = 'store_true', default = None, dest = 'shard', help = 'Run sharding related tests (required to clickhouse-server listen 127.0.0.2 127.0.0.3)')
group.add_argument('--no-shard', action = 'store_false', default = None, dest = 'shard', help = 'Do not run shard related tests')
group.add_argument('--stop', action = 'store_true', default = None, dest = 'stop', help = 'Stop on network errors ')
args = parser.parse_args()

View File

@ -1,4 +1,5 @@
-- Not found column date in block. There are only columns: x.
drop table if exists test.partition_428;
create table test.partition_428 (date MATERIALIZED toDate(0), x UInt64, sample_key MATERIALIZED intHash64(x)) ENGINE=MergeTree(date,sample_key,(date,x,sample_key),8192);
insert into test.partition_428 ( x ) VALUES ( now() );
insert into test.partition_428 ( x ) VALUES ( now()+1 );

View File

@ -1,35 +1,46 @@
#!/bin/sh
# How to build ClickHouse under freebsd 11+
# [temporary solution before port created]
# How to build ClickHouse under freebsd 11+
# Variant 1: Use pkg:
# pkg install databases/clickhouse
# Variant 2: Use ports:
# make -C /usr/ports/databases/clickhouse install clean
# Run server:
# echo clickhouse_enable="YES" >> /etc/rc.conf.local
# service clickhouse restart
# Variant 3: Manual build:
# pkg install -y curl sudo
# curl https://raw.githubusercontent.com/yandex/ClickHouse/master/doc/build_freebsd.sh | sh
# install compiler and libs
sudo pkg install git cmake bash mysql57-client icu libltdl unixODBC google-perftools
# install compiler and libs
sudo pkg install devel/git devel/cmake shells/bash devel/icu devel/libltdl databases/unixODBC devel/google-perftools devel/libzookeeper devel/libdouble-conversion archivers/zstd archivers/liblz4 devel/sparsehash devel/re2
# install testing only stuff if you want:
sudo pkg install python py27-lxml py27-termcolor curl perl5
# install testing only stuff if you want:
sudo pkg install lang/python devel/py-lxml devel/py-termcolor ftp/curl perl5
# Checkout ClickHouse sources
# If you want ODBC support: Check UNIXODBC option:
# make -C /usr/ports/devel/poco config reinstall
# Checkout ClickHouse sources
git clone https://github.com/yandex/ClickHouse.git
# Build!
# Build!
mkdir -p ClickHouse/build
cd ClickHouse/build
cmake .. -DUSE_INTERNAL_GPERFTOOLS_LIBRARY=0
# WIP: variant with libs from ports:
# sudo pkg install devel/boost-libs devel/libzookeeper devel/libdouble-conversion archivers/zstd archivers/liblz4 devel/sparsehash devel/re2
# Check UNIXODBC option:
# make -C /usr/ports/devel/poco config reinstall
# cmake .. -DUNBUNDLED=1 -DUSE_STATIC_LIBRARIES=0 -DNO_WERROR=1
cmake .. -DUNBUNDLED=1 -DUSE_STATIC_LIBRARIES=0 -DNO_WERROR=1 -DUSE_INTERNAL_BOOST_LIBRARY=1
# build with boost 1.64 from ports temporary broken
make -C dbms/src/Server -j $(nproc || sysctl -n hw.ncpu || echo 2)
cd ../..
# run server:
# Run server:
# ClickHouse/build/dbms/src/Server/clickhouse --server --config-file=ClickHouse/dbms/src/Server/config.xml &
# run client:
# Run client:
# ClickHouse/build/dbms/src/Server/clickhouse --client