OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JsonAccessors.h File Reference

Checked json field retrieval. More...

#include <iostream>
#include <rapidjson/document.h>
#include "Logger/Logger.h"
+ Include dependency graph for JsonAccessors.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const rapidjson::Value & field (const rapidjson::Value &obj, const char field[]) noexcept
 
const int64_t json_i64 (const rapidjson::Value &obj) noexcept
 
const std::string json_str (const rapidjson::Value &obj) noexcept
 
const bool json_bool (const rapidjson::Value &obj) noexcept
 
const double json_double (const rapidjson::Value &obj) noexcept
 

Detailed Description

Checked json field retrieval.

Definition in file JsonAccessors.h.

Function Documentation

const rapidjson::Value& field ( const rapidjson::Value &  obj,
const char  field[] 
)
inlinenoexcept

Definition at line 33 of file JsonAccessors.h.

References CHECK.

Referenced by ExtensionFunctionsWhitelist::addCommon(), org.apache.calcite.sql2rel.SqlToRelConverter::adjustInputRef(), ArrowResultSet::ArrowResultSet(), RelAlgDagBuilder::build(), anonymous_namespace{RelAlgDag.cpp}::check_empty_inputs_field(), org.apache.calcite.sql.validate.SqlValidatorImpl::checkFieldCount(), CodeGenerator::codegen(), org.apache.calcite.sql2rel.SqlToRelConverter::collectInsertTargets(), org.apache.calcite.sql2rel.SqlToRelConverter::convertColumnList(), org.apache.calcite.sql2rel.SqlToRelConverter::convertLiteralInValuesList(), org.apache.calcite.sql2rel.SqlToRelConverter::convertMerge(), org.apache.calcite.sql2rel.SqlToRelConverter::convertUpdate(), org.apache.calcite.sql2rel.SqlToRelConverter::convertUsing(), org.apache.calcite.sql2rel.SqlToRelConverter::createSource(), details::RelAlgDispatcher::dispatchAggregate(), details::RelAlgDispatcher::dispatchFilter(), details::RelAlgDispatcher::dispatchJoin(), details::RelAlgDispatcher::dispatchLogicalValues(), details::RelAlgDispatcher::dispatchModify(), details::RelAlgDispatcher::dispatchProject(), details::RelAlgDispatcher::dispatchSort(), details::RelAlgDispatcher::dispatchTableFunction(), details::RelAlgDispatcher::dispatchUnion(), org.apache.calcite.sql2rel.SqlToRelConverter::distinctify(), org.apache.calcite.sql.validate.SqlValidatorImpl::expandStar(), ExtractExpr::generate(), DateTruncExpr::generate(), anonymous_namespace{RelAlgDag.cpp}::get_int_literal_field(), import_export::delimited_parser::get_row(), ArrowResultSetConverter::getArrowBatch(), anonymous_namespace{RelAlgDag.cpp}::getCatalogAndTableFromScanNode(), org.apache.calcite.sql2rel.SqlToRelConverter::getCorrelationUse(), anonymous_namespace{ExpressionRange.cpp}::getDateTimePrecisionCastRange(), anonymous_namespace{RelAlgDag.cpp}::getFieldNamesFromScanNode(), anonymous_namespace{DBETypes.cpp}::getFieldValue(), details::RelAlgDispatcher::getRelAlgHints(), details::RelAlgDispatcher::getRelAlgInputs(), ArrowResultSetConverter::initializeColumnBuilder(), boost::serialization::load_construct_data(), org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard::lookupExp(), org.apache.calcite.sql.validate.SqlValidatorImpl::lookupFieldNamespace(), org.apache.calcite.sql.validate.SqlValidatorImpl::lookupNameCompletionHints(), ArrowResultSetConverter::makeField(), msg_consume(), anonymous_namespace{RelAlgDag.cpp}::node_id(), org.apache.calcite.rel.rules.InjectFilterRule::onMatch(), anonymous_namespace{RelAlgDag.cpp}::parse_abstract_input(), anonymous_namespace{RelAlgDag.cpp}::parse_aggregate_expr(), anonymous_namespace{RelAlgDag.cpp}::parse_case(), anonymous_namespace{RelAlgDag.cpp}::parse_literal(), anonymous_namespace{RelAlgDag.cpp}::parse_nulls_position(), anonymous_namespace{RelAlgDag.cpp}::parse_operator(), anonymous_namespace{RelAlgDag.cpp}::parse_scalar_expr(), anonymous_namespace{RelAlgDag.cpp}::parse_sort_direction(), anonymous_namespace{RelAlgDag.cpp}::parse_subquery(), anonymous_namespace{RelAlgDag.cpp}::parse_type(), anonymous_namespace{RelAlgDag.cpp}::parse_window_bound(), anonymous_namespace{RelAlgDag.cpp}::parse_window_order_exprs(), ArrowForeignStorage::prepareTable(), org.apache.calcite.sql.validate.SqlValidatorImpl::rewriteUpdateToMerge(), details::RelAlgDispatcher::run(), QueryRunner::QueryRunner::runMultipleStatements(), stream_insert(), ai.heavy.jdbc.HeavyAIDatabaseMetaData::tablePermProcess(), org.apache.calcite.rel.externalize.HeavyDBRelJson::toFieldCollation(), org.apache.calcite.rel.externalize.HeavyDBRelJson::toJson(), org.apache.calcite.rel.externalize.HeavyDBRelJson::toRex(), RelAlgTranslator::translateDateadd(), RelAlgTranslator::translateDatediff(), anonymous_namespace{ArrowResultSet.cpp}::type_from_arrow_field(), org.apache.calcite.sql.validate.SqlValidatorImpl::validateUsingCol(), org.apache.calcite.sql.validate.SqlValidatorImpl.DeriveTypeVisitor::visit(), and org.apache.calcite.sql.validate.SqlValidatorImpl.OrderExpressionExpander::visit().

