forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAsynchronousInsertLog.h
More file actions
56 lines (45 loc) · 1.34 KB
/
AsynchronousInsertLog.h
File metadata and controls
56 lines (45 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include <Interpreters/AsynchronousInsertQueueDataKind.h>
#include <Interpreters/SystemLog.h>
#include <Core/NamesAndAliases.h>
#include <Storages/ColumnsDescription.h>
namespace DB
{
struct AsynchronousInsertLogElement
{
enum Status : int8_t
{
Ok = 0,
ParsingError = 1,
FlushError = 2,
};
time_t event_time{};
Decimal64 event_time_microseconds{};
String query_id;
String query_for_logging;
String database;
String table;
String format;
UInt64 bytes{};
UInt64 rows{};
String exception;
Status status{};
using DataKind = AsynchronousInsertQueueDataKind;
DataKind data_kind{};
time_t flush_time{};
Decimal64 flush_time_microseconds{};
String flush_query_id;
UInt64 timeout_milliseconds = 0;
static std::string name() { return "AsynchronousInsertLog"; }
static ColumnsDescription getColumnsDescription();
static NamesAndAliases getNamesAndAliases() { return {}; }
void appendToBlock(MutableColumns & columns) const;
};
class AsynchronousInsertLog : public SystemLog<AsynchronousInsertLogElement>
{
public:
using SystemLog<AsynchronousInsertLogElement>::SystemLog;
/// This table is usually queried for fixed table name.
static const char * getDefaultOrderBy() { return "database, table, event_date, event_time"; }
};
}