mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-01 06:00:49 +00:00
47 lines
1.8 KiB
C++
47 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <common/StringRef.h>
|
|
#include <Common/Exception.h>
|
|
#include <Core/Types.h>
|
|
|
|
namespace DB
|
|
{
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int NOT_IMPLEMENTED;
|
|
}
|
|
|
|
/// This class can be used as an argument for the template class FunctionJSON when we unable to parse JSONs.
|
|
/// It can't do anything useful and just throws an exception.
|
|
struct DummyJSONParser
|
|
{
|
|
static constexpr bool need_preallocate = false;
|
|
void preallocate(size_t) {}
|
|
bool parse(const char *, size_t) { throw Exception{"Functions JSON* are not supported without AVX2", ErrorCodes::NOT_IMPLEMENTED}; }
|
|
|
|
using Iterator = std::nullptr_t;
|
|
Iterator getRoot() const { return nullptr; }
|
|
|
|
static bool downToArray(Iterator &) { return false; }
|
|
static bool downToObject(Iterator &) { return false; }
|
|
static bool downToObject(Iterator &, StringRef &) { return false; }
|
|
static bool parentScopeIsObject(const Iterator &) { return false; }
|
|
static bool next(Iterator &) { return false; }
|
|
static bool nextKeyValue(Iterator &) { return false; }
|
|
static bool nextKeyValue(Iterator &, StringRef &) { return false; }
|
|
static bool isInteger(const Iterator &) { return false; }
|
|
static bool isFloat(const Iterator &) { return false; }
|
|
static bool isString(const Iterator &) { return false; }
|
|
static bool isArray(const Iterator &) { return false; }
|
|
static bool isObject(const Iterator &) { return false; }
|
|
static bool isBool(const Iterator &) { return false; }
|
|
static bool isNull(const Iterator &) { return false; }
|
|
static StringRef getKey(const Iterator &) { return {}; }
|
|
static StringRef getString(const Iterator &) { return {}; }
|
|
static Int64 getInteger(const Iterator &) { return 0; }
|
|
static double getFloat(const Iterator &) { return 0; }
|
|
static bool getBool(const Iterator &) { return false; }
|
|
};
|
|
|
|
}
|