Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54655 from Avogar/fix-use-structure-from-insertio…
…n-table Fix using structure from insertion tables in case of defaults and explicit insert columns
- Loading branch information
Showing
10 changed files
with
114 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...stateless/02878_use_structure_from_insertion_table_with_explicit_insert_columns.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
0 0 | ||
0 0 | ||
42 0 | ||
42 0 |
17 changes: 17 additions & 0 deletions
17
...ries/0_stateless/02878_use_structure_from_insertion_table_with_explicit_insert_columns.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
# shellcheck source=../shell_config.sh | ||
. "$CURDIR"/../shell_config.sh | ||
|
||
$CLICKHOUSE_LOCAL -q "select 42 as x format Native" > $CLICKHOUSE_TEST_UNIQUE_NAME.native | ||
$CLICKHOUSE_LOCAL -n -q " | ||
create table test (x UInt64, y UInt64) engine=Memory; | ||
insert into test (x) select * from file('$CLICKHOUSE_TEST_UNIQUE_NAME.native'); | ||
insert into test (y) select * from file('$CLICKHOUSE_TEST_UNIQUE_NAME.native'); | ||
insert into test (* except(x)) select * from file('$CLICKHOUSE_TEST_UNIQUE_NAME.native'); | ||
insert into test (* except(y)) select * from file('$CLICKHOUSE_TEST_UNIQUE_NAME.native'); | ||
select * from test order by x; | ||
" | ||
|
||
rm $CLICKHOUSE_TEST_UNIQUE_NAME.native |
1 change: 1 addition & 0 deletions
1
tests/queries/0_stateless/02879_use_structure_from_insertion_table_with_defaults.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 42 |
14 changes: 14 additions & 0 deletions
14
tests/queries/0_stateless/02879_use_structure_from_insertion_table_with_defaults.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
# shellcheck source=../shell_config.sh | ||
. "$CURDIR"/../shell_config.sh | ||
|
||
$CLICKHOUSE_LOCAL -q "select 1 as x format Native" > $CLICKHOUSE_TEST_UNIQUE_NAME.native | ||
$CLICKHOUSE_LOCAL -n -q " | ||
create table test (x UInt64, y UInt64 default 42) engine=Memory; | ||
insert into test select * from file('$CLICKHOUSE_TEST_UNIQUE_NAME.native'); | ||
select * from test; | ||
" | ||
|
||
rm $CLICKHOUSE_TEST_UNIQUE_NAME.native |