mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
fixes for review CLICKHOUSE-3578
This commit is contained in:
parent
8500335ef5
commit
60dc8fcac2
@ -718,7 +718,7 @@ std::unique_ptr<Exception> Connection::receiveException()
|
||||
|
||||
std::vector<String> Connection::receiveMultistringMessage(UInt64 msg_type)
|
||||
{
|
||||
size_t num = Protocol::Server::wordsInMessage(msg_type);
|
||||
size_t num = Protocol::Server::stringsInMessage(msg_type);
|
||||
std::vector<String> out(num);
|
||||
for (size_t i = 0; i < num; ++i)
|
||||
readStringBinary(out[i], *in);
|
||||
|
@ -86,7 +86,7 @@ namespace Protocol
|
||||
: "Unknown packet";
|
||||
}
|
||||
|
||||
inline size_t wordsInMessage(UInt64 msg_type)
|
||||
inline size_t stringsInMessage(UInt64 msg_type)
|
||||
{
|
||||
switch (msg_type)
|
||||
{
|
||||
|
@ -118,12 +118,12 @@ void AddingDefaultsBlockInputStream::checkCalculated(const ColumnWithTypeAndName
|
||||
size_t column_size = col_read.column->size();
|
||||
|
||||
if (column_size != col_defaults.column->size())
|
||||
throw Exception("Mismach column sizes while adding defaults", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
|
||||
throw Exception("Mismatch column sizes while adding defaults", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
|
||||
|
||||
if (column_size < defaults_needed)
|
||||
throw Exception("Unexpected defaults count", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
|
||||
|
||||
if (col_read.type->getTypeId() != col_defaults.type->getTypeId())
|
||||
if (!col_read.type->equals(*col_defaults.type))
|
||||
throw Exception("Mismach column types while adding defaults", ErrorCodes::TYPE_MISMATCH);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
const ColumnDefaults & column_defaults_,
|
||||
const Context & context_);
|
||||
|
||||
String getName() const override { return "AddingDefault"; }
|
||||
String getName() const override { return "AddingMissed"; }
|
||||
Block getHeader() const override { return header; }
|
||||
|
||||
private:
|
||||
|
@ -10,12 +10,11 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
/// A way to set some extentions to read and return extra information too. IRowInputStream.extendedRead() output.
|
||||
/// Contains extra information about read data.
|
||||
struct RowReadExtension
|
||||
{
|
||||
/// IRowInputStream.extendedRead() output value.
|
||||
/// Contains one bit per column in resently read row. IRowInputStream could leave it empty, or partialy set.
|
||||
/// It should contain true for columns that actually read from the source and false for defaults.
|
||||
/// IRowInputStream.read() output. It contains non zero for columns that actually read from the source and zero otherwise.
|
||||
/// It's used to attach defaults for partially filled rows.
|
||||
std::vector<UInt8> read_columns;
|
||||
};
|
||||
|
||||
|
@ -9,9 +9,6 @@
|
||||
namespace DB
|
||||
{
|
||||
|
||||
class Context;
|
||||
class Block;
|
||||
|
||||
enum class ColumnDefaultKind
|
||||
{
|
||||
Default,
|
||||
|
@ -221,8 +221,6 @@ const ColumnsDescription * ColumnsDescription::loadFromContext(const Context & c
|
||||
{
|
||||
if (context.getSettingsRef().insert_sample_with_metadata)
|
||||
{
|
||||
auto db_and_table = context.getInsertionTable();
|
||||
|
||||
if (context.isTableExist(db, table))
|
||||
{
|
||||
StoragePtr storage = context.getTable(db, table);
|
||||
|
Loading…
Reference in New Issue
Block a user