FieldToDataType.h 703 字节
Newer Older
1 2
#pragma once

3
#include <Core/FieldVisitors.h>
4

5 6 7 8

namespace DB
{

9 10 11 12
class IDataType;
using DataTypePtr = std::shared_ptr<IDataType>;


F
f1yegor 已提交
13 14
/** For a given value, Field returns the minimum data type that allows this value to be stored.
  * In case Field is an array, converts all elements to a common type.
15
  */
16
class FieldToDataType : public StaticVisitor<DataTypePtr>
17 18
{
public:
19 20 21 22 23 24 25
    DataTypePtr operator() (Null & x) const;
    DataTypePtr operator() (UInt64 & x) const;
    DataTypePtr operator() (Int64 & x) const;
    DataTypePtr operator() (Float64 & x) const;
    DataTypePtr operator() (String & x) const;
    DataTypePtr operator() (Array & x) const;
    DataTypePtr operator() (Tuple & x) const;
26 27 28 29
};

}