2016-04-10 02:32:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-02-15 11:46:07 +00:00
|
|
|
#include <vector>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Core/Block.h>
|
2016-04-10 02:32:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-08-11 16:44:34 +00:00
|
|
|
/** Common part for implementation of MySQLSource, MongoDBSource and others.
|
2016-04-10 02:32:59 +00:00
|
|
|
*/
|
|
|
|
struct ExternalResultDescription
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
enum struct ValueType
|
|
|
|
{
|
2019-08-03 11:02:40 +00:00
|
|
|
vtUInt8,
|
|
|
|
vtUInt16,
|
|
|
|
vtUInt32,
|
|
|
|
vtUInt64,
|
|
|
|
vtInt8,
|
|
|
|
vtInt16,
|
|
|
|
vtInt32,
|
|
|
|
vtInt64,
|
|
|
|
vtFloat32,
|
|
|
|
vtFloat64,
|
2021-06-24 12:05:47 +00:00
|
|
|
vtEnum8,
|
|
|
|
vtEnum16,
|
2019-08-03 11:02:40 +00:00
|
|
|
vtString,
|
|
|
|
vtDate,
|
2021-07-15 11:41:52 +00:00
|
|
|
vtDate32,
|
2019-08-03 11:02:40 +00:00
|
|
|
vtDateTime,
|
|
|
|
vtUUID,
|
2020-09-09 12:18:02 +00:00
|
|
|
vtDateTime64,
|
|
|
|
vtDecimal32,
|
|
|
|
vtDecimal64,
|
2020-09-10 03:37:00 +00:00
|
|
|
vtDecimal128,
|
2020-11-20 22:47:04 +00:00
|
|
|
vtDecimal256,
|
2020-12-29 15:09:53 +00:00
|
|
|
vtArray,
|
2020-12-27 15:49:34 +00:00
|
|
|
vtFixedString
|
2017-04-01 07:20:54 +00:00
|
|
|
};
|
2016-04-10 02:32:59 +00:00
|
|
|
|
2018-10-12 02:09:47 +00:00
|
|
|
Block sample_block;
|
2018-10-12 02:26:48 +00:00
|
|
|
std::vector<std::pair<ValueType, bool /* is_nullable */>> types;
|
2016-04-10 02:32:59 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
void init(const Block & sample_block_);
|
2016-04-10 02:32:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|