Skip to content

Can't use alias columns in default expressions #2283

Closed

Description

@filimonov

Sample:

CREATE TABLE test_default_using_alias
(
    what String, 
    a String DEFAULT concat(c, ' is great'), 
    b String DEFAULT concat(c, ' is fast'), 
    c String ALIAS concat(what, 'House')
)
ENGINE = TinyLog

:) insert into test_default_using_alias(what) VALUES ('Click');
Received exception from server (version 1.1.54362):
Code: 47. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Unknown identifier: c. 

1 rows in set. Elapsed: 0.073 sec. 

:) SELECT a,b FROM test_default_using_alias;

SELECT 
    a, 
    b
FROM test_default_using_alias 

Received exception from server (version 1.1.54362):
Code: 1000. DB::Exception: Received from localhost:9000, ::1. DB::Exception: File not found: /var/lib/clickhouse/data/default/test_default_using_alias/a.bin. 

Activity

  1. vpanfilov commented on Jul 27, 2018

    @vpanfilov

    It is the same behaviour if ALIAS columns are present in MATERIALIZED or other ALIAS columns. Very annoying bug - tables are created succesfully, but all inserts fails.

  2. stale commented on Oct 20, 2019

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  3. added
    bug
    on Feb 21, 2020
  4. alesapin commented on Mar 3, 2020

    @alesapin
    Member

    Fix here #9489

  5. added
    comp-ddl
    on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomp-ddl

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions