mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fix
This commit is contained in:
parent
479d4fa991
commit
c03b20d1a1
@ -19,10 +19,10 @@ public:
|
||||
static constexpr auto name = "timezone";
|
||||
static FunctionPtr create(ContextPtr context)
|
||||
{
|
||||
return std::make_shared<FunctionTimezone>(context);
|
||||
return std::make_shared<FunctionTimezone>(context->isDistributed());
|
||||
}
|
||||
|
||||
explicit FunctionTimezone(ContextPtr context_) : context(context_)
|
||||
explicit FunctionTimezone(bool is_distributed_) : is_distributed(is_distributed_)
|
||||
{
|
||||
}
|
||||
|
||||
@ -42,14 +42,14 @@ public:
|
||||
|
||||
bool isDeterministic() const override { return false; }
|
||||
bool isDeterministicInScopeOfQuery() const override { return true; }
|
||||
bool isSuitableForConstantFolding() const override { return !context->isDistributed(); }
|
||||
bool isSuitableForConstantFolding() const override { return !is_distributed; }
|
||||
|
||||
ColumnPtr executeImpl(const ColumnsWithTypeAndName &, const DataTypePtr &, size_t input_rows_count) const override
|
||||
{
|
||||
return DataTypeString().createColumnConst(input_rows_count, DateLUT::instance().getTimeZone());
|
||||
}
|
||||
private:
|
||||
ContextPtr context;
|
||||
bool is_distributed;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ struct SelectQueryOptions
|
||||
bool is_subquery = false; // non-subquery can also have subquery_depth > 0, e.g. insert select
|
||||
bool with_all_cols = false; /// asterisk include materialized and aliased columns
|
||||
|
||||
/// These two fields are used to evaluate getShardNum() and getShardCount() function when
|
||||
/// These two fields are used to evaluate shardNum() and shardCount() function when
|
||||
/// prefer_localhost_replica == 1 and local instance is selected. They are needed because local
|
||||
/// instance might have multiple shards and scalars can only hold one value.
|
||||
std::optional<UInt32> shard_num;
|
||||
|
@ -0,0 +1,7 @@
|
||||
0 0
|
||||
1 3
|
||||
2 3
|
||||
3 3
|
||||
1 3
|
||||
2 3
|
||||
3 3
|
Loading…
Reference in New Issue
Block a user