Skip to content

Exception using WITH FILL INTERPOLATE #55794

Closed

Description

@bichselb

Describe what's wrong

When I run the below query, I get an exception:

Query:

CREATE TABLE IF NOT EXISTS example_table (
  ColumnA Int64,
  ColumnB Int64,
  ColumnC Int64
)
ENGINE = MergeTree()
ORDER BY ColumnA;

WITH
helper AS (
  SELECT
    *
  FROM
    example_table
  ORDER BY
    ColumnA WITH FILL INTERPOLATE (
      ColumnB AS ColumnC,
      ColumnC AS ColumnA
    )
)
SELECT ColumnB FROM helper

Reproduce: https://fiddle.clickhouse.com/a739468f-439c-4c8f-9d55-2d2f214fde88

Does it reproduce on recent release?

Yes, I can reproduce this on 23.9.1.1854.

Expected behavior

I would expect the same (empty) output as if I include all columns in the final SELECT:

DROP TABLE IF EXISTS example_table;

CREATE TABLE IF NOT EXISTS example_table (
  ColumnA Int64,
  ColumnB Int64,
  ColumnC Int64
)
ENGINE = MergeTree()
ORDER BY ColumnA;

WITH
helper AS (
  SELECT
    *
  FROM
    example_table
  ORDER BY
    ColumnA WITH FILL INTERPOLATE (
      ColumnB AS ColumnC,
      ColumnC AS ColumnA
    )
)
SELECT * FROM helper

Error message and/or stacktrace

I get the following exception:

Received exception from server (version 23.9.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Unknown column: ColumnA, there are only columns ColumnB, ColumnC. (UNKNOWN_IDENTIFIER)
(query: WITH
helper AS (
  SELECT
    *
  FROM
    example_table
  ORDER BY
    ColumnA WITH FILL INTERPOLATE (
      ColumnB AS ColumnC,
      ColumnC AS ColumnA
    )
)
SELECT ColumnB FROM helper)

Activity

  1. added
    potential bug
    on Oct 18, 2023
  2. melvynator commented on Oct 23, 2023

    @melvynator
    Member
  3. added
    bug
    and removed
    potential bug
    on Oct 23, 2023
  4. devcrafter commented on Dec 7, 2023

    @devcrafter
    Member
  5. nikitamikhaylov commented on Mar 27, 2024

    @nikitamikhaylov
    Member
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions