fix: DateTime64 on MaterializedPostgreSQL (#2)

* fix: DateTime64 on MaterializedPostgreSQL

* Update StoragePostgreSQL.cpp
This commit is contained in:
jasine 2021-07-14 01:59:33 +08:00 committed by GitHub
parent eefb798e33
commit a0ec8e9878
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -326,6 +326,15 @@ ASTPtr StorageMaterializedPostgreSQL::getColumnDeclaration(const DataTypePtr & d
if (which.isDecimal256())
return make_decimal_expression("Decimal256");
}
if (which.isDateTime64()){
auto ast_expression = std::make_shared<ASTFunction>();
ast_expression->name = "DateTime64";
ast_expression->arguments = std::make_shared<ASTExpressionList>();
ast_expression->arguments->children.emplace_back(std::make_shared<ASTLiteral>(UInt32(6)));
return ast_expression;
}
return std::make_shared<ASTIdentifier>(data_type->getName());
}

View File

@ -236,7 +236,7 @@ public:
else if (which.isDateTime()) nested_column = ColumnUInt32::create();
else if (which.isDateTime64())
{
nested_column = ColumnDecimal<Decimal64>::create(0, 6);
nested_column = ColumnDecimal<DateTime64>::create(0, 6);
}
else if (which.isDecimal32())
{