34  {
35  CHECK(obj.IsObject());
36  const auto field_it = obj.FindMember(field);
37  CHECK(field_it != obj.MemberEnd());
38  return field_it->value;
39 }
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:33
#define CHECK(condition)
Definition: Logger.h:291
const double json_double ( const rapidjson::Value &  obj)
inlinenoexcept

Definition at line 56 of file JsonAccessors.h.

References CHECK.

Referenced by anonymous_namespace{RelAlgDag.cpp}::parse_literal(), and Parser::anonymous_namespace{ParserNode.cpp}::parse_options().

56  {
57  CHECK(obj.IsDouble());
58  return obj.GetDouble();
59 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

const int64_t json_i64 ( const rapidjson::Value &  obj)
inlinenoexcept

Definition at line 41 of file JsonAccessors.h.

References CHECK.

Referenced by Parser::column_from_json(), details::RelAlgDispatcher::dispatchSort(), AlterTableCommand::execute(), anonymous_namespace{RelAlgDag.cpp}::parse_abstract_input(), Parser::anonymous_namespace{ParserNode.cpp}::parse_insert_literal(), anonymous_namespace{RelAlgDag.cpp}::parse_literal(), Parser::anonymous_namespace{ParserNode.cpp}::parse_options(), anonymous_namespace{RelAlgDag.cpp}::parse_type(), and anonymous_namespace{RelAlgDag.cpp}::parse_window_bound().

41  {
42  CHECK(obj.IsInt64());
43  return obj.GetInt64();
44 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

const std::string json_str ( const rapidjson::Value &  obj)
inlinenoexcept

Definition at line 46 of file JsonAccessors.h.

References CHECK.

Referenced by __attribute__(), ExtensionFunctionsWhitelist::addCommon(), Parser::AlterUserStmt::AlterUserStmt(), Parser::column_from_json(), Parser::CopyTableStmt::CopyTableStmt(), Parser::CreateDataframeStmt::CreateDataframeStmt(), Parser::CreateDBStmt::CreateDBStmt(), Parser::CreateModelStmt::CreateModelStmt(), Parser::CreateRoleStmt::CreateRoleStmt(), Parser::CreateTableStmt::CreateTableStmt(), Parser::CreateUserStmt::CreateUserStmt(), Parser::CreateViewStmt::CreateViewStmt(), details::RelAlgDispatcher::dispatchJoin(), details::RelAlgDispatcher::dispatchLogicalValues(), details::RelAlgDispatcher::dispatchModify(), details::RelAlgDispatcher::dispatchTableFunction(), Parser::DropDBStmt::DropDBStmt(), Parser::DropModelStmt::DropModelStmt(), Parser::DropRoleStmt::DropRoleStmt(), Parser::DropTableStmt::DropTableStmt(), Parser::DropUserStmt::DropUserStmt(), Parser::DropViewStmt::DropViewStmt(), Parser::DumpRestoreTableStmtBase::DumpRestoreTableStmtBase(), AlterTableCommand::execute(), Parser::ExportQueryStmt::ExportQueryStmt(), Parser::get_columns_from_json_payload(), get_json_str_from_file_header(), details::RelAlgDispatcher::getRelAlgHints(), Parser::GrantPrivilegesStmt::GrantPrivilegesStmt(), Parser::GrantRoleStmt::GrantRoleStmt(), Parser::InsertIntoTableAsSelectStmt::InsertIntoTableAsSelectStmt(), Parser::InsertValuesStmt::InsertValuesStmt(), anonymous_namespace{RelAlgDag.cpp}::node_id(), Parser::OptimizeTableStmt::OptimizeTableStmt(), anonymous_namespace{RelAlgDag.cpp}::parse_aggregate_expr(), Parser::anonymous_namespace{ParserNode.cpp}::parse_elements(), Parser::anonymous_namespace{ParserNode.cpp}::parse_insert_literal(), anonymous_namespace{RelAlgDag.cpp}::parse_literal(), anonymous_namespace{RelAlgDag.cpp}::parse_nulls_position(), anonymous_namespace{RelAlgDag.cpp}::parse_operator(), anonymous_namespace{RelAlgDag.cpp}::parse_scalar_expr(), anonymous_namespace{RelAlgDag.cpp}::parse_sort_direction(), anonymous_namespace{RelAlgDag.cpp}::parse_type(), Parser::RenameDBStmt::RenameDBStmt(), Parser::RenameTableStmt::RenameTableStmt(), Parser::RenameUserStmt::RenameUserStmt(), Parser::RevokePrivilegesStmt::RevokePrivilegesStmt(), Parser::RevokeRoleStmt::RevokeRoleStmt(), details::RelAlgDispatcher::run(), logger::DebugTimer::stopAndGetJson(), Parser::TruncateTableStmt::TruncateTableStmt(), and Parser::ValidateStmt::ValidateStmt().

46  {
47  CHECK(obj.IsString());
48  return obj.GetString();
49 }
#define CHECK(condition)
Definition: Logger.h:291