Skip to content

Cannot open file tmp_sizes.json: No such file or directory, when renaming a table #455

Closed

Description

@tobia

Hello

Since ClickHouse does not have truncate, I thought I would just create a new table with create ... as and then rename it:

create table test (s String) engine=TinyLog;

create table test_new as test;
drop table test;
rename table test_new to test;

But inserting into the new table gives an error:

insert into test values ('hello');

Code: 107. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Cannot open file /opt/clickhouse/data/default/test_new/tmp_sizes.json, errno: 2, strerror: No such file or directory.

Some part of ClickHouse is still using the old name (notice .../test_new/...)

By the way, one workarond is to first rename and then create:

rename table test to test_old;
create table test as test_old;
drop table test_old;

Activity

  1. self-assigned this
    on Feb 6, 2017
  2. added
    bug
    on Feb 6, 2017
  3. added a commit that references this issue on Feb 6, 2017
  4. artpaul commented on Feb 6, 2017

    @artpaul
    Contributor

    @tobia Thanks for reporting the error. The fix is trivial.

  5. added a commit that references this issue on Feb 6, 2017
  6. added a commit that references this issue on Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions