mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-03 13:02:00 +00:00
Query stage for local
This commit is contained in:
parent
d1138a8a25
commit
6c0eaf76da
@ -60,15 +60,15 @@ void LocalConnection::updateProgress(const Progress & value)
|
||||
|
||||
void LocalConnection::sendQuery(
|
||||
const ConnectionTimeouts &,
|
||||
const String & query_,
|
||||
const String & query_id_,
|
||||
UInt64,
|
||||
const String & query,
|
||||
const String & query_id,
|
||||
UInt64 stage,
|
||||
const Settings *,
|
||||
const ClientInfo *,
|
||||
bool)
|
||||
{
|
||||
query_context = session.makeQueryContext();
|
||||
query_context->setCurrentQueryId(query_id_);
|
||||
query_context->setCurrentQueryId(query_id);
|
||||
if (send_progress)
|
||||
query_context->setProgressCallback([this] (const Progress & value) { return this->updateProgress(value); });
|
||||
|
||||
@ -77,8 +77,9 @@ void LocalConnection::sendQuery(
|
||||
state.reset();
|
||||
state.emplace();
|
||||
|
||||
state->query_id = query_id_;
|
||||
state->query = query_;
|
||||
state->query_id = query_id;
|
||||
state->query = query;
|
||||
state->stage = QueryProcessingStage::Enum(stage);
|
||||
|
||||
if (send_progress)
|
||||
state->after_send_progress.restart();
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
void sendQuery(
|
||||
const ConnectionTimeouts & timeouts,
|
||||
const String & query,
|
||||
const String & query_id_/* = "" */,
|
||||
const String & query_id/* = "" */,
|
||||
UInt64 stage/* = QueryProcessingStage::Complete */,
|
||||
const Settings * settings/* = nullptr */,
|
||||
const ClientInfo * client_info/* = nullptr */,
|
||||
|
@ -0,0 +1,15 @@
|
||||
execute: default
|
||||
"foo"
|
||||
1
|
||||
execute: --stage fetch_columns
|
||||
"dummy"
|
||||
0
|
||||
execute: --stage with_mergeable_state
|
||||
"1"
|
||||
1
|
||||
execute: --stage with_mergeable_state_after_aggregation
|
||||
"1"
|
||||
1
|
||||
execute: --stage complete
|
||||
"foo"
|
||||
1
|
22
tests/queries/0_stateless/02048_clickhouse_local_stage.sh
Executable file
22
tests/queries/0_stateless/02048_clickhouse_local_stage.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: no-fasttest
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
# shellcheck source=../shell_config.sh
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
function execute_query()
|
||||
{
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "execute: default"
|
||||
else
|
||||
echo "execute: $*"
|
||||
fi
|
||||
${CLICKHOUSE_LOCAL} "$@" --format CSVWithNames -q "SELECT 1 AS foo"
|
||||
}
|
||||
|
||||
execute_query # default -- complete
|
||||
execute_query --stage fetch_columns
|
||||
execute_query --stage with_mergeable_state
|
||||
execute_query --stage with_mergeable_state_after_aggregation
|
||||
execute_query --stage complete
|
Loading…
Reference in New Issue
Block a user