Skip to content

Commit 3d377bf

Browse files
authored
Using TEMPORARY table in RoundtripColumnValues
1 parent f2a663e commit 3d377bf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ut/roundtrip_column.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ std::vector<T> GenerateConsecutiveNumbers(size_t count, T start = 0)
2929

3030

3131
ColumnRef RoundtripColumnValues(Client& client, ColumnRef expected) {
32-
// Create a temporary table with a single column
33-
// insert values from `expected`
34-
// select and aggregate all values from block into `result` column
32+
// Create a temporary table with a corresponding data column
33+
// INSERT values from `expected`
34+
// SELECT and collect all values from block into `result` column
3535
auto result = expected->CloneEmpty();
3636

3737
const std::string type_name = result->GetType().GetName();
38-
client.Execute("DROP TABLE IF EXISTS temporary_roundtrip_table;");
39-
// id column is to have same order of rows on SELECT
40-
client.Execute("CREATE TABLE IF NOT EXISTS temporary_roundtrip_table (id UInt32, col " + type_name + ") Engine=MergeTree() ORDER BY id;");
38+
client.Execute("DROP TEMPORARY TABLE IF EXISTS temporary_roundtrip_table;");
39+
// id column is to have the same order of rows on SELECT
40+
client.Execute("CREATE TEMPORARY TABLE IF NOT EXISTS temporary_roundtrip_table (id UInt32, col " + type_name + ") Engine=MergeTree() ORDER BY id;");
4141
{
4242
Block block;
4343
block.AppendColumn("col", expected);

0 commit comments

Comments
 (0)