Kùzu C++ API
Loading...
Searching...
No Matches
warning_context.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <mutex>
5#include <vector>
6
7#include "api.h"
8#include "types.h"
9#include "client_config.h"
10#include "copy_from_error.h"
11
12namespace kuzu {
13namespace common {
14class ValueVector;
15}
16namespace storage {
17class ColumnChunkData;
18}
19
20namespace processor {
21
22class SerialCSVReader;
23
31
34
36public:
37 explicit WarningContext(main::ClientConfig* clientConfig);
38
39 void appendWarningMessages(const std::vector<CopyFromFileError>& messages);
40
41 void populateWarnings(uint64_t queryID, populate_func_t populateFunc = {},
42 get_file_idx_func_t getFileIdxFunc = {});
43 void defaultPopulateAllWarnings(uint64_t queryID);
44
45 const std::vector<WarningInfo>& getPopulatedWarnings() const;
46 uint64_t getWarningCount(uint64_t queryID);
48
49 void setIgnoreErrorsForCurrentQuery(bool ignoreErrors);
50 // NOTE: this function only works if the logical operator is COPY FROM
51 // for other operators setIgnoreErrorsForCurrentQuery() is not called
53
54private:
55 std::mutex mtx;
56 main::ClientConfig* clientConfig;
57 std::vector<CopyFromFileError> unpopulatedWarnings;
58 std::vector<WarningInfo> populatedWarnings;
59 uint64_t queryWarningCount;
60 uint64_t numStoredWarnings;
61 bool ignoreErrorsOption;
62};
63
64} // namespace processor
65} // namespace kuzu
#define KUZU_API
Definition api.h:25
Definition warning_context.h:35
void setIgnoreErrorsForCurrentQuery(bool ignoreErrors)
void populateWarnings(uint64_t queryID, populate_func_t populateFunc={}, get_file_idx_func_t getFileIdxFunc={})
WarningContext(main::ClientConfig *clientConfig)
const std::vector< WarningInfo > & getPopulatedWarnings() const
uint64_t getWarningCount(uint64_t queryID)
void defaultPopulateAllWarnings(uint64_t queryID)
void appendWarningMessages(const std::vector< CopyFromFileError > &messages)
uint32_t idx_t
Definition types.h:44
std::function< common::idx_t(const CopyFromFileError &)> get_file_idx_func_t
Definition warning_context.h:33
std::function< PopulatedCopyFromError(CopyFromFileError, common::idx_t)> populate_func_t
Definition warning_context.h:32
Definition array_utils.h:7
Definition client_config.h:26
Definition copy_from_error.h:69
Definition copy_from_error.h:82
Definition warning_context.h:24
PopulatedCopyFromError warning
Definition warning_context.h:26
uint64_t queryID
Definition warning_context.h:25
WarningInfo(PopulatedCopyFromError warning, uint64_t queryID)
Definition warning_context.h:28