From c1fd6925e81d0bbac347abbce845677b271c7172 Mon Sep 17 00:00:00 2001 From: Keenan Gugeler Date: Tue, 12 Sep 2023 13:46:49 -0400 Subject: [PATCH] Split value.h This file was recompiled the most in the entire project. --- src/c_api/connection.cpp | 7 +- src/c_api/flat_tuple.cpp | 1 + src/c_api/prepared_statement.cpp | 2 +- src/c_api/value.cpp | 6 +- src/common/arrow/arrow_row_batch.cpp | 4 +- src/common/types/CMakeLists.txt | 7 +- src/common/types/value/CMakeLists.txt | 11 ++ src/common/types/value/nested.cpp | 21 ++ src/common/types/value/node.cpp | 87 ++++++++ src/common/types/value/recursive_rel.cpp | 29 +++ src/common/types/value/rel.cpp | 91 +++++++++ src/common/types/{ => value}/value.cpp | 186 +----------------- src/common/vector/value_vector.cpp | 2 + src/expression_evaluator/case_evaluator.cpp | 6 + .../expression_evaluator_utils.cpp | 1 + .../literal_evaluator.cpp | 2 + .../binder/expression/literal_expression.h | 2 +- .../binder/expression/parameter_expression.h | 2 +- src/include/binder/expression_binder.h | 5 +- .../common/copier_config/copier_config.h | 4 +- src/include/common/types/value/nested.h | 18 ++ src/include/common/types/value/node.h | 72 +++++++ .../common/types/value/recursive_rel.h | 29 +++ src/include/common/types/value/rel.h | 72 +++++++ src/include/common/types/{ => value}/value.h | 139 ------------- src/include/common/vector/value_vector.h | 4 +- src/include/function/table_functions.h | 1 + src/include/main/settings.h | 2 +- .../expression/parsed_literal_expression.h | 2 +- .../processor/operator/call/standalone_call.h | 1 + .../processor/result/factorized_table.h | 1 + src/include/processor/result/flat_tuple.h | 9 +- src/include/storage/copier/column_chunk.h | 1 + .../storage/storage_structure/column.h | 2 +- .../storage_structure/disk_overflow_file.h | 1 + .../storage/storage_structure/in_mem_file.h | 2 +- .../storage/storage_structure/lists/lists.h | 1 - src/main/query_result.cpp | 2 + src/planner/operator/logical_dummy_scan.cpp | 2 + src/processor/operator/persistent/copy_to.cpp | 3 - .../operator/persistent/csv_file_writer.cpp | 7 + src/processor/result/flat_tuple.cpp | 1 + src/storage/copier/column_chunk.cpp | 1 + src/storage/copier/struct_column_chunk.cpp | 1 + src/storage/copier/var_list_column_chunk.cpp | 1 + .../storage_structure/disk_overflow_file.cpp | 1 + src/storage/storage_structure/in_mem_file.cpp | 1 + tools/java_api/src/jni/kuzu_java.cpp | 5 +- tools/nodejs_api/src_cpp/node_util.cpp | 5 + tools/python_api/src_cpp/py_query_result.cpp | 3 + .../src_cpp/py_query_result_converter.cpp | 2 +- tools/rust_api/include/kuzu_rs.h | 5 + 52 files changed, 526 insertions(+), 347 deletions(-) create mode 100644 src/common/types/value/CMakeLists.txt create mode 100644 src/common/types/value/nested.cpp create mode 100644 src/common/types/value/node.cpp create mode 100644 src/common/types/value/recursive_rel.cpp create mode 100644 src/common/types/value/rel.cpp rename src/common/types/{ => value}/value.cpp (76%) create mode 100644 src/include/common/types/value/nested.h create mode 100644 src/include/common/types/value/node.h create mode 100644 src/include/common/types/value/recursive_rel.h create mode 100644 src/include/common/types/value/rel.h rename src/include/common/types/{ => value}/value.h (76%) diff --git a/src/c_api/connection.cpp b/src/c_api/connection.cpp index 8662ed147b..bc1c4925be 100644 --- a/src/c_api/connection.cpp +++ b/src/c_api/connection.cpp @@ -1,10 +1,15 @@ #include "binder/bound_statement_result.h" #include "c_api/kuzu.h" #include "common/exception/exception.h" -#include "common/types/value.h" #include "main/kuzu.h" #include "planner/logical_plan/logical_plan.h" +namespace kuzu { +namespace common { +class Value; +} +} // namespace kuzu + using namespace kuzu::common; using namespace kuzu::main; diff --git a/src/c_api/flat_tuple.cpp b/src/c_api/flat_tuple.cpp index f949e46e7e..43948b2f7f 100644 --- a/src/c_api/flat_tuple.cpp +++ b/src/c_api/flat_tuple.cpp @@ -1,6 +1,7 @@ #include "processor/result/flat_tuple.h" #include "c_api/kuzu.h" +#include "common/exception/exception.h" using namespace kuzu::common; using namespace kuzu::processor; diff --git a/src/c_api/prepared_statement.cpp b/src/c_api/prepared_statement.cpp index 53a438f16e..e7a47b20d5 100644 --- a/src/c_api/prepared_statement.cpp +++ b/src/c_api/prepared_statement.cpp @@ -1,6 +1,6 @@ #include "binder/bound_statement.h" #include "c_api/kuzu.h" -#include "common/types/value.h" +#include "common/types/value/value.h" #include "main/kuzu.h" #include "planner/logical_plan/logical_plan.h" diff --git a/src/c_api/value.cpp b/src/c_api/value.cpp index 315b814ac2..6d56533935 100644 --- a/src/c_api/value.cpp +++ b/src/c_api/value.cpp @@ -1,8 +1,12 @@ -#include "common/types/value.h" +#include "common/types/value/value.h" #include "c_api/kuzu.h" #include "common/types/internal_id_t.h" #include "common/types/types.h" +#include "common/types/value/nested.h" +#include "common/types/value/node.h" +#include "common/types/value/recursive_rel.h" +#include "common/types/value/rel.h" #include "main/kuzu.h" using namespace kuzu::common; diff --git a/src/common/arrow/arrow_row_batch.cpp b/src/common/arrow/arrow_row_batch.cpp index f2fe3558a1..c99e0f93e4 100644 --- a/src/common/arrow/arrow_row_batch.cpp +++ b/src/common/arrow/arrow_row_batch.cpp @@ -1,6 +1,8 @@ #include "common/arrow/arrow_row_batch.h" -#include "common/types/value.h" +#include "common/types/value/node.h" +#include "common/types/value/rel.h" +#include "common/types/value/value.h" #include "storage/storage_utils.h" namespace kuzu { diff --git a/src/common/types/CMakeLists.txt b/src/common/types/CMakeLists.txt index 3535d4c3f7..1560ff109f 100644 --- a/src/common/types/CMakeLists.txt +++ b/src/common/types/CMakeLists.txt @@ -1,15 +1,16 @@ +add_subdirectory(value) + add_library(kuzu_common_types OBJECT + blob.cpp date_t.cpp dtime_t.cpp internal_id_t.cpp interval_t.cpp ku_list.cpp ku_string.cpp - value.cpp timestamp_t.cpp - types.cpp - blob.cpp) + types.cpp) set(ALL_OBJECT_FILES ${ALL_OBJECT_FILES} $ diff --git a/src/common/types/value/CMakeLists.txt b/src/common/types/value/CMakeLists.txt new file mode 100644 index 0000000000..d0d27de9d8 --- /dev/null +++ b/src/common/types/value/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(kuzu_common_types_value + OBJECT + nested.cpp + node.cpp + recursive_rel.cpp + rel.cpp + value.cpp) + +set(ALL_OBJECT_FILES + ${ALL_OBJECT_FILES} $ + PARENT_SCOPE) diff --git a/src/common/types/value/nested.cpp b/src/common/types/value/nested.cpp new file mode 100644 index 0000000000..2e4d49ca18 --- /dev/null +++ b/src/common/types/value/nested.cpp @@ -0,0 +1,21 @@ +#include "common/types/value/nested.h" + +#include "common/exception/runtime.h" +#include "common/types/value/value.h" + +namespace kuzu { +namespace common { + +uint32_t NestedVal::getChildrenSize(const Value* val) { + return val->childrenSize; +} + +Value* NestedVal::getChildVal(const Value* val, uint32_t idx) { + if (idx > val->childrenSize) { + throw RuntimeException("NestedVal::getChildPointer index out of bound."); + } + return val->children[idx].get(); +} + +} // namespace common +} // namespace kuzu diff --git a/src/common/types/value/node.cpp b/src/common/types/value/node.cpp new file mode 100644 index 0000000000..77b5b7e247 --- /dev/null +++ b/src/common/types/value/node.cpp @@ -0,0 +1,87 @@ +#include "common/types/value/node.h" + +#include "common/constants.h" +#include "common/types/types.h" +#include "common/types/value/value.h" +#include "spdlog/fmt/fmt.h" + +namespace kuzu { +namespace common { + +std::vector>> NodeVal::getProperties( + const Value* val) { + throwIfNotNode(val); + std::vector>> properties; + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + for (auto i = 0u; i < val->childrenSize; ++i) { + auto currKey = fieldNames[i]; + if (currKey == InternalKeyword::ID || currKey == InternalKeyword::LABEL) { + continue; + } + properties.emplace_back(currKey, val->children[i]->copy()); + } + return properties; +} + +uint64_t NodeVal::getNumProperties(const Value* val) { + throwIfNotNode(val); + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + return fieldNames.size() - OFFSET; +} + +std::string NodeVal::getPropertyName(const Value* val, uint64_t index) { + throwIfNotNode(val); + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + if (index >= fieldNames.size() - OFFSET) { + return ""; + } + return fieldNames[index + OFFSET]; +} + +Value* NodeVal::getPropertyVal(const Value* val, uint64_t index) { + throwIfNotNode(val); + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + if (index >= fieldNames.size() - OFFSET) { + return nullptr; + } + return val->children[index + OFFSET].get(); +} + +Value* NodeVal::getNodeIDVal(const Value* val) { + throwIfNotNode(val); + auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::ID); + return val->children[fieldIdx].get(); +} + +Value* NodeVal::getLabelVal(const Value* val) { + throwIfNotNode(val); + auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::LABEL); + return val->children[fieldIdx].get(); +} + +nodeID_t NodeVal::getNodeID(const Value* val) { + throwIfNotNode(val); + auto nodeIDVal = getNodeIDVal(val); + return nodeIDVal->getValue(); +} + +std::string NodeVal::getLabelName(const Value* val) { + throwIfNotNode(val); + auto labelVal = getLabelVal(val); + return labelVal->getValue(); +} + +std::string NodeVal::toString(const Value* val) { + throwIfNotNode(val); + return val->toString(); +} + +void NodeVal::throwIfNotNode(const Value* val) { + if (val->dataType->getLogicalTypeID() != LogicalTypeID::NODE) { + auto actualType = LogicalTypeUtils::dataTypeToString(val->dataType->getLogicalTypeID()); + throw Exception(fmt::format("Expected NODE type, but got {} type", actualType)); + } +} + +} // namespace common +} // namespace kuzu diff --git a/src/common/types/value/recursive_rel.cpp b/src/common/types/value/recursive_rel.cpp new file mode 100644 index 0000000000..aa45ac2a13 --- /dev/null +++ b/src/common/types/value/recursive_rel.cpp @@ -0,0 +1,29 @@ +#include "common/types/value/recursive_rel.h" + +#include "common/exception/exception.h" +#include "common/types/types.h" +#include "common/types/value/value.h" +#include "spdlog/fmt/fmt.h" + +namespace kuzu { +namespace common { + +Value* RecursiveRelVal::getNodes(const Value* val) { + throwIfNotRecursiveRel(val); + return val->children[0].get(); +} + +Value* RecursiveRelVal::getRels(const Value* val) { + throwIfNotRecursiveRel(val); + return val->children[1].get(); +} + +void RecursiveRelVal::throwIfNotRecursiveRel(const Value* val) { + if (val->dataType->getLogicalTypeID() != LogicalTypeID::RECURSIVE_REL) { + auto actualType = LogicalTypeUtils::dataTypeToString(val->dataType->getLogicalTypeID()); + throw Exception(fmt::format("Expected RECURSIVE_REL type, but got {} type", actualType)); + } +} + +} // namespace common +} // namespace kuzu diff --git a/src/common/types/value/rel.cpp b/src/common/types/value/rel.cpp new file mode 100644 index 0000000000..6de3344f18 --- /dev/null +++ b/src/common/types/value/rel.cpp @@ -0,0 +1,91 @@ +#include "common/types/value/rel.h" + +#include "common/constants.h" +#include "common/types/value/value.h" +#include "spdlog/fmt/fmt.h" + +namespace kuzu { +namespace common { + +std::vector>> RelVal::getProperties( + const Value* val) { + throwIfNotRel(val); + std::vector>> properties; + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + for (auto i = 0u; i < val->childrenSize; ++i) { + auto currKey = fieldNames[i]; + if (currKey == InternalKeyword::ID || currKey == InternalKeyword::LABEL || + currKey == InternalKeyword::SRC || currKey == InternalKeyword::DST) { + continue; + } + auto currVal = val->children[i]->copy(); + properties.emplace_back(currKey, std::move(currVal)); + } + return properties; +} + +uint64_t RelVal::getNumProperties(const Value* val) { + throwIfNotRel(val); + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + return fieldNames.size() - OFFSET; +} + +std::string RelVal::getPropertyName(const Value* val, uint64_t index) { + throwIfNotRel(val); + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + if (index >= fieldNames.size() - OFFSET) { + return ""; + } + return fieldNames[index + OFFSET]; +} + +Value* RelVal::getPropertyVal(const Value* val, uint64_t index) { + throwIfNotRel(val); + auto fieldNames = StructType::getFieldNames(val->dataType.get()); + if (index >= fieldNames.size() - OFFSET) { + return nullptr; + } + return val->children[index + OFFSET].get(); +} + +Value* RelVal::getSrcNodeIDVal(const Value* val) { + auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::SRC); + return val->children[fieldIdx].get(); +} + +Value* RelVal::getDstNodeIDVal(const Value* val) { + auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::DST); + return val->children[fieldIdx].get(); +} + +nodeID_t RelVal::getSrcNodeID(const Value* val) { + throwIfNotRel(val); + auto srcNodeIDVal = getSrcNodeIDVal(val); + return srcNodeIDVal->getValue(); +} + +nodeID_t RelVal::getDstNodeID(const Value* val) { + throwIfNotRel(val); + auto dstNodeIDVal = getDstNodeIDVal(val); + return dstNodeIDVal->getValue(); +} + +std::string RelVal::getLabelName(const Value* val) { + auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::LABEL); + return val->children[fieldIdx]->getValue(); +} + +std::string RelVal::toString(const Value* val) { + throwIfNotRel(val); + return val->toString(); +} + +void RelVal::throwIfNotRel(const Value* val) { + if (val->dataType->getLogicalTypeID() != LogicalTypeID::REL) { + auto actualType = LogicalTypeUtils::dataTypeToString(val->dataType->getLogicalTypeID()); + throw Exception(fmt::format("Expected REL type, but got {} type", actualType)); + } +} + +} // namespace common +} // namespace kuzu diff --git a/src/common/types/value.cpp b/src/common/types/value/value.cpp similarity index 76% rename from src/common/types/value.cpp rename to src/common/types/value/value.cpp index 9b79a42c4f..279dc23944 100644 --- a/src/common/types/value.cpp +++ b/src/common/types/value/value.cpp @@ -1,8 +1,7 @@ -#include "common/types/value.h" +#include "common/types/value/value.h" #include "common/null_buffer.h" #include "common/ser_deser.h" -#include "common/string_utils.h" #include "common/types/blob.h" #include "storage/storage_utils.h" @@ -491,17 +490,6 @@ void Value::copyFromUnion(const uint8_t* kuUnion) { } } -uint32_t NestedVal::getChildrenSize(const Value* val) { - return val->childrenSize; -} - -Value* NestedVal::getChildVal(const Value* val, uint32_t idx) { - if (idx > val->childrenSize) { - throw RuntimeException("NestedVal::getChildPointer index out of bound."); - } - return val->children[idx].get(); -} - void Value::serialize(FileInfo* fileInfo, uint64_t& offset) const { dataType->serialize(fileInfo, offset); SerDeser::serializeValue(isNull_, fileInfo, offset); @@ -600,177 +588,5 @@ std::unique_ptr Value::deserialize(FileInfo* fileInfo, uint64_t& offset) return val; } -std::vector>> NodeVal::getProperties( - const Value* val) { - throwIfNotNode(val); - std::vector>> properties; - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - for (auto i = 0u; i < val->childrenSize; ++i) { - auto currKey = fieldNames[i]; - if (currKey == InternalKeyword::ID || currKey == InternalKeyword::LABEL) { - continue; - } - properties.emplace_back(currKey, val->children[i]->copy()); - } - return properties; -} - -uint64_t NodeVal::getNumProperties(const Value* val) { - throwIfNotNode(val); - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - return fieldNames.size() - OFFSET; -} - -std::string NodeVal::getPropertyName(const Value* val, uint64_t index) { - throwIfNotNode(val); - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - if (index >= fieldNames.size() - OFFSET) { - return ""; - } - return fieldNames[index + OFFSET]; -} - -Value* NodeVal::getPropertyVal(const Value* val, uint64_t index) { - throwIfNotNode(val); - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - if (index >= fieldNames.size() - OFFSET) { - return nullptr; - } - return val->children[index + OFFSET].get(); -} - -Value* NodeVal::getNodeIDVal(const Value* val) { - throwIfNotNode(val); - auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::ID); - return val->children[fieldIdx].get(); -} - -Value* NodeVal::getLabelVal(const Value* val) { - throwIfNotNode(val); - auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::LABEL); - return val->children[fieldIdx].get(); -} - -nodeID_t NodeVal::getNodeID(const Value* val) { - throwIfNotNode(val); - auto nodeIDVal = getNodeIDVal(val); - return nodeIDVal->getValue(); -} - -std::string NodeVal::getLabelName(const Value* val) { - throwIfNotNode(val); - auto labelVal = getLabelVal(val); - return labelVal->getValue(); -} - -std::string NodeVal::toString(const Value* val) { - throwIfNotNode(val); - return val->toString(); -} - -void NodeVal::throwIfNotNode(const Value* val) { - if (val->dataType->getLogicalTypeID() != LogicalTypeID::NODE) { - auto actualType = LogicalTypeUtils::dataTypeToString(val->dataType->getLogicalTypeID()); - throw Exception(fmt::format("Expected NODE type, but got {} type", actualType)); - } -} - -std::vector>> RelVal::getProperties( - const Value* val) { - throwIfNotRel(val); - std::vector>> properties; - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - for (auto i = 0u; i < val->childrenSize; ++i) { - auto currKey = fieldNames[i]; - if (currKey == InternalKeyword::ID || currKey == InternalKeyword::LABEL || - currKey == InternalKeyword::SRC || currKey == InternalKeyword::DST) { - continue; - } - auto currVal = val->children[i]->copy(); - properties.emplace_back(currKey, std::move(currVal)); - } - return properties; -} - -uint64_t RelVal::getNumProperties(const Value* val) { - throwIfNotRel(val); - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - return fieldNames.size() - OFFSET; -} - -std::string RelVal::getPropertyName(const Value* val, uint64_t index) { - throwIfNotRel(val); - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - if (index >= fieldNames.size() - OFFSET) { - return ""; - } - return fieldNames[index + OFFSET]; -} - -Value* RelVal::getPropertyVal(const Value* val, uint64_t index) { - throwIfNotRel(val); - auto fieldNames = StructType::getFieldNames(val->dataType.get()); - if (index >= fieldNames.size() - OFFSET) { - return nullptr; - } - return val->children[index + OFFSET].get(); -} - -Value* RelVal::getSrcNodeIDVal(const Value* val) { - auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::SRC); - return val->children[fieldIdx].get(); -} - -Value* RelVal::getDstNodeIDVal(const Value* val) { - auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::DST); - return val->children[fieldIdx].get(); -} - -nodeID_t RelVal::getSrcNodeID(const Value* val) { - throwIfNotRel(val); - auto srcNodeIDVal = getSrcNodeIDVal(val); - return srcNodeIDVal->getValue(); -} - -nodeID_t RelVal::getDstNodeID(const Value* val) { - throwIfNotRel(val); - auto dstNodeIDVal = getDstNodeIDVal(val); - return dstNodeIDVal->getValue(); -} - -std::string RelVal::getLabelName(const Value* val) { - auto fieldIdx = StructType::getFieldIdx(val->dataType.get(), InternalKeyword::LABEL); - return val->children[fieldIdx]->getValue(); -} - -std::string RelVal::toString(const Value* val) { - throwIfNotRel(val); - return val->toString(); -} - -void RelVal::throwIfNotRel(const Value* val) { - if (val->dataType->getLogicalTypeID() != LogicalTypeID::REL) { - auto actualType = LogicalTypeUtils::dataTypeToString(val->dataType->getLogicalTypeID()); - throw Exception(fmt::format("Expected REL type, but got {} type", actualType)); - } -} - -Value* RecursiveRelVal::getNodes(const Value* val) { - throwIfNotRecursiveRel(val); - return val->children[0].get(); -} - -Value* RecursiveRelVal::getRels(const Value* val) { - throwIfNotRecursiveRel(val); - return val->children[1].get(); -} - -void RecursiveRelVal::throwIfNotRecursiveRel(const Value* val) { - if (val->dataType->getLogicalTypeID() != LogicalTypeID::RECURSIVE_REL) { - auto actualType = LogicalTypeUtils::dataTypeToString(val->dataType->getLogicalTypeID()); - throw Exception(fmt::format("Expected RECURSIVE_REL type, but got {} type", actualType)); - } -} - } // namespace common } // namespace kuzu diff --git a/src/common/vector/value_vector.cpp b/src/common/vector/value_vector.cpp index d343d6350e..88c99b8bb7 100644 --- a/src/common/vector/value_vector.cpp +++ b/src/common/vector/value_vector.cpp @@ -1,6 +1,8 @@ #include "common/vector/value_vector.h" #include "common/null_buffer.h" +#include "common/types/value/nested.h" +#include "common/types/value/value.h" #include "common/vector/auxiliary_buffer.h" #include diff --git a/src/expression_evaluator/case_evaluator.cpp b/src/expression_evaluator/case_evaluator.cpp index 9984568012..ba535e58ba 100644 --- a/src/expression_evaluator/case_evaluator.cpp +++ b/src/expression_evaluator/case_evaluator.cpp @@ -1,5 +1,11 @@ #include "expression_evaluator/case_evaluator.h" +#include "common/types/date_t.h" +#include "common/types/interval_t.h" +#include "common/types/ku_string.h" +#include "common/types/timestamp_t.h" +#include "common/types/types.h" + using namespace kuzu::common; using namespace kuzu::processor; using namespace kuzu::storage; diff --git a/src/expression_evaluator/expression_evaluator_utils.cpp b/src/expression_evaluator/expression_evaluator_utils.cpp index 2273b7f28e..e70dc1d71e 100644 --- a/src/expression_evaluator/expression_evaluator_utils.cpp +++ b/src/expression_evaluator/expression_evaluator_utils.cpp @@ -1,5 +1,6 @@ #include "expression_evaluator/expression_evaluator_utils.h" +#include "common/types/value/value.h" #include "processor/expression_mapper.h" using namespace kuzu::common; diff --git a/src/expression_evaluator/literal_evaluator.cpp b/src/expression_evaluator/literal_evaluator.cpp index 3f67dc7a41..4caf4cefb1 100644 --- a/src/expression_evaluator/literal_evaluator.cpp +++ b/src/expression_evaluator/literal_evaluator.cpp @@ -1,5 +1,7 @@ #include "expression_evaluator/literal_evaluator.h" +#include "common/types/value/value.h" + using namespace kuzu::common; using namespace kuzu::storage; diff --git a/src/include/binder/expression/literal_expression.h b/src/include/binder/expression/literal_expression.h index 3744f11855..f18ff86f93 100644 --- a/src/include/binder/expression/literal_expression.h +++ b/src/include/binder/expression/literal_expression.h @@ -1,6 +1,6 @@ #pragma once -#include "common/types/value.h" +#include "common/types/value/value.h" #include "expression.h" namespace kuzu { diff --git a/src/include/binder/expression/parameter_expression.h b/src/include/binder/expression/parameter_expression.h index f1377cf8e9..13f695b6a6 100644 --- a/src/include/binder/expression/parameter_expression.h +++ b/src/include/binder/expression/parameter_expression.h @@ -1,6 +1,6 @@ #pragma once -#include "common/types/value.h" +#include "common/types/value/value.h" #include "expression.h" namespace kuzu { diff --git a/src/include/binder/expression_binder.h b/src/include/binder/expression_binder.h index 5eae97d5f9..0d83c86206 100644 --- a/src/include/binder/expression_binder.h +++ b/src/include/binder/expression_binder.h @@ -2,10 +2,13 @@ #include "binder/expression/expression.h" #include "catalog/catalog.h" -#include "common/types/value.h" #include "parser/expression/parsed_expression.h" namespace kuzu { +namespace common { +class Value; +} + namespace binder { class Binder; diff --git a/src/include/common/copier_config/copier_config.h b/src/include/common/copier_config/copier_config.h index 961b0f691b..96b87059f9 100644 --- a/src/include/common/copier_config/copier_config.h +++ b/src/include/common/copier_config/copier_config.h @@ -1,9 +1,11 @@ #pragma once +#include #include +#include +#include #include "common/constants.h" -#include "common/types/value.h" namespace kuzu { namespace common { diff --git a/src/include/common/types/value/nested.h b/src/include/common/types/value/nested.h new file mode 100644 index 0000000000..8943d6a6ee --- /dev/null +++ b/src/include/common/types/value/nested.h @@ -0,0 +1,18 @@ +#include + +#include "common/api.h" + +namespace kuzu { +namespace common { + +class Value; + +class NestedVal { +public: + KUZU_API static uint32_t getChildrenSize(const Value* val); + + KUZU_API static Value* getChildVal(const Value* val, uint32_t idx); +}; + +} // namespace common +} // namespace kuzu diff --git a/src/include/common/types/value/node.h b/src/include/common/types/value/node.h new file mode 100644 index 0000000000..9ebe75387c --- /dev/null +++ b/src/include/common/types/value/node.h @@ -0,0 +1,72 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include "common/api.h" +#include "common/types/internal_id_t.h" + +namespace kuzu { +namespace common { + +class Value; + +/** + * @brief NodeVal represents a node in the graph and stores the nodeID, label and properties of that + * node. + */ +class NodeVal { +public: + /** + * @return all properties of the NodeVal. + * @note this function copies all the properties into a vector, which is not efficient. use + * `getPropertyName` and `getPropertyVal` instead if possible. + */ + KUZU_API static std::vector>> getProperties( + const Value* val); + /** + * @return number of properties of the RelVal. + */ + KUZU_API static uint64_t getNumProperties(const Value* val); + + /** + * @return the name of the property at the given index. + */ + KUZU_API static std::string getPropertyName(const Value* val, uint64_t index); + + /** + * @return the value of the property at the given index. + */ + KUZU_API static Value* getPropertyVal(const Value* val, uint64_t index); + /** + * @return the nodeID as a Value. + */ + KUZU_API static Value* getNodeIDVal(const Value* val); + /** + * @return the name of the node as a Value. + */ + KUZU_API static Value* getLabelVal(const Value* val); + /** + * @return the nodeID of the node as a nodeID struct. + */ + KUZU_API static nodeID_t getNodeID(const Value* val); + /** + * @return the name of the node in string format. + */ + KUZU_API static std::string getLabelName(const Value* val); + /** + * @return the current node values in string format. + */ + KUZU_API static std::string toString(const Value* val); + +private: + static void throwIfNotNode(const Value* val); + // 2 offsets for id and label. + static constexpr uint64_t OFFSET = 2; +}; + +} // namespace common +} // namespace kuzu diff --git a/src/include/common/types/value/recursive_rel.h b/src/include/common/types/value/recursive_rel.h new file mode 100644 index 0000000000..7acdceaa56 --- /dev/null +++ b/src/include/common/types/value/recursive_rel.h @@ -0,0 +1,29 @@ +#include "common/api.h" + +namespace kuzu { +namespace common { + +class Value; + +/** + * @brief RecursiveRelVal represents a path in the graph and stores the corresponding rels and nodes + * of that path. + */ +class RecursiveRelVal { +public: + /** + * @return the list of nodes in the recursive rel as a Value. + */ + KUZU_API static Value* getNodes(const Value* val); + + /** + * @return the list of rels in the recursive rel as a Value. + */ + KUZU_API static Value* getRels(const Value* val); + +private: + static void throwIfNotRecursiveRel(const Value* val); +}; + +} // namespace common +} // namespace kuzu diff --git a/src/include/common/types/value/rel.h b/src/include/common/types/value/rel.h new file mode 100644 index 0000000000..a2a817ac7c --- /dev/null +++ b/src/include/common/types/value/rel.h @@ -0,0 +1,72 @@ +#include +#include +#include +#include +#include + +#include "common/api.h" +#include "common/types/internal_id_t.h" + +namespace kuzu { +namespace common { + +class Value; + +/** + * @brief RelVal represents a rel in the graph and stores the relID, src/dst nodes and properties of + * that rel. + */ +class RelVal { +public: + /** + * @return all properties of the RelVal. + * @note this function copies all the properties into a vector, which is not efficient. use + * `getPropertyName` and `getPropertyVal` instead if possible. + */ + KUZU_API static std::vector>> getProperties( + const Value* val); + /** + * @return number of properties of the RelVal. + */ + KUZU_API static uint64_t getNumProperties(const Value* val); + /** + * @return the name of the property at the given index. + */ + KUZU_API static std::string getPropertyName(const Value* val, uint64_t index); + /** + * @return the value of the property at the given index. + */ + KUZU_API static Value* getPropertyVal(const Value* val, uint64_t index); + /** + * @return the src nodeID value of the RelVal in Value. + */ + KUZU_API static Value* getSrcNodeIDVal(const Value* val); + /** + * @return the dst nodeID value of the RelVal in Value. + */ + KUZU_API static Value* getDstNodeIDVal(const Value* val); + /** + * @return the src nodeID value of the RelVal as nodeID struct. + */ + KUZU_API static nodeID_t getSrcNodeID(const Value* val); + /** + * @return the dst nodeID value of the RelVal as nodeID struct. + */ + KUZU_API static nodeID_t getDstNodeID(const Value* val); + /** + * @return the name of the RelVal. + */ + KUZU_API static std::string getLabelName(const Value* val); + /** + * @return the value of the RelVal in string format. + */ + KUZU_API static std::string toString(const Value* val); + +private: + static void throwIfNotRel(const Value* val); + // 4 offset for id, label, src, dst. + static constexpr uint64_t OFFSET = 4; +}; + +} // namespace common +} // namespace kuzu diff --git a/src/include/common/types/value.h b/src/include/common/types/value/value.h similarity index 76% rename from src/include/common/types/value.h rename to src/include/common/types/value/value.h index 64bf78505d..99de927fba 100644 --- a/src/include/common/types/value.h +++ b/src/include/common/types/value/value.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include "common/api.h" @@ -10,7 +9,6 @@ #include "common/types/interval_t.h" #include "common/types/ku_list.h" #include "common/types/timestamp_t.h" -#include "common/utils.h" namespace kuzu { namespace common { @@ -224,143 +222,6 @@ class Value { uint32_t childrenSize; }; -class NestedVal { -public: - KUZU_API static uint32_t getChildrenSize(const Value* val); - - KUZU_API static Value* getChildVal(const Value* val, uint32_t idx); -}; - -/** - * @brief NodeVal represents a node in the graph and stores the nodeID, label and properties of that - * node. - */ -class NodeVal { -public: - /** - * @return all properties of the NodeVal. - * @note this function copies all the properties into a vector, which is not efficient. use - * `getPropertyName` and `getPropertyVal` instead if possible. - */ - KUZU_API static std::vector>> getProperties( - const Value* val); - /** - * @return number of properties of the RelVal. - */ - KUZU_API static uint64_t getNumProperties(const Value* val); - - /** - * @return the name of the property at the given index. - */ - KUZU_API static std::string getPropertyName(const Value* val, uint64_t index); - - /** - * @return the value of the property at the given index. - */ - KUZU_API static Value* getPropertyVal(const Value* val, uint64_t index); - /** - * @return the nodeID as a Value. - */ - KUZU_API static Value* getNodeIDVal(const Value* val); - /** - * @return the name of the node as a Value. - */ - KUZU_API static Value* getLabelVal(const Value* val); - /** - * @return the nodeID of the node as a nodeID struct. - */ - KUZU_API static nodeID_t getNodeID(const Value* val); - /** - * @return the name of the node in string format. - */ - KUZU_API static std::string getLabelName(const Value* val); - /** - * @return the current node values in string format. - */ - KUZU_API static std::string toString(const Value* val); - -private: - static void throwIfNotNode(const Value* val); - // 2 offsets for id and label. - static constexpr uint64_t OFFSET = 2; -}; - -/** - * @brief RelVal represents a rel in the graph and stores the relID, src/dst nodes and properties of - * that rel. - */ -class RelVal { -public: - /** - * @return all properties of the RelVal. - * @note this function copies all the properties into a vector, which is not efficient. use - * `getPropertyName` and `getPropertyVal` instead if possible. - */ - KUZU_API static std::vector>> getProperties( - const Value* val); - /** - * @return number of properties of the RelVal. - */ - KUZU_API static uint64_t getNumProperties(const Value* val); - /** - * @return the name of the property at the given index. - */ - KUZU_API static std::string getPropertyName(const Value* val, uint64_t index); - /** - * @return the value of the property at the given index. - */ - KUZU_API static Value* getPropertyVal(const Value* val, uint64_t index); - /** - * @return the src nodeID value of the RelVal in Value. - */ - KUZU_API static Value* getSrcNodeIDVal(const Value* val); - /** - * @return the dst nodeID value of the RelVal in Value. - */ - KUZU_API static Value* getDstNodeIDVal(const Value* val); - /** - * @return the src nodeID value of the RelVal as nodeID struct. - */ - KUZU_API static nodeID_t getSrcNodeID(const Value* val); - /** - * @return the dst nodeID value of the RelVal as nodeID struct. - */ - KUZU_API static nodeID_t getDstNodeID(const Value* val); - /** - * @return the name of the RelVal. - */ - KUZU_API static std::string getLabelName(const Value* val); - /** - * @return the value of the RelVal in string format. - */ - KUZU_API static std::string toString(const Value* val); - -private: - static void throwIfNotRel(const Value* val); - // 4 offset for id, label, src, dst. - static constexpr uint64_t OFFSET = 4; -}; - -/** - * @brief RecursiveRelVal represents a path in the graph and stores the corresponding rels and nodes - * of that path. - */ -class RecursiveRelVal { -public: - /** - * @return the list of nodes in the recursive rel as a Value. - */ - KUZU_API static Value* getNodes(const Value* val); - - /** - * @return the list of rels in the recursive rel as a Value. - */ - KUZU_API static Value* getRels(const Value* val); - -private: - static void throwIfNotRecursiveRel(const Value* val); -}; - /** * @return boolean value. */ diff --git a/src/include/common/vector/value_vector.h b/src/include/common/vector/value_vector.h index 31f5ee3d04..7ffd9533c9 100644 --- a/src/include/common/vector/value_vector.h +++ b/src/include/common/vector/value_vector.h @@ -5,12 +5,14 @@ #include "common/data_chunk/data_chunk_state.h" #include "common/null_mask.h" -#include "common/types/value.h" +#include "common/types/ku_string.h" #include "common/vector/auxiliary_buffer.h" namespace kuzu { namespace common { +class Value; + //! A Vector represents values of the same data type. //! The capacity of a ValueVector is either 1 (sequence) or DEFAULT_VECTOR_CAPACITY. class ValueVector { diff --git a/src/include/function/table_functions.h b/src/include/function/table_functions.h index 33bc4cbb5e..36db01b6ef 100644 --- a/src/include/function/table_functions.h +++ b/src/include/function/table_functions.h @@ -1,5 +1,6 @@ #pragma once +#include "common/types/value/value.h" #include "common/vector/value_vector.h" #include "function/function_definition.h" #include "main/client_context.h" diff --git a/src/include/main/settings.h b/src/include/main/settings.h index 4692423ee7..dd0576c8b7 100644 --- a/src/include/main/settings.h +++ b/src/include/main/settings.h @@ -1,6 +1,6 @@ #pragma once -#include "common/types/value.h" +#include "common/types/value/value.h" #include "main/client_context.h" namespace kuzu { diff --git a/src/include/parser/expression/parsed_literal_expression.h b/src/include/parser/expression/parsed_literal_expression.h index ebdfe326a6..0702d4e92b 100644 --- a/src/include/parser/expression/parsed_literal_expression.h +++ b/src/include/parser/expression/parsed_literal_expression.h @@ -1,7 +1,7 @@ #pragma once #include "common/ser_deser.h" -#include "common/types/value.h" +#include "common/types/value/value.h" #include "parsed_expression.h" namespace kuzu { diff --git a/src/include/processor/operator/call/standalone_call.h b/src/include/processor/operator/call/standalone_call.h index 623a7a8e7d..e9d06a3e81 100644 --- a/src/include/processor/operator/call/standalone_call.h +++ b/src/include/processor/operator/call/standalone_call.h @@ -1,5 +1,6 @@ #pragma once +#include "common/types/value/value.h" #include "main/db_config.h" #include "processor/operator/physical_operator.h" diff --git a/src/include/processor/result/factorized_table.h b/src/include/processor/result/factorized_table.h index 52f8519109..42cf0deefb 100644 --- a/src/include/processor/result/factorized_table.h +++ b/src/include/processor/result/factorized_table.h @@ -4,6 +4,7 @@ #include #include "common/in_mem_overflow_buffer.h" +#include "common/types/value/value.h" #include "common/vector/value_vector.h" #include "processor/data_pos.h" #include "processor/result/flat_tuple.h" diff --git a/src/include/processor/result/flat_tuple.h b/src/include/processor/result/flat_tuple.h index 90da155150..32c34d5797 100644 --- a/src/include/processor/result/flat_tuple.h +++ b/src/include/processor/result/flat_tuple.h @@ -1,9 +1,16 @@ #pragma once +#include +#include +#include +#include + #include "common/api.h" -#include "common/types/value.h" namespace kuzu { +namespace common { +class Value; +} namespace processor { /** diff --git a/src/include/storage/copier/column_chunk.h b/src/include/storage/copier/column_chunk.h index 8ac77af854..4e8b3aba26 100644 --- a/src/include/storage/copier/column_chunk.h +++ b/src/include/storage/copier/column_chunk.h @@ -1,6 +1,7 @@ #pragma once #include "common/copier_config/copier_config.h" +#include "common/type_utils.h" #include "common/types/types.h" #include "common/vector/value_vector.h" #include "storage/buffer_manager/bm_file_handle.h" diff --git a/src/include/storage/storage_structure/column.h b/src/include/storage/storage_structure/column.h index e420af2e4e..52f92bec22 100644 --- a/src/include/storage/storage_structure/column.h +++ b/src/include/storage/storage_structure/column.h @@ -2,7 +2,7 @@ #include "catalog/catalog.h" #include "common/exception/storage.h" -#include "common/types/value.h" +#include "common/types/value/value.h" #include "storage/storage_structure/disk_overflow_file.h" #include "storage/storage_structure/storage_structure.h" diff --git a/src/include/storage/storage_structure/disk_overflow_file.h b/src/include/storage/storage_structure/disk_overflow_file.h index 94cf8b8766..1e1f35427c 100644 --- a/src/include/storage/storage_structure/disk_overflow_file.h +++ b/src/include/storage/storage_structure/disk_overflow_file.h @@ -2,6 +2,7 @@ #include +#include "common/types/ku_list.h" #include "common/vector/value_vector.h" #include "storage/buffer_manager/buffer_manager.h" #include "storage/storage_structure/storage_structure.h" diff --git a/src/include/storage/storage_structure/in_mem_file.h b/src/include/storage/storage_structure/in_mem_file.h index badf174fb4..140a2fb084 100644 --- a/src/include/storage/storage_structure/in_mem_file.h +++ b/src/include/storage/storage_structure/in_mem_file.h @@ -4,7 +4,7 @@ #include "arrow/array.h" #include "common/constants.h" -#include "common/types/value.h" +#include "common/types/value/value.h" #include "storage/storage_structure/in_mem_page.h" #include "storage/storage_utils.h" diff --git a/src/include/storage/storage_structure/lists/lists.h b/src/include/storage/storage_structure/lists/lists.h index 0a04668f01..059eb37906 100644 --- a/src/include/storage/storage_structure/lists/lists.h +++ b/src/include/storage/storage_structure/lists/lists.h @@ -1,7 +1,6 @@ #pragma once #include "common/exception/storage.h" -#include "common/types/value.h" #include "lists_update_store.h" #include "storage/storage_structure/disk_overflow_file.h" #include "storage/storage_structure/lists/list_handle.h" diff --git a/src/main/query_result.cpp b/src/main/query_result.cpp index 897dbaeef8..4d96ef3607 100644 --- a/src/main/query_result.cpp +++ b/src/main/query_result.cpp @@ -5,6 +5,8 @@ #include "binder/expression/node_rel_expression.h" #include "binder/expression/property_expression.h" #include "common/arrow/arrow_converter.h" +#include "common/types/value/node.h" +#include "common/types/value/rel.h" #include "json.hpp" #include "processor/result/factorized_table.h" #include "processor/result/flat_tuple.h" diff --git a/src/planner/operator/logical_dummy_scan.cpp b/src/planner/operator/logical_dummy_scan.cpp index fd396b12f6..9e87d9875d 100644 --- a/src/planner/operator/logical_dummy_scan.cpp +++ b/src/planner/operator/logical_dummy_scan.cpp @@ -1,5 +1,7 @@ #include "planner/logical_plan/scan/logical_dummy_scan.h" +#include "common/constants.h" + using namespace kuzu::common; namespace kuzu { diff --git a/src/processor/operator/persistent/copy_to.cpp b/src/processor/operator/persistent/copy_to.cpp index fbb1027c35..adc3f28abf 100644 --- a/src/processor/operator/persistent/copy_to.cpp +++ b/src/processor/operator/persistent/copy_to.cpp @@ -1,8 +1,5 @@ #include "processor/operator/persistent/copy_to.h" -#include "common/string_utils.h" -#include "common/types/value.h" - using namespace kuzu::common; namespace kuzu { diff --git a/src/processor/operator/persistent/csv_file_writer.cpp b/src/processor/operator/persistent/csv_file_writer.cpp index 7d5ed5d580..ddfeb3f1b2 100644 --- a/src/processor/operator/persistent/csv_file_writer.cpp +++ b/src/processor/operator/persistent/csv_file_writer.cpp @@ -4,6 +4,13 @@ #include "common/constants.h" #include "common/string_utils.h" +#include "common/type_utils.h" +#include "common/types/date_t.h" +#include "common/types/internal_id_t.h" +#include "common/types/interval_t.h" +#include "common/types/ku_string.h" +#include "common/types/timestamp_t.h" +#include "common/types/types.h" using namespace kuzu::common; diff --git a/src/processor/result/flat_tuple.cpp b/src/processor/result/flat_tuple.cpp index 5e69829c8a..d70df420e0 100644 --- a/src/processor/result/flat_tuple.cpp +++ b/src/processor/result/flat_tuple.cpp @@ -2,6 +2,7 @@ #include "common/exception/runtime.h" #include "common/string_utils.h" +#include "common/types/value/value.h" #include "utf8proc.h" #include "utf8proc_wrapper.h" diff --git a/src/storage/copier/column_chunk.cpp b/src/storage/copier/column_chunk.cpp index c98010a585..9abd3b9414 100644 --- a/src/storage/copier/column_chunk.cpp +++ b/src/storage/copier/column_chunk.cpp @@ -1,6 +1,7 @@ #include "storage/copier/column_chunk.h" #include "arrow/array.h" +#include "common/types/value/nested.h" #include "storage/copier/string_column_chunk.h" #include "storage/copier/struct_column_chunk.h" #include "storage/copier/table_copy_utils.h" diff --git a/src/storage/copier/struct_column_chunk.cpp b/src/storage/copier/struct_column_chunk.cpp index d65bdf5176..688c9ca999 100644 --- a/src/storage/copier/struct_column_chunk.cpp +++ b/src/storage/copier/struct_column_chunk.cpp @@ -4,6 +4,7 @@ #include "common/exception/not_implemented.h" #include "common/exception/parser.h" #include "common/string_utils.h" +#include "common/types/value/nested.h" #include "storage/copier/string_column_chunk.h" #include "storage/copier/table_copy_utils.h" #include "storage/copier/var_list_column_chunk.h" diff --git a/src/storage/copier/var_list_column_chunk.cpp b/src/storage/copier/var_list_column_chunk.cpp index f1516ea33c..1d1741bf57 100644 --- a/src/storage/copier/var_list_column_chunk.cpp +++ b/src/storage/copier/var_list_column_chunk.cpp @@ -1,6 +1,7 @@ #include "storage/copier/var_list_column_chunk.h" #include "arrow/array.h" +#include "common/types/value/nested.h" #include "storage/copier/table_copy_utils.h" namespace kuzu { diff --git a/src/storage/storage_structure/disk_overflow_file.cpp b/src/storage/storage_structure/disk_overflow_file.cpp index 95f775f72f..251ba25099 100644 --- a/src/storage/storage_structure/disk_overflow_file.cpp +++ b/src/storage/storage_structure/disk_overflow_file.cpp @@ -3,6 +3,7 @@ #include "common/null_buffer.h" #include "common/string_utils.h" #include "common/type_utils.h" +#include "common/types/value/value.h" using lock_t = std::unique_lock; diff --git a/src/storage/storage_structure/in_mem_file.cpp b/src/storage/storage_structure/in_mem_file.cpp index 28add25977..93fcd8f86f 100644 --- a/src/storage/storage_structure/in_mem_file.cpp +++ b/src/storage/storage_structure/in_mem_file.cpp @@ -5,6 +5,7 @@ #include "common/exception/copy.h" #include "common/exception/storage.h" #include "common/type_utils.h" +#include "common/types/value/nested.h" using namespace kuzu::common; diff --git a/tools/java_api/src/jni/kuzu_java.cpp b/tools/java_api/src/jni/kuzu_java.cpp index 49821cfd50..156d00e78b 100644 --- a/tools/java_api/src/jni/kuzu_java.cpp +++ b/tools/java_api/src/jni/kuzu_java.cpp @@ -6,7 +6,10 @@ #include "com_kuzudb_KuzuNative.h" #include "common/exception/exception.h" #include "common/types/types.h" -#include "common/types/value.h" +#include "common/types/value/value.h" +#include "common/types/value/nested.h" +#include "common/types/value/node.h" +#include "common/types/value/rel.h" #include "json.hpp" #include "main/kuzu.h" #include "main/query_summary.h" diff --git a/tools/nodejs_api/src_cpp/node_util.cpp b/tools/nodejs_api/src_cpp/node_util.cpp index fbf7c026ec..6a0617f650 100644 --- a/tools/nodejs_api/src_cpp/node_util.cpp +++ b/tools/nodejs_api/src_cpp/node_util.cpp @@ -1,6 +1,11 @@ #include "include/node_util.h" #include "common/exception/exception.h" +#include "common/types/value/value.h" +#include "common/types/value/nested.h" +#include "common/types/value/node.h" +#include "common/types/value/recursive_rel.h" +#include "common/types/value/rel.h" Napi::Value Util::ConvertToNapiObject(const Value& value, Napi::Env env) { if (value.isNull()) { diff --git a/tools/python_api/src_cpp/py_query_result.cpp b/tools/python_api/src_cpp/py_query_result.cpp index 8f5f16102e..2dedafd4b3 100644 --- a/tools/python_api/src_cpp/py_query_result.cpp +++ b/tools/python_api/src_cpp/py_query_result.cpp @@ -3,6 +3,9 @@ #include #include "common/arrow/arrow_converter.h" +#include "common/types/value/nested.h" +#include "common/types/value/node.h" +#include "common/types/value/rel.h" #include "datetime.h" // python lib #include "include/py_query_result_converter.h" #include "json.hpp" diff --git a/tools/python_api/src_cpp/py_query_result_converter.cpp b/tools/python_api/src_cpp/py_query_result_converter.cpp index a3b9770d6b..db44440386 100644 --- a/tools/python_api/src_cpp/py_query_result_converter.cpp +++ b/tools/python_api/src_cpp/py_query_result_converter.cpp @@ -1,6 +1,6 @@ #include "include/py_query_result_converter.h" -#include "common/types/value.h" +#include "common/types/value/value.h" #include "include/py_query_result.h" using namespace kuzu::common; diff --git a/tools/rust_api/include/kuzu_rs.h b/tools/rust_api/include/kuzu_rs.h index dce3485df0..6b1a778047 100644 --- a/tools/rust_api/include/kuzu_rs.h +++ b/tools/rust_api/include/kuzu_rs.h @@ -3,6 +3,11 @@ #include "rust/cxx.h" #ifdef KUZU_BUNDLED +#include "common/types/value/nested.h" +#include "common/types/value/node.h" +#include "common/types/value/recursive_rel.h" +#include "common/types/value/rel.h" +#include "common/types/value/value.h" #include "main/kuzu.h" #else #include