mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 21:24:28 +00:00
Style fixes
This commit is contained in:
parent
c1f9fcc3d5
commit
7afff3d661
@ -1,22 +0,0 @@
|
|||||||
#include <Core/DateTime64.h>
|
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
namespace DB {
|
|
||||||
|
|
||||||
//static constexpr UInt32 NANOS_PER_SECOND = 1000 * 1000 * 1000;
|
|
||||||
|
|
||||||
//DateTime64::Components DateTime64::split() const
|
|
||||||
//{
|
|
||||||
// auto datetime = static_cast<time_t>(t / NANOS_PER_SECOND);
|
|
||||||
// auto nanos = static_cast<UInt32>(t % NANOS_PER_SECOND);
|
|
||||||
// return Components { datetime, nanos };
|
|
||||||
//}
|
|
||||||
|
|
||||||
//DateTime64::DateTime64(DateTime64::Components c)
|
|
||||||
// : t {c.datetime * NANOS_PER_SECOND + c.nanos}
|
|
||||||
//{
|
|
||||||
// assert(c.nanos < NANOS_PER_SECOND);
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Core/Types.h>
|
|
||||||
|
|
||||||
namespace DB {
|
|
||||||
|
|
||||||
//// this is a separate struct to avoid accidental conversions that
|
|
||||||
//// might occur between time_t and the type storing the datetime64
|
|
||||||
//// time_t might have a different definition on different libcs
|
|
||||||
//struct DateTime64 {
|
|
||||||
// using Type = Int64;
|
|
||||||
// struct Components {
|
|
||||||
// time_t datetime = 0;
|
|
||||||
// UInt32 nanos = 0;
|
|
||||||
// };
|
|
||||||
|
|
||||||
// Components split() const;
|
|
||||||
// explicit DateTime64(Components c);
|
|
||||||
// explicit DateTime64(Type tt) : t{tt} {}
|
|
||||||
// explicit operator bool() const {
|
|
||||||
// return t != 0;
|
|
||||||
// }
|
|
||||||
// Type get() const { return t; }
|
|
||||||
//private:
|
|
||||||
// Type t;
|
|
||||||
//};
|
|
||||||
|
|
||||||
}
|
|
@ -48,7 +48,8 @@ protected:
|
|||||||
* Server time zone is the time zone specified in 'timezone' parameter in configuration file,
|
* Server time zone is the time zone specified in 'timezone' parameter in configuration file,
|
||||||
* or system time zone at the moment of server startup.
|
* or system time zone at the moment of server startup.
|
||||||
*/
|
*/
|
||||||
class DataTypeDateTime final : public DataTypeNumberBase<UInt32>, public TimezoneMixin {
|
class DataTypeDateTime final : public DataTypeNumberBase<UInt32>, public TimezoneMixin
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
explicit DataTypeDateTime(const std::string & time_zone_name = "");
|
explicit DataTypeDateTime(const std::string & time_zone_name = "");
|
||||||
|
|
||||||
@ -79,7 +80,8 @@ public:
|
|||||||
*
|
*
|
||||||
* `scale` determines number of decimal places for sub-second part of the DateTime64.
|
* `scale` determines number of decimal places for sub-second part of the DateTime64.
|
||||||
*/
|
*/
|
||||||
class DataTypeDateTime64 final : public DataTypeDecimalBase<DateTime64>, public TimezoneMixin {
|
class DataTypeDateTime64 final : public DataTypeDecimalBase<DateTime64>, public TimezoneMixin
|
||||||
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr UInt8 default_scale = 3;
|
static constexpr UInt8 default_scale = 3;
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@ namespace ErrorCodes
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class Transform>
|
template<class Transform>
|
||||||
struct WithDateTime64Converter : public Transform {
|
struct WithDateTime64Converter : public Transform
|
||||||
|
{
|
||||||
UInt8 scale;
|
UInt8 scale;
|
||||||
Transform transform;
|
Transform transform;
|
||||||
|
|
||||||
|
@ -16,7 +16,8 @@ namespace ErrorCodes
|
|||||||
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
|
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
DateTime64::NativeType nowSubsecond(UInt32 scale) {
|
DateTime64::NativeType nowSubsecond(UInt32 scale)
|
||||||
|
{
|
||||||
timespec spec;
|
timespec spec;
|
||||||
clock_gettime(CLOCK_REALTIME, &spec);
|
clock_gettime(CLOCK_REALTIME, &spec);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user