2019-12-15 06:34:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-09-26 00:31:40 +00:00
|
|
|
#include <string>
|
|
|
|
#include <Core/ColumnNumbers.h>
|
|
|
|
#include <Core/ColumnsWithTypeAndName.h>
|
|
|
|
|
|
|
|
|
|
|
|
class DateLUTImpl;
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Block;
|
|
|
|
|
2023-04-12 18:36:23 +00:00
|
|
|
std::string extractTimeZoneNameFromColumn(const IColumn * column, const String & column_name);
|
2021-09-29 14:52:08 +00:00
|
|
|
|
2018-09-26 00:31:40 +00:00
|
|
|
/// Determine working timezone either from optional argument with time zone name or from time zone in DateTime type of argument.
|
2021-04-20 21:08:06 +00:00
|
|
|
/// Returns empty string if default time zone should be used.
|
2023-06-10 12:53:02 +00:00
|
|
|
///
|
|
|
|
/// Parameter allow_nonconst_timezone_arguments toggles if non-const timezone function arguments are accepted (legacy behavior) or not. The
|
|
|
|
/// problem with the old behavior is that the timezone is part of the type, and not part of the value. This lead to confusion and unexpected
|
|
|
|
/// results.
|
|
|
|
/// - For new functions, set allow_nonconst_timezone_arguments = false.
|
|
|
|
/// - For existing functions
|
|
|
|
/// - which disallow non-const timezone arguments anyways (e.g. getArgumentsThatAreAlwaysConstant()), set allow_nonconst_timezone_arguments = false,
|
|
|
|
/// - which allow non-const timezone arguments, set allow_nonconst_timezone_arguments according to the corresponding setting.
|
2020-06-28 20:20:49 +00:00
|
|
|
std::string extractTimeZoneNameFromFunctionArguments(
|
2023-06-10 12:53:02 +00:00
|
|
|
const ColumnsWithTypeAndName & arguments, size_t time_zone_arg_num, size_t datetime_arg_num, bool allow_nonconst_timezone_arguments);
|
2020-06-28 20:20:49 +00:00
|
|
|
|
|
|
|
const DateLUTImpl & extractTimeZoneFromFunctionArguments(
|
2020-11-17 13:24:45 +00:00
|
|
|
const ColumnsWithTypeAndName & arguments, size_t time_zone_arg_num, size_t datetime_arg_num);
|
2018-09-26 00:31:40 +00:00
|
|
|
|
|
|
|
}
|