Skip to content

ColumnTupleT::Wrap drops tuple element names #507

Description

@slabko

clickhouse::ColumnTupleT<...>::Wrap does not preserve tuple element names from the wrapped ColumnTuple.

Reproduction Steps

auto int_col = std::make_shared<clickhouse::ColumnInt8>();
auto str_col = std::make_shared<clickhouse::ColumnString>();

auto raw_col = std::make_shared<clickhouse::ColumnTuple>(
    std::vector<clickhouse::ColumnRef>({int_col, str_col}),
    std::vector<std::string>{"foo", "bar"}
);

auto original_name = raw_col->Type()->GetName();

auto col = clickhouse::ColumnTupleT<
    clickhouse::ColumnInt8,
    clickhouse::ColumnString
>::Wrap(raw_col);

auto wrapped_name = col->Type()->GetName();

std::cout << "Original name: " << original_name << "\n";
std::cout << "Wrapped name: " << wrapped_name << "\n";

Output (aligned):

Original name:  Tuple(foo Int8, bar String)
Wrapped name:   Tuple(    Int8,     String)

Expected output:

Original name:  Tuple(foo Int8, bar String)
Wrapped name:   Tuple(foo Int8, bar String)

In other words original names and wrapped names should be the same.

Other information

Named tuples were implemented in #491

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions