Commit Graph

513 Commits

Author SHA1 Message Date
DF5HSE
c08bc7ad65 Merge branch 'master' of github.com:ClickHouse/ClickHouse into client-fault-tolerant-connection 2022-02-08 11:37:31 +03:00
DF5HSE
c1df291b18 Fix error with IPv6 in host param 2022-02-08 02:03:41 +03:00
DF5HSE
87933e44d6 Fix codestyle 2022-02-08 02:03:40 +03:00
DF5HSE
b035ad7843 Fix error with IPv6 in host param and impove HostPort reading from input stream 2022-02-08 02:03:39 +03:00
DF5HSE
3cb433762b Fix errors in build check 2022-02-08 02:03:39 +03:00
DF5HSE
18a777cc8b Add function which gets port from configuration 2022-02-08 02:03:37 +03:00
DF5HSE
69e535fcb2 Merge branch 'master' of github.com:ClickHouse/ClickHouse into client-fault-tolerant-connection 2022-02-08 02:03:36 +03:00
DF5HSE
e780c1292d Add tests, remove saving host in config 2022-02-08 02:03:35 +03:00
DF5HSE
03b4945704 Fix codestyle 2022-02-08 02:03:35 +03:00
kssenii
e41a895ebb Fix 2022-02-06 16:11:18 +01:00
Kseniia Sumarokova
4dee6488f9
Merge pull request #34265 from kssenii/add-query-id-for-client-queries-file
print query id when using `--interactive` with `--queries-file` in client/local
2022-02-05 17:23:33 +01:00
alexey-milovidov
768c71c1ac
Update ClientBase.cpp 2022-02-03 05:13:48 +03:00
Anton Popov
5bb1b3ce77 support async inserts in clickhouse-client for queries with inlined data 2022-02-02 20:59:37 +03:00
kssenii
eae0bc7c04 add query id for delayed interactive 2022-02-02 18:20:59 +03:00
Sergei Trifonov
68bc456830
Merge pull request #34223 from azat/bump-fmt
Bump fmtlib from 7.0.0 to 8.1.1
2022-02-02 00:03:25 +03:00
Azat Khuzhin
bedf208cbd Use fmt::runtime() for LOG_* for non constexpr
Here is oneliner:

    $ gg 'LOG_\(DEBUG\|TRACE\|INFO\|TEST\|WARNING\|ERROR\|FATAL\)([^,]*, [a-zA-Z]' -- :*.cpp :*.h | cut -d: -f1 | sort -u | xargs -r sed -E -i 's#(LOG_[A-Z]*)\(([^,]*), ([A-Za-z][^,)]*)#\1(\2, fmt::runtime(\3)#'

Note, that I tried to do this with coccinelle (tool for semantic
patchin), but it cannot parse C++:

    $ cat fmt.cocci
    @@
    expression log;
    expression var;
    @@

    -LOG_DEBUG(log, var)
    +LOG_DEBUG(log, fmt::runtime(var))

I've also tried to use some macros/templates magic to do this implicitly
in logger_useful.h, but I failed to do so, and apparently it is not
possible for now.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

v2: manual fixes
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-02-01 14:30:03 +03:00
Amos Bird
bb34435928
Better code 2022-01-30 19:48:35 +08:00
Amos Bird
54517753d7
Combining our lexer with replxx 2022-01-30 19:48:33 +08:00
Anton Popov
78b9f15abb Merge remote-tracking branch 'upstream/master' into HEAD 2022-01-30 03:24:37 +03:00
Kruglov Pavel
b54bf18b27
Merge branch 'master' into stress-test 2022-01-25 14:35:42 +03:00
Azat Khuzhin
1acd644040 Add inplace merge for new completion words
This will allow:
- use addWords() everywhere
- remove that optimization for empty words case (initial load)
- and now we remove duplicates according to comparator

v2: replace parameter pack in addWords() with explicit Compare for both
cases (just pass default)
2022-01-24 22:59:18 +03:00
Anton Popov
e8ce091e68 Merge remote-tracking branch 'upstream/master' into HEAD 2022-01-21 20:11:18 +03:00
Kruglov Pavel
175788ecf9
Merge pull request #33790 from Avogar/fix-input
Fix bug in client that led to 'Connection reset by peer' in server
2022-01-20 14:09:13 +03:00
Azat Khuzhin
3e58094bcb Fix build w/o replxx 2022-01-20 10:02:02 +03:00
DF5HSE
b46af3e0c4 Add list of '<host>:[<port>]' reading in --host param 2022-01-20 00:36:18 +03:00
DF5HSE
f6d50f6fd3 Add list of hosts reading 2022-01-20 00:15:11 +03:00
avogar
6092ed48bd Fix bug in client that led to 'Connection reset by peer' in server 2022-01-19 19:04:57 +03:00
Azat Khuzhin
f12e4b6ef7 Rewrite suggestions to make it more cleaner
- use plain mutex over atomic
- use addWords() for initial suggestion filling
- return vector<> from getCompletions() over iterator, to avoid possible
  questions (even though it was safe, since addWords() could not be
  called in parallel with getCompletions() before)
2022-01-18 21:03:51 +03:00
Kruglov Pavel
d2e9f37bee
Merge branch 'master' into format-by-extention 2022-01-14 18:36:23 +03:00
avogar
817a314263 Fix tests and style 2022-01-14 17:46:24 +03:00
tavplubix
8c9a369588
Merge pull request #33535 from kssenii/fix-local-client-exception
Fix clickhouse local interactive exception case
2022-01-12 13:17:05 +03:00
kssenii
211f1dd482 Fix 2022-01-12 00:28:53 +03:00
zhongyuankai
99279c1443 INTO OUTFILE / FROM INFILE: autodetect FORMAT by file extension 2022-01-11 21:26:14 +08:00
zhongyuankai
878e44eb97 auto format by file extension 2022-01-08 21:47:14 +08:00
Azat Khuzhin
0685fd9985 clickhouse-local: track memory under --max_memory_usage_in_client option 2021-12-31 11:06:15 +03:00
Alexey Milovidov
c1297d2431 Compatibility 2021-12-29 19:57:40 +03:00
Alexey Milovidov
e8e19b8b0d Always display resource usage in client 2021-12-29 01:20:34 +03:00
Azat Khuzhin
36c4fc054c Client interactive suggest (extract info from CREATE queries)
This will parse CREATE queries and add the following things to
completion list for clickhouse-client/clickhouse-local:
- table
- database
- columns
2021-12-26 19:10:25 +03:00
Alexey Milovidov
29d28c531f Move code around to avoid dlsym on Musl 2021-12-24 12:25:27 +03:00
Kruglov Pavel
ffb6c5b37b
Merge branch 'master' into stress-test 2021-12-23 20:14:15 +03:00
kssenii
8cf52918b9 clickhouse local send profile info 2021-12-23 12:37:29 +03:00
Nikolay Degterinsky
6757afa052
Merge pull request #32843 from nkolotov/fix_echo_option_not_used_in_batch_mode
Fixed --echo option is not used by clickhouse-client in batch mode with single query
2021-12-23 11:37:02 +03:00
Kseniia Sumarokova
2ac7897470
Merge pull request #32841 from lingtaolf/feature/add-clickhouse-client-hints
Add clickhouse client hints
2021-12-20 23:48:50 +03:00
Kseniia Sumarokova
a5f28e51e5
Try fix style check 2021-12-20 18:09:20 +03:00
凌涛
0efc01be05 add test 2021-12-20 13:53:08 +08:00
Azat Khuzhin
1d25ec3e82 Merge ProfileEvents in case they were not printed
That way with --profile-events-delay-ms=-1 you will always get totals.

Plus, this will fix periodic failures, that can be reproduced by
limitting CPU (5% is enough in my setup), i.e.:

    $ systemd-run --collect --unit ch -p CPUQuota=5% --user clickhouse-server
    $ while clickhouse-client --print-profile-events --profile-events-delay-ms=-1 -q 'select * from numbers (1e5) format Null' |& tee /dev/stderr | fgrep 'SelectedRows: 131010 (increment)'; do :; done

And as a bonus it will make 02050_client_profile_events deterministic.
2021-12-19 23:43:05 +03:00
Anton Popov
99ebabd822 Merge remote-tracking branch 'upstream/master' into HEAD 2021-12-17 19:02:29 +03:00
凌涛
bf1098484e modify code style 2021-12-16 20:31:06 +08:00
凌涛
ad34217873 Add hints for clickhouse client options 2021-12-16 20:19:00 +08:00
N. Kolotov
adf5fcdd0a Fixed --echo option is not used by clickhouse-client in batch mode with single query. 2021-12-16 13:10:49 +03:00
Azat Khuzhin
510eab25a1 Add timeout into "Timeout exceeded while reading from" message 2021-12-14 10:18:57 +03:00
Azat Khuzhin
eb9968babf Add timeout into "Read timeout while draining from" message 2021-12-14 10:18:57 +03:00
Azat Khuzhin
4e4837758a Remove readline support
- it was not nested for a long time
- replxx is an upstream way for completion
2021-12-11 11:29:59 +03:00
Azat Khuzhin
fa6090f588 Fix processing initial table (--table/stdin) in clickhouse-local
This patch will:
- fix the issue when table had been tried to create multiple times for
  --queries-files
- create these table for --interactive mode (before it works only if you
  had some queries already, i.e. when it run interactive after
  non-interactive)

