diff --git a/dbms/include/DB/Functions/FunctionsHigherOrder.h b/dbms/include/DB/Functions/FunctionsHigherOrder.h index 53bfa57f55d..ba911dc74cb 100644 --- a/dbms/include/DB/Functions/FunctionsHigherOrder.h +++ b/dbms/include/DB/Functions/FunctionsHigherOrder.h @@ -676,13 +676,13 @@ public: ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); if (!arguments[0].column) - throw Exception("First argument for function " + getName() + " must be an expression.", + throw Exception("Type of first argument for function " + getName() + " must be an expression.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); const ColumnExpression * column_expression = typeid_cast(arguments[0].column.get()); if (!column_expression) - throw Exception("First argument for function " + getName() + " must be an expression.", + throw Exception("Column of first argument for function " + getName() + " must be an expression.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); /// Типы остальных аргументов уже проверены в getLambdaArgumentTypes. diff --git a/dbms/tests/queries/0_stateless/00061_merge_tree_alter.reference b/dbms/tests/queries/0_stateless/00061_merge_tree_alter.reference index 84439c67c9a..48a896785fd 100644 --- a/dbms/tests/queries/0_stateless/00061_merge_tree_alter.reference +++ b/dbms/tests/queries/0_stateless/00061_merge_tree_alter.reference @@ -6,133 +6,96 @@ CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32) ENGINE = MergeTree(d, k d Date k UInt64 i32 Int32 -dt DateTime -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime) ENGINE = MergeTree(d, k, 8192) -2015-01-01 9 41 1992-01-01 08:00:00 -2015-01-01 10 42 0000-00-00 00:00:00 -d Date -k UInt64 -i32 Int32 -dt DateTime n.ui8 Array(UInt8) n.s Array(String) -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, `n.ui8` Array(UInt8), `n.s` Array(String)) ENGINE = MergeTree(d, k, 8192) -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] -2015-01-01 9 41 1992-01-01 08:00:00 [] [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, `n.ui8` Array(UInt8), `n.s` Array(String)) ENGINE = MergeTree(d, k, 8192) +2015-01-01 8 40 [1,2,3] ['12','13','14'] +2015-01-01 10 42 [] [] d Date k UInt64 i32 Int32 -dt DateTime n.ui8 Array(UInt8) n.s Array(String) n.d Array(Date) -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192) -2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 9 41 1992-01-01 08:00:00 [] [] [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] [] +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192) +2015-01-01 7 39 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] +2015-01-01 8 40 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 10 42 [] [] [] d Date k UInt64 i32 Int32 -dt DateTime n.ui8 Array(UInt8) n.s Array(String) n.d Array(Date) s String DEFAULT \'0\' -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date), s String DEFAULT \'0\') ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] ['2000-01-01','2000-01-01','2000-01-03'] 100500 -2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] 0 -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] 0 -2015-01-01 9 41 1992-01-01 08:00:00 [] [] [] 0 -2015-01-01 10 42 0000-00-00 00:00:00 [] [] [] 0 +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, `n.ui8` Array(UInt8), `n.s` Array(String), `n.d` Array(Date), s String DEFAULT \'0\') ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] ['2000-01-01','2000-01-01','2000-01-03'] 100500 +2015-01-01 7 39 [10,20,30] ['120','130','140'] ['2000-01-01','2000-01-01','2000-01-03'] 0 +2015-01-01 8 40 [1,2,3] ['12','13','14'] ['0000-00-00','0000-00-00','0000-00-00'] 0 +2015-01-01 10 42 [] [] [] 0 d Date k UInt64 i32 Int32 -dt DateTime n.ui8 Array(UInt8) n.s Array(String) s Int64 -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, `n.ui8` Array(UInt8), `n.s` Array(String), s Int64) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 -2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 -2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0 -2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0 +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, `n.ui8` Array(UInt8), `n.s` Array(String), s Int64) ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 +2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 +2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 +2015-01-01 10 42 [] [] 0 d Date k UInt64 i32 Int32 -dt DateTime n.ui8 Array(UInt8) n.s Array(String) s UInt32 n.d Array(Date) -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, `n.ui8` Array(UInt8), `n.s` Array(String), s UInt32, `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0 [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0 [] -2015-01-01 6 38 2014-07-15 13:26:50 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 7 39 2014-07-14 13:26:50 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 8 40 2012-12-12 12:12:12 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00'] -2015-01-01 9 41 1992-01-01 08:00:00 [] [] 0 [] -2015-01-01 10 42 0000-00-00 00:00:00 [] [] 0 [] +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, `n.ui8` Array(UInt8), `n.s` Array(String), s UInt32, `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 10 42 [] [] 0 [] +2015-01-01 6 38 [10,20,30] ['asd','qwe','qwe'] 100500 ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 7 39 [10,20,30] ['120','130','140'] 0 ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 8 40 [1,2,3] ['12','13','14'] 0 ['0000-00-00','0000-00-00','0000-00-00'] +2015-01-01 10 42 [] [] 0 [] d Date k UInt64 i32 Int32 -dt DateTime n.s Array(String) s UInt32 -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, `n.s` Array(String), s UInt32) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 ['asd','qwe','qwe'] 100500 -2015-01-01 7 39 2014-07-14 13:26:50 ['120','130','140'] 0 -2015-01-01 8 40 2012-12-12 12:12:12 ['12','13','14'] 0 -2015-01-01 9 41 1992-01-01 08:00:00 [] 0 -2015-01-01 10 42 0000-00-00 00:00:00 [] 0 +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, `n.s` Array(String), s UInt32) ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 ['asd','qwe','qwe'] 100500 +2015-01-01 7 39 ['120','130','140'] 0 +2015-01-01 8 40 ['12','13','14'] 0 +2015-01-01 10 42 [] 0 d Date k UInt64 i32 Int32 -dt DateTime s UInt32 -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, s UInt32) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 100500 -2015-01-01 7 39 2014-07-14 13:26:50 0 -2015-01-01 8 40 2012-12-12 12:12:12 0 -2015-01-01 9 41 1992-01-01 08:00:00 0 -2015-01-01 10 42 0000-00-00 00:00:00 0 +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, s UInt32) ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 100500 +2015-01-01 7 39 0 +2015-01-01 8 40 0 +2015-01-01 10 42 0 d Date k UInt64 i32 Int32 -dt DateTime s UInt32 n.s Array(String) n.d Array(Date) -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, s UInt32, `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 100500 [] [] -2015-01-01 7 39 2014-07-14 13:26:50 0 [] [] -2015-01-01 8 40 2012-12-12 12:12:12 0 [] [] -2015-01-01 9 41 1992-01-01 08:00:00 0 [] [] -2015-01-01 10 42 0000-00-00 00:00:00 0 [] [] +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, s UInt32, `n.s` Array(String), `n.d` Array(Date)) ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 100500 [] [] +2015-01-01 7 39 0 [] [] +2015-01-01 8 40 0 [] [] +2015-01-01 10 42 0 [] [] d Date k UInt64 i32 Int32 -dt DateTime s UInt32 -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt DateTime, s UInt32) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 13:26:50 100500 -2015-01-01 7 39 2014-07-14 13:26:50 0 -2015-01-01 8 40 2012-12-12 12:12:12 0 -2015-01-01 9 41 1992-01-01 08:00:00 0 -2015-01-01 10 42 0000-00-00 00:00:00 0 -d Date -k UInt64 -i32 Int32 -dt Date -s DateTime -CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, dt Date, s DateTime) ENGINE = MergeTree(d, k, 8192) -2015-01-01 6 38 2014-07-15 1970-01-02 06:55:00 -2015-01-01 7 39 2014-07-14 0000-00-00 00:00:00 -2015-01-01 8 40 2012-12-12 0000-00-00 00:00:00 -2015-01-01 9 41 1992-01-01 0000-00-00 00:00:00 -2015-01-01 10 42 0000-00-00 0000-00-00 00:00:00 +CREATE TABLE test.alter ( d Date, k UInt64, i32 Int32, s UInt32) ENGINE = MergeTree(d, k, 8192) +2015-01-01 6 38 100500 +2015-01-01 7 39 0 +2015-01-01 8 40 0 +2015-01-01 10 42 0 diff --git a/dbms/tests/queries/0_stateless/00061_merge_tree_alter.sql b/dbms/tests/queries/0_stateless/00061_merge_tree_alter.sql index 37bbf100038..07ac6f1bb88 100644 --- a/dbms/tests/queries/0_stateless/00061_merge_tree_alter.sql +++ b/dbms/tests/queries/0_stateless/00061_merge_tree_alter.sql @@ -7,29 +7,22 @@ DESC TABLE test.alter; SHOW CREATE TABLE test.alter; SELECT * FROM test.alter ORDER BY k; -ALTER TABLE test.alter ADD COLUMN dt DateTime; -INSERT INTO test.alter VALUES ('2015-01-01', 9, 41, '1992-01-01 08:00:00'); - -DESC TABLE test.alter; -SHOW CREATE TABLE test.alter; -SELECT * FROM test.alter ORDER BY k; - ALTER TABLE test.alter ADD COLUMN n Nested(ui8 UInt8, s String); -INSERT INTO test.alter VALUES ('2015-01-01', 8, 40, '2012-12-12 12:12:12', [1,2,3], ['12','13','14']); +INSERT INTO test.alter VALUES ('2015-01-01', 8, 40, [1,2,3], ['12','13','14']); DESC TABLE test.alter; SHOW CREATE TABLE test.alter; SELECT * FROM test.alter ORDER BY k; ALTER TABLE test.alter ADD COLUMN `n.d` Array(Date); -INSERT INTO test.alter VALUES ('2015-01-01', 7, 39, '2014-07-14 13:26:50', [10,20,30], ['120','130','140'],['2000-01-01','2000-01-01','2000-01-03']); +INSERT INTO test.alter VALUES ('2015-01-01', 7, 39, [10,20,30], ['120','130','140'],['2000-01-01','2000-01-01','2000-01-03']); DESC TABLE test.alter; SHOW CREATE TABLE test.alter; SELECT * FROM test.alter ORDER BY k; ALTER TABLE test.alter ADD COLUMN s String DEFAULT '0'; -INSERT INTO test.alter VALUES ('2015-01-01', 6,38,'2014-07-15 13:26:50',[10,20,30],['asd','qwe','qwe'],['2000-01-01','2000-01-01','2000-01-03'],'100500'); +INSERT INTO test.alter VALUES ('2015-01-01', 6,38,[10,20,30],['asd','qwe','qwe'],['2000-01-01','2000-01-01','2000-01-03'],'100500'); DESC TABLE test.alter; SHOW CREATE TABLE test.alter; @@ -75,10 +68,4 @@ DESC TABLE test.alter; SHOW CREATE TABLE test.alter; SELECT * FROM test.alter ORDER BY k; -ALTER TABLE test.alter MODIFY COLUMN dt Date, MODIFY COLUMN s DateTime; - -DESC TABLE test.alter; -SHOW CREATE TABLE test.alter; -SELECT * FROM test.alter ORDER BY k; - DROP TABLE test.alter; diff --git a/dbms/tests/queries/0_stateless/00189_time_zones.sql b/dbms/tests/queries/0_stateless/00189_time_zones.sql index e694d74befc..f12eaccb3a9 100644 --- a/dbms/tests/queries/0_stateless/00189_time_zones.sql +++ b/dbms/tests/queries/0_stateless/00189_time_zones.sql @@ -231,11 +231,11 @@ SELECT toString(toDateTime(x), 'Europe/London') FROM foo ORDER BY x ASC; /* toUnixTimestamp */ -SELECT toUnixTimestamp(toString(toDateTime(1426415400)), 'Europe/Moscow'); -SELECT toUnixTimestamp(toString(toDateTime(1426415400)), 'Europe/Paris'); -SELECT toUnixTimestamp(toString(toDateTime(1426415400)), 'Europe/London'); -SELECT toUnixTimestamp(toString(toDateTime(1426415400)), 'Asia/Tokyo'); -SELECT toUnixTimestamp(toString(toDateTime(1426415400)), 'Pacific/Pitcairn'); +SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), 'Europe/Moscow'); +SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), 'Europe/Paris'); +SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), 'Europe/London'); +SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), 'Asia/Tokyo'); +SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), 'Pacific/Pitcairn'); SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), 'Europe/Moscow'); SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Paris'), 'Europe/Paris'); @@ -243,6 +243,6 @@ SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/London'), 'Europ SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Asia/Tokyo'), 'Asia/Tokyo'); SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Pacific/Pitcairn'), 'Pacific/Pitcairn'); -SELECT toUnixTimestamp(toString(toDateTime(x)), y) FROM foo ORDER BY y ASC; -SELECT toUnixTimestamp(toString(toDateTime(1426415400)), y) FROM foo ORDER BY y ASC; -SELECT toUnixTimestamp(toString(toDateTime(x)), 'Europe/Paris') FROM foo ORDER BY x ASC; +SELECT toUnixTimestamp(toString(toDateTime(x), 'Europe/Moscow'), y) FROM foo ORDER BY y ASC; +SELECT toUnixTimestamp(toString(toDateTime(1426415400), 'Europe/Moscow'), y) FROM foo ORDER BY y ASC; +SELECT toUnixTimestamp(toString(toDateTime(x), 'Europe/Moscow'), 'Europe/Paris') FROM foo ORDER BY x ASC; diff --git a/dbms/tests/queries/0_stateless/00309_formats.reference b/dbms/tests/queries/0_stateless/00309_formats.reference index 3db707fbacd..48e7da45571 100644 Binary files a/dbms/tests/queries/0_stateless/00309_formats.reference and b/dbms/tests/queries/0_stateless/00309_formats.reference differ diff --git a/dbms/tests/queries/0_stateless/00309_formats.sql b/dbms/tests/queries/0_stateless/00309_formats.sql index f6669291a6e..470e4327715 100644 --- a/dbms/tests/queries/0_stateless/00309_formats.sql +++ b/dbms/tests/queries/0_stateless/00309_formats.sql @@ -1,8 +1,8 @@ SET output_format_write_statistics = 0; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT RowBinary; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT TabSeparatedWithNamesAndTypes; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT TabSeparatedRaw; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT CSV; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT JSON; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT JSONCompact; -SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, toDateTime(d) + n AS t, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d, t) AS tuple FROM system.numbers LIMIT 2 FORMAT XML; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT RowBinary; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT TabSeparatedWithNamesAndTypes; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT TabSeparatedRaw; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT CSV; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT JSON; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT JSONCompact; +SELECT number * 246 + 10 AS n, toDate('2000-01-01') + n AS d, range(n) AS arr, arrayStringConcat(arrayMap(x -> reinterpretAsString(x), arr)) AS s, (n, d) AS tuple FROM system.numbers LIMIT 2 FORMAT XML; diff --git a/doc/build_debian.sh b/doc/build_debian.sh new file mode 100755 index 00000000000..af48f547915 --- /dev/null +++ b/doc/build_debian.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# How to build ClickHouse under debian-based systems (ubuntu) + +# apt install -y curl sudo +# curl https://raw.githubusercontent.com/yandex/ClickHouse/master/doc/build_debian.sh | sh + +# install compiler and libs +sudo apt install -y git bash cmake gcc-6 g++-6 libicu-dev libreadline-dev libmysqlclient-dev unixodbc-dev libglib2.0-dev libltdl-dev libssl-dev + +# install testing only stuff if you want: +sudo apt install -y python python-lxml python-termcolor curl perl + +# Checkout ClickHouse sources +git clone https://github.com/yandex/ClickHouse.git + +# Build! +mkdir -p ClickHouse/build +cd ClickHouse/build +cmake .. -DCMAKE_CXX_COMPILER=`which g++-6` -DCMAKE_C_COMPILER=`which gcc-6` + +make -j $(nproc || sysctl -n hw.ncpu || echo 2) +cd .. diff --git a/doc/build_freebsd.sh b/doc/build_freebsd.sh index 0f0ac3f757c..272a4899c44 100755 --- a/doc/build_freebsd.sh +++ b/doc/build_freebsd.sh @@ -3,11 +3,14 @@ # How to build ClickHouse under freebsd 11+ # [temporary solution before port created] +# pkg install -y curl sudo +# curl https://raw.githubusercontent.com/yandex/ClickHouse/master/doc/build_freebsd.sh | sh + # install compiler and libs -pkg install -y git cmake gcc6 bash glib mysql57-client icu libltdl unixODBC +sudo pkg install -y git cmake gcc6 bash glib mysql57-client icu libltdl unixODBC # install testing only stuff if you want: -pkg install -y python py27-lxml py27-termcolor +sudo pkg install -y python py27-lxml py27-termcolor curl perl5 # Checkout ClickHouse sources git clone https://github.com/yandex/ClickHouse.git