mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
Merge remote-tracking branch 'upstream/master' into fix4
This commit is contained in:
commit
8b3d3cf56f
@ -35,7 +35,7 @@ String getTableDefinitionFromCreateQuery(const ASTPtr & query)
|
|||||||
create.select = nullptr;
|
create.select = nullptr;
|
||||||
|
|
||||||
/// For "MATERIALIZED VIEW x TO y" it's necessary to save destination table
|
/// For "MATERIALIZED VIEW x TO y" it's necessary to save destination table
|
||||||
if (!(create.is_materialized_view && !create.storage))
|
if (!create.is_materialized_view || create.storage)
|
||||||
{
|
{
|
||||||
create.as_database.clear();
|
create.as_database.clear();
|
||||||
create.as_table.clear();
|
create.as_table.clear();
|
||||||
|
@ -364,6 +364,8 @@ bool ParserCreateQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
|||||||
{
|
{
|
||||||
to_table = true;
|
to_table = true;
|
||||||
|
|
||||||
|
/// FIXME: as_table is ambiguous, it is set in AS clause also
|
||||||
|
|
||||||
if (!name_p.parse(pos, as_table, expected))
|
if (!name_p.parse(pos, as_table, expected))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ StorageMaterializedView::StorageMaterializedView(
|
|||||||
DatabaseAndTableName(database_name, table_name));
|
DatabaseAndTableName(database_name, table_name));
|
||||||
|
|
||||||
// If the destination table is not set, use inner table
|
// If the destination table is not set, use inner table
|
||||||
if (!query.storage)
|
if (!query.as_table.empty())
|
||||||
{
|
{
|
||||||
target_database_name = query.as_database;
|
target_database_name = query.as_database;
|
||||||
target_table_name = query.as_table;
|
target_table_name = query.as_table;
|
||||||
|
@ -5,7 +5,8 @@ max_block_size=100
|
|||||||
URL='http://localhost:8123/'
|
URL='http://localhost:8123/'
|
||||||
|
|
||||||
function query {
|
function query {
|
||||||
echo "SELECT toUInt8(intHash64(number)) FROM system.numbers LIMIT $1 FORMAT RowBinary"
|
# bash isn't able to store \0 bytes, so use [1; 255] random range
|
||||||
|
echo "SELECT greatest(toUInt8(1), toUInt8(intHash64(number))) FROM system.numbers LIMIT $1 FORMAT RowBinary"
|
||||||
}
|
}
|
||||||
|
|
||||||
function ch_url() {
|
function ch_url() {
|
||||||
@ -81,13 +82,12 @@ check_cli_and_http
|
|||||||
|
|
||||||
|
|
||||||
# Check HTTP internal compression in normal case
|
# Check HTTP internal compression in normal case
|
||||||
# Skip if clickhouse-compressor not installed
|
|
||||||
|
|
||||||
function cmp_http_compression() {
|
function cmp_http_compression() {
|
||||||
clickhouse-client -q "`query $1`" > res0
|
clickhouse-client -q "`query $1`" > res0
|
||||||
ch_url 'compress=1' $1 | clickhouse-compressor --decompress > res1
|
ch_url 'compress=1' $1 | clickhouse compressor --decompress > res1
|
||||||
ch_url "compress=1&buffer_size=$2&wait_end_of_query=0" $1 | clickhouse-compressor --decompress > res2
|
ch_url "compress=1&buffer_size=$2&wait_end_of_query=0" $1 | clickhouse compressor --decompress > res2
|
||||||
ch_url "compress=1&buffer_size=$2&wait_end_of_query=1" $1 | clickhouse-compressor --decompress > res3
|
ch_url "compress=1&buffer_size=$2&wait_end_of_query=1" $1 | clickhouse compressor --decompress > res3
|
||||||
cmp res0 res1
|
cmp res0 res1
|
||||||
cmp res1 res2
|
cmp res1 res2
|
||||||
cmp res1 res3
|
cmp res1 res3
|
||||||
@ -103,8 +103,4 @@ function check_http_compression() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
has_compressor=$(command -v clickhouse-compressor &>/dev/null && echo 1 || echo 0)
|
check_http_compression
|
||||||
|
|
||||||
if [[ $has_compressor -eq 1 ]]; then
|
|
||||||
check_http_compression
|
|
||||||
fi
|
|
||||||
|
@ -3,7 +3,7 @@ DROP TABLE IF EXISTS test.dst;
|
|||||||
DROP TABLE IF EXISTS test.mv;
|
DROP TABLE IF EXISTS test.mv;
|
||||||
|
|
||||||
CREATE TABLE test.src (x UInt8) ENGINE = Null;
|
CREATE TABLE test.src (x UInt8) ENGINE = Null;
|
||||||
CREATE TABLE test.dst (x UInt8) ENGINE = Memory();
|
CREATE TABLE test.dst (x UInt8) ENGINE = Memory;
|
||||||
|
|
||||||
CREATE MATERIALIZED VIEW test.mv TO test.dst AS SELECT * FROM test.src;
|
CREATE MATERIALIZED VIEW test.mv TO test.dst AS SELECT * FROM test.src;
|
||||||
INSERT INTO test.src VALUES (1), (2);
|
INSERT INTO test.src VALUES (1), (2);
|
||||||
|
Loading…
Reference in New Issue
Block a user