mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix CREATE TABLE AS from table with virtual columns (#7183)
* Disable undefined instrumentation for rdkafka
This commit is contained in:
parent
7601fafe63
commit
e595df05d9
@ -62,6 +62,7 @@ set(SRCS
|
||||
)
|
||||
|
||||
add_library(rdkafka ${SRCS})
|
||||
target_compile_options(rdkafka PRIVATE -fno-sanitize=undefined)
|
||||
target_include_directories(rdkafka SYSTEM PUBLIC include)
|
||||
target_include_directories(rdkafka SYSTEM PUBLIC ${RDKAFKA_SOURCE_DIR}) # Because weird logic with "include_next" is used.
|
||||
target_include_directories(rdkafka SYSTEM PRIVATE ${ZSTD_INCLUDE_DIR}/common) # Because wrong path to "zstd_errors.h" is used.
|
||||
|
@ -203,6 +203,10 @@ ASTPtr InterpreterCreateQuery::formatColumns(const ColumnsDescription & columns)
|
||||
|
||||
for (const auto & column : columns)
|
||||
{
|
||||
/// Do not include virtual columns
|
||||
if (column.is_virtual)
|
||||
continue;
|
||||
|
||||
const auto column_declaration = std::make_shared<ASTColumnDeclaration>();
|
||||
ASTPtr column_declaration_ptr{column_declaration};
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <Common/ActionLock.h>
|
||||
#include <Common/Exception.h>
|
||||
#include <Common/RWLock.h>
|
||||
#include <Common/TypePromotion.h>
|
||||
|
||||
#include <optional>
|
||||
#include <shared_mutex>
|
||||
@ -63,7 +64,7 @@ struct ColumnSize
|
||||
* - data storage structure (compression, etc.)
|
||||
* - concurrent access to data (locks, etc.)
|
||||
*/
|
||||
class IStorage : public std::enable_shared_from_this<IStorage>
|
||||
class IStorage : public std::enable_shared_from_this<IStorage>, public TypePromotion<IStorage>
|
||||
{
|
||||
public:
|
||||
IStorage() = default;
|
||||
|
@ -1 +1,2 @@
|
||||
default merge_ab x UInt8 0 0 0 0 0 0 0
|
||||
default as_kafka x UInt8 0 0 0 0 0 0 0
|
26
dbms/tests/queries/0_stateless/00981_no_virtual_columns.sql
Normal file
26
dbms/tests/queries/0_stateless/00981_no_virtual_columns.sql
Normal file
@ -0,0 +1,26 @@
|
||||
DROP TABLE IF EXISTS merge_a;
|
||||
DROP TABLE IF EXISTS merge_b;
|
||||
DROP TABLE IF EXISTS merge_ab;
|
||||
DROP TABLE IF EXISTS kafka;
|
||||
DROP TABLE IF EXISTS as_kafka;
|
||||
|
||||
CREATE TABLE merge_a (x UInt8) ENGINE = StripeLog;
|
||||
CREATE TABLE merge_b (x UInt8) ENGINE = StripeLog;
|
||||
CREATE TABLE merge_ab AS merge(currentDatabase(), '^merge_[ab]$');
|
||||
|
||||
CREATE TABLE kafka (x UInt8)
|
||||
ENGINE = Kafka
|
||||
SETTINGS kafka_broker_list = 'kafka',
|
||||
kafka_topic_list = 'topic',
|
||||
kafka_group_name = 'group',
|
||||
kafka_format = 'CSV';
|
||||
CREATE TABLE as_kafka AS kafka ENGINE = Memory;
|
||||
|
||||
SELECT * FROM system.columns WHERE database = currentDatabase() AND table = 'merge_ab';
|
||||
SELECT * FROM system.columns WHERE database = currentDatabase() AND table = 'as_kafka';
|
||||
|
||||
DROP TABLE merge_a;
|
||||
DROP TABLE merge_b;
|
||||
DROP TABLE merge_ab;
|
||||
DROP TABLE kafka;
|
||||
DROP TABLE as_kafka;
|
@ -1,13 +0,0 @@
|
||||
DROP TABLE IF EXISTS merge_a;
|
||||
DROP TABLE IF EXISTS merge_b;
|
||||
DROP TABLE IF EXISTS merge_ab;
|
||||
|
||||
CREATE TABLE merge_a (x UInt8) ENGINE = StripeLog;
|
||||
CREATE TABLE merge_b (x UInt8) ENGINE = StripeLog;
|
||||
CREATE TABLE merge_ab AS merge(currentDatabase(), '^merge_[ab]$');
|
||||
|
||||
SELECT * FROM system.columns WHERE database = currentDatabase() AND table = 'merge_ab';
|
||||
|
||||
DROP TABLE merge_a;
|
||||
DROP TABLE merge_b;
|
||||
DROP TABLE merge_ab;
|
Loading…
Reference in New Issue
Block a user