Skip to content

Instantly share code, notes, and snippets.

@alexey-milovidov
Created August 21, 2019 02:59
Show Gist options
  • Select an option

  • Save alexey-milovidov/4ddbe9efe9e93041042ae9aff32acfc5 to your computer and use it in GitHub Desktop.

Select an option

Save alexey-milovidov/4ddbe9efe9e93041042ae9aff32acfc5 to your computer and use it in GitHub Desktop.
$ docker run --rm -it centos:7 /bin/bash
Unable to find image 'centos:7' locally
7: Pulling from library/centos
d8d02d457314: Pull complete
Digest: sha256:307835c385f656ec2e2fec602cf093224173c51119bbebd602c53c3653a3d6eb
Status: Downloaded newer image for centos:7
[root@295dd8ae621f /]# yum install yum-utils
Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
* base: mirror.docker.ru
* extras: mirror.docker.ru
* updates: mirror.docker.ru
base | 3.6 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/4): updates/7/x86_64/primary_db | 7.4 MB 00:00:00
(2/4): base/7/x86_64/primary_db | 6.0 MB 00:00:00
(3/4): base/7/x86_64/group_gz | 166 kB 00:00:01
(4/4): extras/7/x86_64/primary_db | 215 kB 00:00:02
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
Nothing to do
[root@295dd8ae621f /]# rpm --import https://repo.yandex.ru/clickhouse/CLICKHOUSE-KEY.GPG
[root@295dd8ae621f /]# yum-config-manager --add-repo https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
Loaded plugins: fastestmirror, ovl
adding repo from: https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
[repo.yandex.ru_clickhouse_rpm_stable_x86_64]
name=added from: https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
baseurl=https://repo.yandex.ru/clickhouse/rpm/stable/x86_64
enabled=1
[root@295dd8ae621f /]# yum install clickhouse-server clickhouse-client
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.docker.ru
* extras: mirror.docker.ru
* updates: mirror.docker.ru
repo.yandex.ru_clickhouse_rpm_stable_x86_64 | 3.0 kB 00:00:00
repo.yandex.ru_clickhouse_rpm_stable_x86_64/primary_db | 102 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package clickhouse-client.noarch 0:19.13.2.19-2 will be installed
--> Processing Dependency: clickhouse-common-static = 19.13.2.19-2 for package: clickhouse-client-19.13.2.19-2.noarch
---> Package clickhouse-server.noarch 0:19.13.2.19-2 will be installed
--> Processing Dependency: initscripts for package: clickhouse-server-19.13.2.19-2.noarch
--> Running transaction check
---> Package clickhouse-common-static.x86_64 0:19.13.2.19-2 will be installed
---> Package initscripts.x86_64 0:9.49.46-1.el7 will be installed
--> Processing Dependency: sysvinit-tools >= 2.87-5 for package: initscripts-9.49.46-1.el7.x86_64
--> Processing Dependency: iproute for package: initscripts-9.49.46-1.el7.x86_64
--> Running transaction check
---> Package iproute.x86_64 0:4.11.0-14.el7_6.2 will be installed
--> Processing Dependency: libmnl.so.0(LIBMNL_1.0)(64bit) for package: iproute-4.11.0-14.el7_6.2.x86_64
--> Processing Dependency: libxtables.so.10()(64bit) for package: iproute-4.11.0-14.el7_6.2.x86_64
--> Processing Dependency: libmnl.so.0()(64bit) for package: iproute-4.11.0-14.el7_6.2.x86_64
---> Package sysvinit-tools.x86_64 0:2.88-14.dsf.el7 will be installed
--> Running transaction check
---> Package iptables.x86_64 0:1.4.21-28.el7 will be installed
--> Processing Dependency: libnfnetlink.so.0()(64bit) for package: iptables-1.4.21-28.el7.x86_64
--> Processing Dependency: libnetfilter_conntrack.so.3()(64bit) for package: iptables-1.4.21-28.el7.x86_64
---> Package libmnl.x86_64 0:1.0.3-7.el7 will be installed
--> Running transaction check
---> Package libnetfilter_conntrack.x86_64 0:1.0.6-1.el7_3 will be installed
---> Package libnfnetlink.x86_64 0:1.0.1-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================================================
Installing:
clickhouse-client noarch 19.13.2.19-2 repo.yandex.ru_clickhouse_rpm_stable_x86_64 20 k
clickhouse-server noarch 19.13.2.19-2 repo.yandex.ru_clickhouse_rpm_stable_x86_64 39 k
Installing for dependencies:
clickhouse-common-static x86_64 19.13.2.19-2 repo.yandex.ru_clickhouse_rpm_stable_x86_64 109 M
initscripts x86_64 9.49.46-1.el7 base 439 k
iproute x86_64 4.11.0-14.el7_6.2 updates 764 k
iptables x86_64 1.4.21-28.el7 base 433 k
libmnl x86_64 1.0.3-7.el7 base 23 k
libnetfilter_conntrack x86_64 1.0.6-1.el7_3 base 55 k
libnfnetlink x86_64 1.0.1-4.el7 base 26 k
sysvinit-tools x86_64 2.88-14.dsf.el7 base 63 k
Transaction Summary
=========================================================================================================================================================================================================================================
Install 2 Packages (+8 Dependent packages)
Total download size: 111 M
Installed size: 357 M
Is this ok [y/d/N]: y
Downloading packages:
(1/10): clickhouse-client-19.13.2.19-2.noarch.rpm | 20 kB 00:00:00
(2/10): clickhouse-server-19.13.2.19-2.noarch.rpm | 39 kB 00:00:00
warning: /var/cache/yum/x86_64/7/base/packages/initscripts-9.49.46-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY ] 0.0 B/s | 4.1 MB --:--:-- ETA
Public key for initscripts-9.49.46-1.el7.x86_64.rpm is not installed
(3/10): initscripts-9.49.46-1.el7.x86_64.rpm | 439 kB 00:00:00
(4/10): iptables-1.4.21-28.el7.x86_64.rpm | 433 kB 00:00:00
(5/10): libmnl-1.0.3-7.el7.x86_64.rpm | 23 kB 00:00:00
(6/10): libnetfilter_conntrack-1.0.6-1.el7_3.x86_64.rpm | 55 kB 00:00:00
(7/10): libnfnetlink-1.0.1-4.el7.x86_64.rpm | 26 kB 00:00:00
(8/10): sysvinit-tools-2.88-14.dsf.el7.x86_64.rpm | 63 kB 00:00:00
Public key for iproute-4.11.0-14.el7_6.2.x86_64.rpm is not installed 36% [=================================- ] 13 MB/s | 41 MB 00:00:05 ETA
(9/10): iproute-4.11.0-14.el7_6.2.x86_64.rpm | 764 kB 00:00:02
(10/10): clickhouse-common-static-19.13.2.19-2.x86_64.rpm | 109 MB 00:00:09
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 12 MB/s | 111 MB 00:00:09
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-6.1810.2.el7.centos.x86_64 (@CentOS)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libnfnetlink-1.0.1-4.el7.x86_64 1/10
Installing : libmnl-1.0.3-7.el7.x86_64 2/10
Installing : clickhouse-common-static-19.13.2.19-2.x86_64 3/10
Installing : libnetfilter_conntrack-1.0.6-1.el7_3.x86_64 4/10
Installing : iptables-1.4.21-28.el7.x86_64 5/10
Installing : iproute-4.11.0-14.el7_6.2.x86_64 6/10
Installing : sysvinit-tools-2.88-14.dsf.el7.x86_64 7/10
Installing : initscripts-9.49.46-1.el7.x86_64 8/10
Installing : clickhouse-server-19.13.2.19-2.noarch 9/10
/var/tmp/rpm-tmp.Ckr8JU: line 124: /tmp/test_setcap.sh: Operation not permitted
Cannot set 'net_admin' or 'ipc_lock' or 'sys_nice' capability for clickhouse binary. This is optional. Taskstats accounting will be disabled. To enable taskstats accounting you may add the required capability later manually.
Installing : clickhouse-client-19.13.2.19-2.noarch 10/10
Verifying : clickhouse-common-static-19.13.2.19-2.x86_64 1/10
Verifying : clickhouse-server-19.13.2.19-2.noarch 2/10
Verifying : libmnl-1.0.3-7.el7.x86_64 3/10
Verifying : iproute-4.11.0-14.el7_6.2.x86_64 4/10
Verifying : clickhouse-client-19.13.2.19-2.noarch 5/10
Verifying : libnfnetlink-1.0.1-4.el7.x86_64 6/10
Verifying : sysvinit-tools-2.88-14.dsf.el7.x86_64 7/10
Verifying : initscripts-9.49.46-1.el7.x86_64 8/10
Verifying : libnetfilter_conntrack-1.0.6-1.el7_3.x86_64 9/10
Verifying : iptables-1.4.21-28.el7.x86_64 10/10
Installed:
clickhouse-client.noarch 0:19.13.2.19-2 clickhouse-server.noarch 0:19.13.2.19-2
Dependency Installed:
clickhouse-common-static.x86_64 0:19.13.2.19-2 initscripts.x86_64 0:9.49.46-1.el7 iproute.x86_64 0:4.11.0-14.el7_6.2 iptables.x86_64 0:1.4.21-28.el7 libmnl.x86_64 0:1.0.3-7.el7 libnetfilter_conntrack.x86_64 0:1.0.6-1.el7_3
libnfnetlink.x86_64 0:1.0.1-4.el7 sysvinit-tools.x86_64 0:2.88-14.dsf.el7
Complete!
[root@295dd8ae621f /]# /etc/init.d/clickhouse-server start
Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/
DONE
[root@295dd8ae621f /]# clickhouse-client
ClickHouse client version 19.13.2.19 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.13.2 revision 54425.
295dd8ae621f :) SELECT throwIf(1)
SELECT throwIf(1)
Received exception from server (version 19.13.2):
Code: 395. DB::Exception: Received from localhost:9000. DB::Exception: Value passed to 'throwIf' function is non zero.
0 rows in set. Elapsed: 0.147 sec.
295dd8ae621f :) SELECT multiIf(id>2, id, id-1) FROM trips2;
SELECT multiIf(id > 2, id, id - 1)
FROM trips2
Received exception from server (version 19.13.2):
Code: 60. DB::Exception: Received from localhost:9000. DB::Exception: Table default.trips2 doesn't exist..
0 rows in set. Elapsed: 0.090 sec.
295dd8ae621f :) SELECT multiIf(id = 1, arrayPushBack([],id), NULL) FROM trips
SELECT multiIf(id = 1, arrayPushBack([], id), NULL)
FROM trips
Received exception from server (version 19.13.2):
Code: 60. DB::Exception: Received from localhost:9000. DB::Exception: Table default.trips doesn't exist..
0 rows in set. Elapsed: 0.001 sec.
295dd8ae621f :) CREATE TABLE trips
:-] (
:-] trip_id UInt32,
:-] vendor_id String,
:-] pickup_datetime DateTime,
:-] dropoff_datetime Nullable(DateTime),
:-] store_and_fwd_flag Nullable(FixedString(1)),
:-] rate_code_id Nullable(UInt8),
:-] pickup_longitude Nullable(Float64),
:-] pickup_latitude Nullable(Float64),
:-] dropoff_longitude Nullable(Float64),
:-] dropoff_latitude Nullable(Float64),
:-] passenger_count Nullable(UInt8),
:-] trip_distance Nullable(Float64),
:-] fare_amount Nullable(Float32),
:-] extra Nullable(Float32),
:-] mta_tax Nullable(Float32),
:-] tip_amount Nullable(Float32),
:-] tolls_amount Nullable(Float32),
:-] ehail_fee Nullable(Float32),
:-] improvement_surcharge Nullable(Float32),
:-] total_amount Nullable(Float32),
:-] payment_type Nullable(String),
:-] trip_type Nullable(UInt8),
:-] pickup Nullable(String),
:-] dropoff Nullable(String),
:-] cab_type Nullable(String),
:-] precipitation Nullable(UInt8),
:-] snow_depth Nullable(UInt8),
:-] snowfall Nullable(UInt8),
:-] max_temperature Nullable(UInt8),
:-] min_temperature Nullable(UInt8),
:-] average_wind_speed Nullable(UInt8),
:-] pickup_nyct2010_gid Nullable(UInt8),
:-] pickup_ctlabel Nullable(String),
:-] pickup_borocode Nullable(UInt8),
:-] pickup_boroname Nullable(String),
:-] pickup_ct2010 Nullable(String),
:-] pickup_boroct2010 Nullable(String),
:-] pickup_cdeligibil Nullable(FixedString(1)),
:-] pickup_ntacode Nullable(String),
:-] pickup_ntaname Nullable(String),
:-] pickup_puma Nullable(String),
:-] dropoff_nyct2010_gid Nullable(UInt8),
:-] dropoff_ctlabel Nullable(String),
:-] dropoff_borocode Nullable(UInt8),
:-] dropoff_boroname Nullable(String),
:-] dropoff_ct2010 Nullable(String),
:-] dropoff_boroct2010 Nullable(String),
:-] dropoff_cdeligibil Nullable(String),
:-] dropoff_ntacode Nullable(String),
:-] dropoff_ntaname Nullable(String),
:-] dropoff_puma Nullable(String)
:-] ) ENGINE = Log;
CREATE TABLE trips
(
`trip_id` UInt32,
`vendor_id` String,
`pickup_datetime` DateTime,
`dropoff_datetime` Nullable(DateTime),
`store_and_fwd_flag` Nullable(FixedString(1)),
`rate_code_id` Nullable(UInt8),
`pickup_longitude` Nullable(Float64),
`pickup_latitude` Nullable(Float64),
`dropoff_longitude` Nullable(Float64),
`dropoff_latitude` Nullable(Float64),
`passenger_count` Nullable(UInt8),
`trip_distance` Nullable(Float64),
`fare_amount` Nullable(Float32),
`extra` Nullable(Float32),
`mta_tax` Nullable(Float32),
`tip_amount` Nullable(Float32),
`tolls_amount` Nullable(Float32),
`ehail_fee` Nullable(Float32),
`improvement_surcharge` Nullable(Float32),
`total_amount` Nullable(Float32),
`payment_type` Nullable(String),
`trip_type` Nullable(UInt8),
`pickup` Nullable(String),
`dropoff` Nullable(String),
`cab_type` Nullable(String),
`precipitation` Nullable(UInt8),
`snow_depth` Nullable(UInt8),
`snowfall` Nullable(UInt8),
`max_temperature` Nullable(UInt8),
`min_temperature` Nullable(UInt8),
`average_wind_speed` Nullable(UInt8),
`pickup_nyct2010_gid` Nullable(UInt8),
`pickup_ctlabel` Nullable(String),
`pickup_borocode` Nullable(UInt8),
`pickup_boroname` Nullable(String),
`pickup_ct2010` Nullable(String),
`pickup_boroct2010` Nullable(String),
`pickup_cdeligibil` Nullable(FixedString(1)),
`pickup_ntacode` Nullable(String),
`pickup_ntaname` Nullable(String),
`pickup_puma` Nullable(String),
`dropoff_nyct2010_gid` Nullable(UInt8),
`dropoff_ctlabel` Nullable(String),
`dropoff_borocode` Nullable(UInt8),
`dropoff_boroname` Nullable(String),
`dropoff_ct2010` Nullable(String),
`dropoff_boroct2010` Nullable(String),
`dropoff_cdeligibil` Nullable(String),
`dropoff_ntacode` Nullable(String),
`dropoff_ntaname` Nullable(String),
`dropoff_puma` Nullable(String)
)
ENGINE = Log
Ok.
0 rows in set. Elapsed: 0.015 sec.
295dd8ae621f :) SELECT multiIf(id = 1, arrayPushBack([],id), NULL) FROM trips
SELECT multiIf(id = 1, arrayPushBack([], id), NULL)
FROM trips
Received exception from server (version 19.13.2):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'id' while processing query: 'SELECT multiIf(id = 1, arrayPushBack([], id), NULL) FROM trips', required columns: 'id', source columns: 'dropoff_puma' 'dropoff_ntaname' 'dropoff_ntacode' 'dropoff_cdeligibil' 'ehail_fee' 'fare_amount' 'tip_amount' 'dropoff_ctlabel' 'store_and_fwd_flag' 'vendor_id' 'dropoff_latitude' 'snow_depth' 'dropoff_borocode' 'improvement_surcharge' 'pickup_datetime' 'max_temperature' 'pickup_cdeligibil' 'pickup_longitude' 'pickup_ntaname' 'pickup_latitude' 'pickup_puma' 'trip_type' 'payment_type' 'cab_type' 'dropoff_datetime' 'total_amount' 'trip_id' 'dropoff_longitude' 'dropoff_boroct2010' 'mta_tax' 'dropoff' 'pickup_boroname' 'pickup_boroct2010' 'precipitation' 'snowfall' 'min_temperature' 'passenger_count' 'pickup_nyct2010_gid' 'trip_distance' 'pickup_ctlabel' 'rate_code_id' 'pickup_borocode' 'pickup_ct2010' 'average_wind_speed' 'pickup_ntacode' 'extra' 'dropoff_ct2010' 'dropoff_nyct2010_gid' 'pickup' 'tolls_amount' 'dropoff_boroname'.
0 rows in set. Elapsed: 0.085 sec.
295dd8ae621f :) Bye.
[root@295dd8ae621f /]# clickhouse-client --stacktrace
ClickHouse client version 19.13.2.19 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.13.2 revision 54425.
295dd8ae621f :) SELECT multiIf(id = 1, arrayPushBack([],id), NULL) FROM trips
SELECT multiIf(id = 1, arrayPushBack([], id), NULL)
FROM trips
Received exception from server (version 19.13.2):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'id' while processing query: 'SELECT multiIf(id = 1, arrayPushBack([], id), NULL) FROM trips', required columns: 'id', source columns: 'dropoff_puma' 'dropoff_ntaname' 'dropoff_ntacode' 'dropoff_cdeligibil' 'ehail_fee' 'fare_amount' 'tip_amount' 'dropoff_ctlabel' 'store_and_fwd_flag' 'vendor_id' 'dropoff_latitude' 'snow_depth' 'dropoff_borocode' 'improvement_surcharge' 'pickup_datetime' 'max_temperature' 'pickup_cdeligibil' 'pickup_longitude' 'pickup_ntaname' 'pickup_latitude' 'pickup_puma' 'trip_type' 'payment_type' 'cab_type' 'dropoff_datetime' 'total_amount' 'trip_id' 'dropoff_longitude' 'dropoff_boroct2010' 'mta_tax' 'dropoff' 'pickup_boroname' 'pickup_boroct2010' 'precipitation' 'snowfall' 'min_temperature' 'passenger_count' 'pickup_nyct2010_gid' 'trip_distance' 'pickup_ctlabel' 'rate_code_id' 'pickup_borocode' 'pickup_ct2010' 'average_wind_speed' 'pickup_ntacode' 'extra' 'dropoff_ct2010' 'dropoff_nyct2010_gid' 'pickup' 'tolls_amount' 'dropoff_boroname'. Stack trace:
0. clickhouse-server(StackTrace::StackTrace()+0x30) [0x7f6a570]
1. clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)+0x25) [0x3c464b5]
2. clickhouse-server() [0x3a54501]
3. clickhouse-server(DB::ExpressionAnalyzer::ExpressionAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::SyntaxAnalyzerResult const> const&, DB::Context const&, DB::NamesAndTypesList const&, std::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned long, bool, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, DB::SubqueryForSet, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, DB::SubqueryForSet> > > const&)+0x623) [0x749ff33]
4. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x66b) [0x6d6d86b]
5. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x37) [0x6d6e2a7]
6. clickhouse-server(DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x798) [0x6d8d618]
7. clickhouse-server(DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum)+0x1b8) [0x6d4fbf8]
8. clickhouse-server() [0x6e9997f]
9. clickhouse-server(DB::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)+0xfc) [0x6e99d0c]
10. clickhouse-server(DB::TCPHandler::runImpl()+0x9fa) [0x3c87c0a]
11. clickhouse-server(DB::TCPHandler::run()+0x2b) [0x3c884cb]
12. clickhouse-server(Poco::Net::TCPServerConnection::start()+0x10) [0x793e410]
13. clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0xed) [0x793eb2d]
14. clickhouse-server(Poco::PooledThread::run()+0x81) [0x8069461]
15. clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0x3c) [0x806720c]
16. clickhouse-server() [0xba3d0e0]
17. /lib64/libpthread.so.0(+0x7dd5) [0x7efec128cdd5]
18. /lib64/libc.so.6(clone+0x6d) [0x7efec0ab002d]
0 rows in set. Elapsed: 0.002 sec.
295dd8ae621f :) Bye.
[root@295dd8ae621f /]# less /var/log/clickhouse-server/clickhouse-server.log
bash: less: command not found
[root@295dd8ae621f /]# yum install less
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.docker.ru
* extras: mirror.docker.ru
* updates: mirror.docker.ru
Resolving Dependencies
--> Running transaction check
---> Package less.x86_64 0:458-9.el7 will be installed
--> Processing Dependency: groff-base for package: less-458-9.el7.x86_64
--> Running transaction check
---> Package groff-base.x86_64 0:1.22.2-8.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================================================
Installing:
less x86_64 458-9.el7 base 120 k
Installing for dependencies:
groff-base x86_64 1.22.2-8.el7 base 942 k
Transaction Summary
=========================================================================================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 1.0 M
Installed size: 3.5 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): less-458-9.el7.x86_64.rpm | 120 kB 00:00:00
(2/2): groff-base-1.22.2-8.el7.x86_64.rpm | 942 kB 00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.6 MB/s | 1.0 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : groff-base-1.22.2-8.el7.x86_64 1/2
Installing : less-458-9.el7.x86_64 2/2
Verifying : groff-base-1.22.2-8.el7.x86_64 1/2
Verifying : less-458-9.el7.x86_64 2/2
Installed:
less.x86_64 0:458-9.el7
Dependency Installed:
groff-base.x86_64 0:1.22.2-8.el7
Complete!
[root@295dd8ae621f /]# less /var/log/clickhouse-server/clickhouse-server.log
[root@295dd8ae621f /]# yum install clickhouse-common-static-dbg
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.docker.ru
* extras: mirror.docker.ru
* updates: mirror.docker.ru
Resolving Dependencies
--> Running transaction check
---> Package clickhouse-common-static-dbg.x86_64 0:19.13.2.19-2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================================================================================
Installing:
clickhouse-common-static-dbg x86_64 19.13.2.19-2 repo.yandex.ru_clickhouse_rpm_stable_x86_64 793 M
Transaction Summary
=========================================================================================================================================================================================================================================
Install 1 Package
Total download size: 793 M
Installed size: 2.8 G
Is this ok [y/d/N]: y
Downloading packages:
clickhouse-common-static-dbg-19.13.2.19-2.x86_64.rpm | 793 MB 00:00:51
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : clickhouse-common-static-dbg-19.13.2.19-2.x86_64 1/1
Verifying : clickhouse-common-static-dbg-19.13.2.19-2.x86_64 1/1
Installed:
clickhouse-common-static-dbg.x86_64 0:19.13.2.19-2
Complete!
[root@295dd8ae621f /]# clickhouse-client --stacktrace
^[[AClickHouse client version 19.13.2.19 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.13.2 revision 54425.
295dd8ae621f :) SELECT multiIf(id = 1, arrayPushBack([],id), NULL) FROM trips
SELECT multiIf(id = 1, arrayPushBack([], id), NULL)
FROM trips
Received exception from server (version 19.13.2):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'id' while processing query: 'SELECT multiIf(id = 1, arrayPushBack([], id), NULL) FROM trips', required columns: 'id', source columns: 'dropoff_puma' 'dropoff_ntaname' 'dropoff_ntacode' 'dropoff_cdeligibil' 'ehail_fee' 'fare_amount' 'tip_amount' 'dropoff_ctlabel' 'store_and_fwd_flag' 'vendor_id' 'dropoff_latitude' 'snow_depth' 'dropoff_borocode' 'improvement_surcharge' 'pickup_datetime' 'max_temperature' 'pickup_cdeligibil' 'pickup_longitude' 'pickup_ntaname' 'pickup_latitude' 'pickup_puma' 'trip_type' 'payment_type' 'cab_type' 'dropoff_datetime' 'total_amount' 'trip_id' 'dropoff_longitude' 'dropoff_boroct2010' 'mta_tax' 'dropoff' 'pickup_boroname' 'pickup_boroct2010' 'precipitation' 'snowfall' 'min_temperature' 'passenger_count' 'pickup_nyct2010_gid' 'trip_distance' 'pickup_ctlabel' 'rate_code_id' 'pickup_borocode' 'pickup_ct2010' 'average_wind_speed' 'pickup_ntacode' 'extra' 'dropoff_ct2010' 'dropoff_nyct2010_gid' 'pickup' 'tolls_amount' 'dropoff_boroname'. Stack trace:
0. clickhouse-server(StackTrace::StackTrace()+0x30) [0x7f6a570]
1. clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)+0x25) [0x3c464b5]
2. clickhouse-server() [0x3a54501]
3. clickhouse-server(DB::ExpressionAnalyzer::ExpressionAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::SyntaxAnalyzerResult const> const&, DB::Context const&, DB::NamesAndTypesList const&, std::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned long, bool, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, DB::SubqueryForSet, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, DB::SubqueryForSet> > > const&)+0x623) [0x749ff33]
4. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x66b) [0x6d6d86b]
5. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x37) [0x6d6e2a7]
6. clickhouse-server(DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x798) [0x6d8d618]
7. clickhouse-server(DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum)+0x1b8) [0x6d4fbf8]
8. clickhouse-server() [0x6e9997f]
9. clickhouse-server(DB::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)+0xfc) [0x6e99d0c]
10. clickhouse-server(DB::TCPHandler::runImpl()+0x9fa) [0x3c87c0a]
11. clickhouse-server(DB::TCPHandler::run()+0x2b) [0x3c884cb]
12. clickhouse-server(Poco::Net::TCPServerConnection::start()+0x10) [0x793e410]
13. clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0xed) [0x793eb2d]
14. clickhouse-server(Poco::PooledThread::run()+0x81) [0x8069461]
15. clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0x3c) [0x806720c]
16. clickhouse-server() [0xba3d0e0]
17. /lib64/libpthread.so.0(+0x7dd5) [0x7efec128cdd5]
18. /lib64/libc.so.6(clone+0x6d) [0x7efec0ab002d]
0 rows in set. Elapsed: 0.037 sec.
295dd8ae621f :) Bye.
[root@295dd8ae621f /]# /etc/init.d/clickhouse-server restart
Stop clickhouse-server service: DONE
Start clickhouse-server service: Path to data directory in /etc/clickhouse-server/config.xml: /var/lib/clickhouse/
^[[ADONE
[root@295dd8ae621f /]# clickhouse-client --stacktrace
ClickHouse client version 19.13.2.19 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.13.2 revision 54425.
295dd8ae621f :) SELECT multiIf(id = 1, arrayPushBack([],id), NULL) FROM trips
SELECT multiIf(id = 1, arrayPushBack([], id), NULL)
FROM trips
Received exception from server (version 19.13.2):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'id' while processing query: 'SELECT multiIf(id = 1, arrayPushBack([], id), NULL) FROM trips', required columns: 'id', source columns: 'dropoff_puma' 'dropoff_ntaname' 'dropoff_ntacode' 'dropoff_cdeligibil' 'ehail_fee' 'fare_amount' 'tip_amount' 'dropoff_ctlabel' 'store_and_fwd_flag' 'vendor_id' 'dropoff_latitude' 'snow_depth' 'dropoff_borocode' 'improvement_surcharge' 'pickup_datetime' 'max_temperature' 'pickup_cdeligibil' 'pickup_longitude' 'pickup_ntaname' 'pickup_latitude' 'pickup_puma' 'trip_type' 'payment_type' 'cab_type' 'dropoff_datetime' 'total_amount' 'trip_id' 'dropoff_longitude' 'dropoff_boroct2010' 'mta_tax' 'dropoff' 'pickup_boroname' 'pickup_boroct2010' 'precipitation' 'snowfall' 'min_temperature' 'passenger_count' 'pickup_nyct2010_gid' 'trip_distance' 'pickup_ctlabel' 'rate_code_id' 'pickup_borocode' 'pickup_ct2010' 'average_wind_speed' 'pickup_ntacode' 'extra' 'dropoff_ct2010' 'dropoff_nyct2010_gid' 'pickup' 'tolls_amount' 'dropoff_boroname'. Stack trace:
0. clickhouse-server(StackTrace::StackTrace()+0x30) [0x7f6a570]
1. clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)+0x25) [0x3c464b5]
2. clickhouse-server() [0x3a54501]
3. clickhouse-server(DB::ExpressionAnalyzer::ExpressionAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::SyntaxAnalyzerResult const> const&, DB::Context const&, DB::NamesAndTypesList const&, std::unordered_set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, unsigned long, bool, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, DB::SubqueryForSet, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, DB::SubqueryForSet> > > const&)+0x623) [0x749ff33]
4. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x66b) [0x6d6d86b]
5. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x37) [0x6d6e2a7]
6. clickhouse-server(DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)+0x798) [0x6d8d618]
7. clickhouse-server(DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum)+0x1b8) [0x6d4fbf8]
8. clickhouse-server() [0x6e9997f]
9. clickhouse-server(DB::executeQuery(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool)+0xfc) [0x6e99d0c]
10. clickhouse-server(DB::TCPHandler::runImpl()+0x9fa) [0x3c87c0a]
11. clickhouse-server(DB::TCPHandler::run()+0x2b) [0x3c884cb]
12. clickhouse-server(Poco::Net::TCPServerConnection::start()+0x10) [0x793e410]
13. clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0xed) [0x793eb2d]
14. clickhouse-server(Poco::PooledThread::run()+0x81) [0x8069461]
15. clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0x3c) [0x806720c]
16. clickhouse-server() [0xba3d0e0]
17. /lib64/libpthread.so.0(+0x7dd5) [0x7fb925a16dd5]
18. /lib64/libc.so.6(clone+0x6d) [0x7fb92523a02d]
0 rows in set. Elapsed: 0.068 sec.
295dd8ae621f :) Bye.
[root@295dd8ae621f /]# less /var/log/clickhouse-server/clickhouse-server.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment