We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 194e56b commit 881841fCopy full SHA for 881841f
src/Analyzer/ConstantNode.cpp
@@ -203,7 +203,11 @@ ASTPtr ConstantNode::toASTImpl(const ConvertToASTOptions & options) const
203
auto constant_value_ast = std::make_shared<ASTLiteral>(getValue());
204
205
if (!options.add_cast_for_constants)
206
+ {
207
+ if (WhichDataType(constant_value_type->getTypeId()).isDateTimeOrDateTime64())
208
+ return std::make_shared<ASTLiteral>(getFieldFromColumnForASTLiteral(constant_value.getColumn(), 0, constant_value.getType()));
209
return constant_value_ast;
210
+ }
211
212
// Add cast if constant was created as a result of constant folding.
213
// Constant folding may lead to type transformation and literal on shard
0 commit comments