iceberg-cpp
Loading...
Searching...
No Matches
json_serde_internal.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
22#include <nlohmann/json_fwd.hpp>
23
25#include "iceberg/iceberg_export.h"
26#include "iceberg/result.h"
27#include "iceberg/type_fwd.h"
28
31
32namespace iceberg {
33
38ICEBERG_EXPORT Result<Expression::Operation> OperationTypeFromJson(
39 const nlohmann::json& json);
40
45ICEBERG_EXPORT nlohmann::json ToJson(Expression::Operation op);
46
53ICEBERG_EXPORT Result<std::shared_ptr<Expression>> ExpressionFromJson(
54 const nlohmann::json& json, const Schema* schema = nullptr);
55
60ICEBERG_EXPORT Result<nlohmann::json> ToJson(const Expression& expr);
61
66ICEBERG_EXPORT Result<std::unique_ptr<NamedReference>> NamedReferenceFromJson(
67 const nlohmann::json& json);
68
73ICEBERG_EXPORT nlohmann::json ToJson(const NamedReference& ref);
74
79ICEBERG_EXPORT nlohmann::json ToJson(const UnboundTransform& transform);
80
85ICEBERG_EXPORT Result<std::unique_ptr<UnboundTransform>> UnboundTransformFromJson(
86 const nlohmann::json& json);
87
92ICEBERG_EXPORT Result<nlohmann::json> ToJson(const Literal& literal);
93
98ICEBERG_EXPORT Result<Literal> LiteralFromJson(const nlohmann::json& json);
99
105ICEBERG_EXPORT Result<Literal> LiteralFromJson(const nlohmann::json& json,
106 const Type* type);
107
112ICEBERG_EXPORT Result<nlohmann::json> ToJson(const UnboundPredicate& pred);
113
115ICEBERG_EXPORT nlohmann::json ToJson(const BoundReference& ref);
116
118ICEBERG_EXPORT nlohmann::json ToJson(const BoundTransform& transform);
119
121ICEBERG_EXPORT Result<nlohmann::json> ToJson(const BoundPredicate& pred);
122
128ICEBERG_EXPORT Result<std::unique_ptr<UnboundPredicate>> UnboundPredicateFromJson(
129 const nlohmann::json& json, const Schema* schema = nullptr);
130
135ICEBERG_EXPORT Result<nlohmann::json> ToJson(const Term& term);
136
138ICEBERG_EXPORT bool IsUnaryOperation(Expression::Operation op);
139
141ICEBERG_EXPORT bool IsSetOperation(Expression::Operation op);
142
143} // namespace iceberg
Operation
Operation types for expressions.
Definition expression.h:40