diff --git a/src/Storages/StorageFile.cpp b/src/Storages/StorageFile.cpp index 57e04f547d4..e3908c75a58 100644 --- a/src/Storages/StorageFile.cpp +++ b/src/Storages/StorageFile.cpp @@ -965,13 +965,13 @@ public: { if (virtual_column.name == "_path") { - chunk.addColumn(virtual_column.type->createColumnConst(num_rows, current_path)); + chunk.addColumn(virtual_column.type->createColumnConst(num_rows, current_path)->convertToFullColumnIfConst()); } else if (virtual_column.name == "_file") { size_t last_slash_pos = current_path.find_last_of('/'); auto file_name = current_path.substr(last_slash_pos + 1); - chunk.addColumn(virtual_column.type->createColumnConst(num_rows, file_name)); + chunk.addColumn(virtual_column.type->createColumnConst(num_rows, file_name)->convertToFullColumnIfConst()); } }