This will also make ClientBase interface a little bit cleaner, by
removing one abstract method getQueryTextPrefix()
2021-12-10 22:08:03 +03:00
Nikita Mikhaylov
dbf5091016
Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
alexey-milovidov
50c23a9fd6
Merge pull request #31123 from amosbird/repl-improvement
Better clickhouse-client multiline input
2021-12-06 12:22:13 +03:00
Anton Popov
6f4d9a53b2 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-12-01 15:54:33 +03:00
mergify[bot]
b4f43c59a2
Merge branch 'master' into stress-test 2021-12-01 10:12:22 +00:00
alexey-milovidov
96ec92c7cd
Merge pull request #31155 from ClickHouse/incremental-profile-events
Send incremental profile events to client
2021-12-01 04:04:41 +03:00
mergify[bot]
e6f5792ba3
Merge branch 'master' into stress-test 2021-11-29 09:01:33 +00:00
Raúl Marín
f0ee0724ac Reduce dependencies on ASTSelectQuery.h
243 -> 152
2021-11-26 18:35:24 +01:00
mergify[bot]
ce0c112586
Merge branch 'master' into stress-test 2021-11-25 11:09:26 +00:00
Anton Popov
ccd78e3838 Merge remote-tracking branch 'upstream/master' into HEAD 2021-11-22 17:19:35 +03:00
Vitaly Baranov
6634fcbac7 Rename Quota::ResourceType -> QuotaType and move it to Access/Common. 2021-11-19 00:14:23 +03:00
Kruglov Pavel
f27fcf8372
Merge pull request #31004 from Avogar/output-formats
Small refactoring in formats
2021-11-17 20:44:46 +03:00
Amos Bird
93294734d3
Better clickhouse-client multiline input 2021-11-17 22:11:30 +08:00
Kseniia Sumarokova
d1374481df
Merge pull request #31457 from azat/local-pager
Add --pager support for clickhouse-local
2021-11-17 09:29:56 +03:00
Azat Khuzhin
bbbbd261b8 Add --pager support for clickhouse-local 2021-11-16 22:25:32 +03:00
mergify[bot]
923874060a
Merge branch 'master' into stress-test 2021-11-16 16:42:50 +00:00
Nikolay Degterinsky
ba50e8387d Merge branch 'master' into query_parameters 2021-11-15 19:55:54 +00:00
Nikolay Degterinsky
5d07387987 Fix INFILE tests 2021-11-15 19:55:27 +00:00
Kseniia Sumarokova
846fbd059b
Merge pull request #31403 from kssenii/fix-client-output
Fix client
2021-11-14 15:01:30 +03:00
kssenii
ad1b7c83cd Fix 2021-11-14 07:19:59 +00:00
alexey-milovidov
e323b83f6a
Merge pull request #30876 from pmed/backslash_letter_interactive_input
add aliases for `\<letter>` interactive client commands
2021-11-14 01:43:13 +03:00
Nikolai Kochetov
6623c609cf
Merge pull request #19587 from ClickHouse/refactor-pipeline-executor
Refactor pipeline executor
2021-11-12 11:49:05 +03:00
Kseniia Sumarokova
2313981fd7
Merge pull request #31260 from azat/external-cleanup
Cleanup extern ProfileEvents/CurrentMetrics and add a style check
2021-11-12 00:02:57 +03:00
avogar
e5661b9b62 Minor change 2021-11-11 21:09:21 +03:00
mergify[bot]
58c5981cab
Merge branch 'master' into refactor-pipeline-executor 2021-11-11 16:16:52 +00:00
Nikolay Degterinsky
7b5954b736 Merge branch 'master' into query_parameters 2021-11-11 11:43:00 +00:00
Azat Khuzhin
baf14444e6 Cleanup ProfileEvents and CurrentMetrics 2021-11-10 21:15:27 +03:00
kssenii
6bc7fb1edf Fixes 2021-11-10 09:33:48 +00:00
Anton Popov
a20922b2d3 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-11-09 15:36:25 +03:00
kssenii
bfde7fd36c Better 2021-11-09 12:06:43 +00:00
mergify[bot]
f55e1439cb
Merge branch 'master' into output-formats 2021-11-08 15:33:45 +00:00
Dmitry Novik
a093395b9b Process incremental profile events on client 2021-11-08 16:38:31 +03:00
kssenii
dead99011b Merge branch 'master' of github.com:ClickHouse/ClickHouse into intersect-except-fix 2021-11-08 16:15:33 +03:00
Kseniia Sumarokova
908d78febe
Merge pull request #30851 from kssenii/clickhouse-local-improve
Allow delayed interactive mode
2021-11-08 10:07:29 +03:00
tavplubix
94a66f724e
Merge pull request #30135 from FArthur-cmd/add_parallel_reading_from_infile
Add parallel file reading `FROM INFILE` in client
2021-11-06 15:54:27 +03:00
kssenii
26c4affc18 Fixes 2021-11-04 11:00:35 +00:00
avogar
2dd4393ca1 Small refactoring in formats 2021-11-03 20:07:05 +03:00
mergify[bot]
8ef9e61e36
Merge branch 'master' into stress-test 2021-11-03 08:28:43 +00:00
kssenii
feb3d8bc75 Merge branch 'master' of github.com:ClickHouse/ClickHouse into clickhouse-local-improve 2021-11-02 20:01:15 +00:00
Kseniia Sumarokova
351c7bc8d6
Merge pull request #30881 from kssenii/fix-local-verbose
clickhouse-local interactive fix --verbose and allow logging into file
2021-11-01 23:08:49 +03:00
kssenii
35349056b8 Fix 2021-11-01 16:33:19 +03:00
zhangxiao871
45c12f9b2a merge from master 2021-11-01 18:32:56 +08:00
alexey-milovidov
04f5c4bd9a
Merge pull request #30938 from kssenii/fix-local-file-progress
Fix file progress for clickhouse-local
2021-11-01 12:39:12 +03:00
kssenii
d7dab834ec Fix file progress for local 2021-11-01 00:33:03 +03:00
Alexey Milovidov
993f3faefd Miscellaneous 2021-10-31 18:11:46 +03:00
Pavel Medvedev
7b50ab7136 skip spaces before and after \<letter> alias
... for proper single letter like `\l`, `\d` handling.

Using `std::search()` for alias substring search instead of `.starts_with()`
to get the alias start position, to check the leading range contains only space
characters, and to get the rest of input after the space.

See issue #9339
2021-10-31 15:46:30 +01:00
alexey-milovidov
c504e0c08d
Update ClientBase.cpp 2021-10-30 21:17:38 +03:00