Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Storages/AlterCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ void AlterCommands::validate(const StoragePtr & table, ContextPtr context) const
/// So we don't allow to do it for now.
if (command.data_type)
{
const GetColumnsOptions options(GetColumnsOptions::AllPhysical);
const GetColumnsOptions options(GetColumnsOptions::All);
const auto old_data_type = all_columns.getColumn(options, column_name).type;

bool new_type_has_object = command.data_type->hasDynamicSubcolumns();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE default.t\n(\n `c0` DateTime,\n `c1` DateTime,\n `a` DateTime ALIAS c1\n)\nENGINE = MergeTree\nORDER BY tuple()\nSETTINGS index_granularity = 8192
8 changes: 8 additions & 0 deletions tests/queries/0_stateless/02908_alter_column_alias.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE t (
c0 DateTime,
c1 DateTime,
a DateTime alias toStartOfFifteenMinutes(c0)
) ENGINE = MergeTree() ORDER BY tuple();

ALTER TABLE t MODIFY COLUMN a DateTime ALIAS c1;
SHOW CREATE t;