From 28c99e75f06553d493cbf13f891f34cf91bb63a7 Mon Sep 17 00:00:00 2001 From: Keenan Gugeler Date: Mon, 13 Nov 2023 10:54:04 -0500 Subject: [PATCH] cleanup: replace NotImplementedException KU_UNREACHABLE should be used in almost all cases where we have NotImplementedException. --- src/binder/bind/bind_graph_pattern.cpp | 3 +-- src/catalog/catalog_content.cpp | 5 +---- src/catalog/table_schema.cpp | 5 +---- src/common/rel_direction.cpp | 4 ++-- src/common/table_type.cpp | 6 ++--- src/common/type_utils.cpp | 5 +---- src/common/types/types.cpp | 4 +--- src/common/types/value/value.cpp | 17 ++++---------- src/expression_evaluator/case_evaluator.cpp | 9 ++------ src/expression_evaluator/path_evaluator.cpp | 2 +- src/function/aggregate_function.cpp | 5 +---- src/function/built_in_functions.cpp | 4 +--- src/function/cast_string_to_functions.cpp | 6 ++--- src/function/comparison_functions.cpp | 3 +-- .../table_functions/call_functions.cpp | 5 +---- src/function/vector_list_functions.cpp | 13 +++++------ .../expression_evaluator/node_rel_evaluator.h | 5 +---- .../expression_evaluator/path_evaluator.h | 5 +---- .../arithmetic/vector_arithmetic_functions.h | 9 ++------ src/include/function/date/date_functions.h | 22 +++++-------------- .../function/list/vector_list_functions.h | 19 ++++++---------- .../string/functions/concat_function.h | 3 +-- src/include/function/udf_function.h | 13 +++++------ .../persistent/reader/parquet/column_reader.h | 13 +++-------- .../writer/parquet/basic_column_writer.h | 8 +++---- .../persistent/writer/parquet/column_writer.h | 7 ++---- .../storage/store/string_column_chunk.h | 3 +-- .../transform/transform_reading_clause.cpp | 6 ++--- .../transform/transform_transaction.cpp | 6 ++--- src/parser/transformer.cpp | 5 ++--- .../join_order/cardinality_estimator.cpp | 3 +-- .../operator/extend/base_logical_extend.cpp | 4 +--- src/planner/operator/logical_explain.cpp | 4 +--- src/planner/operator/logical_hash_join.cpp | 7 +++--- src/planner/operator/logical_operator.cpp | 4 +--- src/planner/plan/append_extend.cpp | 5 ++--- src/planner/plan/plan_copy.cpp | 5 +---- src/planner/plan/plan_join_order.cpp | 7 +++--- src/planner/plan/plan_read.cpp | 7 ++---- src/planner/plan/plan_update.cpp | 9 ++------ src/processor/map/expression_mapper.cpp | 1 + src/processor/map/map_copy_to.cpp | 8 ++----- src/processor/map/map_ddl.cpp | 13 +++-------- src/processor/map/map_extend.cpp | 3 +-- src/processor/map/map_semi_masker.cpp | 5 ++--- src/processor/map/plan_mapper.cpp | 3 +-- src/processor/operator/index_lookup.cpp | 5 +---- .../order_by/order_by_key_encoder.cpp | 5 +---- src/processor/operator/order_by/top_k.cpp | 3 +-- .../operator/persistent/csv_file_writer.cpp | 3 +-- .../reader/parquet/column_reader.cpp | 16 ++++++-------- .../persistent/reader/rdf/rdf_reader.cpp | 5 +---- .../writer/parquet/column_writer.cpp | 7 ++---- .../writer/parquet/parquet_rle_bp_encoder.cpp | 3 +-- .../writer/parquet/parquet_writer.cpp | 3 +-- .../recursive_extend/recursive_join.cpp | 9 ++++---- src/processor/operator/transaction.cpp | 5 ++--- src/storage/buffer_manager/buffer_manager.cpp | 5 +---- src/storage/index/hash_index_builder.cpp | 4 +--- src/storage/stats/table_statistics.cpp | 5 +---- src/storage/store/column.cpp | 5 +---- src/storage/store/column_chunk.cpp | 4 +--- src/storage/store/string_column_chunk.cpp | 3 +-- src/transaction/transaction_context.cpp | 6 ++--- test/include/graph_test/api_graph_test.h | 2 +- test/include/graph_test/graph_test.h | 2 +- test/runner/e2e_test.cpp | 1 + test/test_files/tinysnb/function/list.test | 2 +- tools/python_api/src_cpp/py_query_result.cpp | 6 ++--- .../src_cpp/py_query_result_converter.cpp | 4 ++-- 70 files changed, 135 insertions(+), 286 deletions(-) diff --git a/src/binder/bind/bind_graph_pattern.cpp b/src/binder/bind/bind_graph_pattern.cpp index 12df694503..89cdd4a2e3 100644 --- a/src/binder/bind/bind_graph_pattern.cpp +++ b/src/binder/bind/bind_graph_pattern.cpp @@ -8,7 +8,6 @@ #include "catalog/rel_table_group_schema.h" #include "catalog/rel_table_schema.h" #include "common/exception/binder.h" -#include "common/exception/not_implemented.h" #include "common/keyword/rdf_keyword.h" #include "common/string_format.h" #include "function/cast/functions/cast_string_to_functions.h" @@ -116,7 +115,7 @@ std::shared_ptr Binder::createPath( extraFieldFromStructType( recursiveInfo->rel->getDataType(), relFieldNameSet, relFieldNames, relFieldTypes); } else { - throw NotImplementedException("Binder::createPath"); + KU_UNREACHABLE; } } auto nodeExtraInfo = std::make_unique(nodeFieldNames, nodeFieldTypes); diff --git a/src/catalog/catalog_content.cpp b/src/catalog/catalog_content.cpp index 98c69cfd1d..0de34fe526 100644 --- a/src/catalog/catalog_content.cpp +++ b/src/catalog/catalog_content.cpp @@ -5,7 +5,6 @@ #include "catalog/rel_table_group_schema.h" #include "catalog/rel_table_schema.h" #include "common/exception/catalog.h" -#include "common/exception/not_implemented.h" #include "common/exception/runtime.h" #include "common/serializer/buffered_file.h" #include "common/serializer/deserializer.h" @@ -218,9 +217,7 @@ ExpressionType CatalogContent::getFunctionType(const std::string& name) const { case function::FunctionType::AGGREGATE: return ExpressionType::AGGREGATE_FUNCTION; default: - // LCOV_EXCL_START - throw NotImplementedException("CatalogContent::getFunctionType"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } } diff --git a/src/catalog/table_schema.cpp b/src/catalog/table_schema.cpp index 68304b6283..578d74dbce 100644 --- a/src/catalog/table_schema.cpp +++ b/src/catalog/table_schema.cpp @@ -6,7 +6,6 @@ #include "catalog/rel_table_schema.h" #include "common/constants.h" #include "common/exception/internal.h" -#include "common/exception/not_implemented.h" #include "common/exception/runtime.h" #include "common/serializer/deserializer.h" #include "common/serializer/serializer.h" @@ -115,9 +114,7 @@ std::unique_ptr TableSchema::deserialize(Deserializer& deserializer result = RdfGraphSchema::deserialize(deserializer); } break; default: { - // LCOV_EXCL_START - throw NotImplementedException{"TableSchema::deserialize"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } result->tableName = tableName; diff --git a/src/common/rel_direction.cpp b/src/common/rel_direction.cpp index cc7cc896b9..1988382350 100644 --- a/src/common/rel_direction.cpp +++ b/src/common/rel_direction.cpp @@ -1,6 +1,6 @@ #include "common/enums/rel_direction.h" -#include "common/exception/not_implemented.h" +#include "common/assert.h" namespace kuzu { namespace common { @@ -14,7 +14,7 @@ std::string RelDataDirectionUtils::relDataDirectionToString(RelDataDirection dir return "backward"; } default: - throw NotImplementedException("RelDataDirectionUtils::relDataDirectionToString"); + KU_UNREACHABLE; } } diff --git a/src/common/table_type.cpp b/src/common/table_type.cpp index efa574f4a6..497795c80b 100644 --- a/src/common/table_type.cpp +++ b/src/common/table_type.cpp @@ -1,6 +1,6 @@ #include "common/enums/table_type.h" -#include "common/exception/not_implemented.h" +#include "common/assert.h" namespace kuzu { namespace common { @@ -22,8 +22,8 @@ std::string TableTypeUtils::toString(TableType tableType) { case TableType::REL_GROUP: { return "REL_GROUP"; } - default: // LCOV_EXCL_START - throw NotImplementedException("TableTypeUtils::toString"); // LCOV_EXCL_STOP + default: + KU_UNREACHABLE; } } diff --git a/src/common/type_utils.cpp b/src/common/type_utils.cpp index daaa625e5b..1bda1160bd 100644 --- a/src/common/type_utils.cpp +++ b/src/common/type_utils.cpp @@ -1,6 +1,5 @@ #include "common/type_utils.h" -#include "common/exception/not_implemented.h" #include "common/types/blob.h" #include "common/vector/value_vector.h" @@ -49,10 +48,8 @@ std::string TypeUtils::castValueToString( return TypeUtils::toString(*reinterpret_cast(value), valueVector); case LogicalTypeID::STRUCT: return TypeUtils::toString(*reinterpret_cast(value), valueVector); - // LCOV_EXCL_START default: - throw NotImplementedException("TypeUtils::castValueToString."); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/common/types/types.cpp b/src/common/types/types.cpp index 9f38d86af3..9f39aa9564 100644 --- a/src/common/types/types.cpp +++ b/src/common/types/types.cpp @@ -380,10 +380,8 @@ std::string LogicalType::toString() const { case LogicalTypeID::SERIAL: case LogicalTypeID::RDF_VARIANT: return LogicalTypeUtils::toString(typeID); - // LCOV_EXCL_START default: - throw NotImplementedException("LogicalType::toString"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/common/types/value/value.cpp b/src/common/types/value/value.cpp index 1660f3d200..19792fb04f 100644 --- a/src/common/types/value/value.cpp +++ b/src/common/types/value/value.cpp @@ -1,6 +1,5 @@ #include "common/types/value/value.h" -#include "common/exception/not_implemented.h" #include "common/null_buffer.h" #include "common/serializer/deserializer.h" #include "common/serializer/serializer.h" @@ -112,10 +111,8 @@ Value Value::createDefaultValue(const LogicalType& dataType) { } return Value(dataType, std::move(children)); } - // LCOV_EXCL_START default: - throw NotImplementedException("Value::createDefaultValue."); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -296,10 +293,8 @@ void Value::copyValueFrom(const uint8_t* value) { case LogicalTypeID::RDF_VARIANT: { copyFromStruct(value); } break; - // LCOV_EXCL_START default: - throw NotImplementedException("Value::copyValueFrom."); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -576,9 +571,7 @@ void Value::serialize(Serializer& serializer) const { } } break; default: { - // LCOV_EXCL_START - throw NotImplementedException("Value::serialize"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } serializer.serializeValue(childrenSize); @@ -641,9 +634,7 @@ std::unique_ptr Value::deserialize(Deserializer& deserializer) { deserializer.deserializeVectorOfPtrs(val->children); } break; default: { - // LCOV_EXCL_START - throw NotImplementedException("Value::deserializeValue"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } deserializer.deserializeValue(val->childrenSize); diff --git a/src/expression_evaluator/case_evaluator.cpp b/src/expression_evaluator/case_evaluator.cpp index b860fedda4..cabb9e5049 100644 --- a/src/expression_evaluator/case_evaluator.cpp +++ b/src/expression_evaluator/case_evaluator.cpp @@ -2,7 +2,6 @@ #include -#include "common/exception/not_implemented.h" #include "common/types/date_t.h" #include "common/types/interval_t.h" #include "common/types/ku_string.h" @@ -136,10 +135,8 @@ void CaseExpressionEvaluator::fillAllSwitch(const ValueVector& thenVector) { case LogicalTypeID::VAR_LIST: { fillAll(thenVector); } break; - // LCOV_EXCL_START default: - throw NotImplementedException("CaseExpressionEvaluator::fillAllSwitch"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -170,10 +167,8 @@ void CaseExpressionEvaluator::fillSelectedSwitch( case LogicalTypeID::VAR_LIST: { fillSelected(selVector, thenVector); } break; - // LCOV_EXCL_START default: - throw NotImplementedException("CaseExpressionEvaluator::fillSelectedSwitch"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/expression_evaluator/path_evaluator.cpp b/src/expression_evaluator/path_evaluator.cpp index dd14dca194..5115b9938e 100644 --- a/src/expression_evaluator/path_evaluator.cpp +++ b/src/expression_evaluator/path_evaluator.cpp @@ -72,7 +72,7 @@ void PathExpressionEvaluator::init( recursiveRel->dataType, *pathExpression->getRelType(), vectors->relsDataInput); } break; default: - throw NotImplementedException("PathExpressionEvaluator::init"); + KU_UNREACHABLE; } inputVectorsPerChild.push_back(std::move(vectors)); } diff --git a/src/function/aggregate_function.cpp b/src/function/aggregate_function.cpp index 562952a52a..5d400ff848 100644 --- a/src/function/aggregate_function.cpp +++ b/src/function/aggregate_function.cpp @@ -1,6 +1,5 @@ #include "function/aggregate_function.h" -#include "common/exception/not_implemented.h" #include "common/types/interval_t.h" #include "function/aggregate/avg.h" #include "function/aggregate/min_max.h" @@ -199,10 +198,8 @@ std::unique_ptr AggregateFunctionUtil::getMinMaxFunction(cons MinMaxFunction::updatePos, MinMaxFunction::combine, MinMaxFunction::finalize, isDistinct); - // LCOV_EXCL_START default: - throw NotImplementedException("AggregateFunctionUtil::getMinMaxFunction."); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/function/built_in_functions.cpp b/src/function/built_in_functions.cpp index 88b0d61cf5..0a1e6619a4 100644 --- a/src/function/built_in_functions.cpp +++ b/src/function/built_in_functions.cpp @@ -415,10 +415,8 @@ uint32_t BuiltInFunctions::getFunctionCost( } case FunctionType::TABLE: return matchParameters(inputTypes, function->parameterTypeIDs, isOverload); - // LCOV_EXCL_START default: - throw NotImplementedException{"BuiltInFunctions::getFunctionCost"}; - // LCOC_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/function/cast_string_to_functions.cpp b/src/function/cast_string_to_functions.cpp index 15d46eeb99..8e1b25aa0f 100644 --- a/src/function/cast_string_to_functions.cpp +++ b/src/function/cast_string_to_functions.cpp @@ -875,9 +875,9 @@ void CastString::copyStringToVector(ValueVector* vector, uint64_t rowToAdd, std: CastStringHelper::cast( strVal.data(), strVal.length(), val, vector, rowToAdd, csvReaderConfig); } break; - default: { // LCOV_EXCL_START - throw NotImplementedException("CastString::operation"); - } // LCOV_EXCL_STOP + default: { + KU_UNREACHABLE; + } } } diff --git a/src/function/comparison_functions.cpp b/src/function/comparison_functions.cpp index b3d6d60a31..a3d4bd34b3 100644 --- a/src/function/comparison_functions.cpp +++ b/src/function/comparison_functions.cpp @@ -2,7 +2,6 @@ #include -#include "common/exception/not_implemented.h" #include "common/types/int128_t.h" #include "common/types/interval_t.h" @@ -99,7 +98,7 @@ static void executeNestedOperation(uint8_t& result, ValueVector* leftVector, rightVector->getValue(rightPos), result, leftVector, rightVector); } break; default: { - throw NotImplementedException("comparison operation"); + KU_UNREACHABLE; } } } diff --git a/src/function/table_functions/call_functions.cpp b/src/function/table_functions/call_functions.cpp index 1dd261fb19..b763954037 100644 --- a/src/function/table_functions/call_functions.cpp +++ b/src/function/table_functions/call_functions.cpp @@ -4,7 +4,6 @@ #include "catalog/rel_table_group_schema.h" #include "catalog/rel_table_schema.h" #include "common/exception/binder.h" -#include "common/exception/not_implemented.h" namespace kuzu { namespace function { @@ -241,9 +240,7 @@ void ShowConnectionFunction::tableFunc(TableFunctionInput& input, DataChunk& out } } break; default: - // LCOV_EXCL_START - throw NotImplementedException{"ShowConnectionFunction::tableFunc"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } outputChunk.state->selVector->selectedSize = vectorPos; } diff --git a/src/function/vector_list_functions.cpp b/src/function/vector_list_functions.cpp index 5d158d5d22..079453d40a 100644 --- a/src/function/vector_list_functions.cpp +++ b/src/function/vector_list_functions.cpp @@ -2,7 +2,6 @@ #include "binder/expression_binder.h" #include "common/exception/binder.h" -#include "common/exception/not_implemented.h" #include "common/exception/runtime.h" #include "function/list/functions/list_any_value_function.h" #include "function/list/functions/list_append_function.h" @@ -219,7 +218,7 @@ std::unique_ptr ListExtractFunction::bindFunc( BinaryExecListExtractFunction; } break; default: { - throw NotImplementedException("ListExtractFunction::bindFunc"); + KU_UNREACHABLE; } } return std::make_unique(*resultType); @@ -429,7 +428,7 @@ std::unique_ptr ListSortFunction::bindFunc( getExecFunction(arguments, scalarFunction->execFunc); } break; default: { - throw NotImplementedException("ListSortFunction::bindFunc"); + KU_UNREACHABLE; } } return std::make_unique(arguments[0]->getDataType()); @@ -519,7 +518,7 @@ std::unique_ptr ListReverseSortFunction::bindFunc( getExecFunction(arguments, scalarFunction->execFunc); } break; default: { - throw NotImplementedException("ListReverseSortFunction::bindFunc"); + KU_UNREACHABLE; } } return std::make_unique(arguments[0]->getDataType()); @@ -639,7 +638,7 @@ std::unique_ptr ListDistinctFunction::bindFunc( list_entry_t, ListDistinct>; } break; default: { - throw NotImplementedException("ListDistinctFunction::bindFunc"); + KU_UNREACHABLE; } } return std::make_unique(arguments[0]->getDataType()); @@ -727,7 +726,7 @@ std::unique_ptr ListUniqueFunction::bindFunc( int64_t, ListUnique>; } break; default: { - throw NotImplementedException("ListUniqueFunction::bindFunc"); + KU_UNREACHABLE; } } return std::make_unique(LogicalType(LogicalTypeID::INT64)); @@ -820,7 +819,7 @@ std::unique_ptr ListAnyValueFunction::bindFunc( ScalarFunction::UnaryExecListStructFunction; } break; default: { - throw NotImplementedException("ListAnyValueFunction::bindFunc"); + KU_UNREACHABLE; } } return std::make_unique(*resultType); diff --git a/src/include/expression_evaluator/node_rel_evaluator.h b/src/include/expression_evaluator/node_rel_evaluator.h index 57640c74cd..2d2fb8f36d 100644 --- a/src/include/expression_evaluator/node_rel_evaluator.h +++ b/src/include/expression_evaluator/node_rel_evaluator.h @@ -1,7 +1,6 @@ #pragma once #include "binder/expression/expression.h" -#include "common/exception/not_implemented.h" #include "expression_evaluator.h" namespace kuzu { @@ -15,9 +14,7 @@ class NodeRelExpressionEvaluator final : public ExpressionEvaluator { void evaluate() override; - bool select(common::SelectionVector& /*selVector*/) override { - throw common::NotImplementedException("NodeExpressionEvaluator::select"); - } + bool select(common::SelectionVector& /*selVector*/) override { KU_UNREACHABLE; } inline std::unique_ptr clone() override { std::vector> clonedChildren; diff --git a/src/include/expression_evaluator/path_evaluator.h b/src/include/expression_evaluator/path_evaluator.h index d879dd76da..fe4e38d191 100644 --- a/src/include/expression_evaluator/path_evaluator.h +++ b/src/include/expression_evaluator/path_evaluator.h @@ -1,7 +1,6 @@ #pragma once #include "binder/expression/expression.h" -#include "common/exception/not_implemented.h" #include "expression_evaluator.h" namespace kuzu { @@ -17,9 +16,7 @@ class PathExpressionEvaluator final : public ExpressionEvaluator { void evaluate(); - bool select(common::SelectionVector& /*selVector*/) { - throw common::NotImplementedException("PathExpressionEvaluator::select"); - } + bool select(common::SelectionVector& /*selVector*/) { KU_UNREACHABLE; } inline std::unique_ptr clone() { std::vector> clonedChildren; diff --git a/src/include/function/arithmetic/vector_arithmetic_functions.h b/src/include/function/arithmetic/vector_arithmetic_functions.h index 68d73865fc..48b86edac1 100644 --- a/src/include/function/arithmetic/vector_arithmetic_functions.h +++ b/src/include/function/arithmetic/vector_arithmetic_functions.h @@ -2,7 +2,6 @@ #include -#include "common/exception/not_implemented.h" #include "common/types/int128_t.h" #include "function/scalar_function.h" @@ -95,10 +94,8 @@ struct ArithmeticFunction { func = ScalarFunction::UnaryExecFunction; return; } - // LCOV_EXCL_START default: - throw common::NotImplementedException{"ArithmeticFunction::getUnaryExecFunc"}; - // LCOC_EXCL_STOP + KU_UNREACHABLE; } } @@ -151,10 +148,8 @@ struct ArithmeticFunction { func = ScalarFunction::BinaryExecFunction; return; } - // LCOV_EXCL_START default: - throw common::NotImplementedException{"ArithmeticFunction::getBinaryExecFunc"}; - // LCOC_EXCL_STOP + KU_UNREACHABLE; } } }; diff --git a/src/include/function/date/date_functions.h b/src/include/function/date/date_functions.h index 043d31dd08..1b5ba3419b 100644 --- a/src/include/function/date/date_functions.h +++ b/src/include/function/date/date_functions.h @@ -1,6 +1,6 @@ #pragma once -#include "common/exception/not_implemented.h" +#include "common/assert.h" #include "common/types/date_t.h" #include "common/types/ku_string.h" #include "common/types/timestamp_t.h" @@ -11,9 +11,7 @@ namespace function { struct DayName { template static inline void operation(T& /*input*/, common::ku_string_t& /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("Invalid DayName() call on non-datetime object"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } }; @@ -35,9 +33,7 @@ inline void DayName::operation(common::timestamp_t& input, common::ku_string_t& struct MonthName { template static inline void operation(T& /*input*/, common::ku_string_t& /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("Invalid MonthName() call on non-datetime object"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } }; @@ -60,9 +56,7 @@ struct LastDay { template static inline void operation(T& /*input*/, common::date_t& /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("Invalid LastDay() call on non-datetime object"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } }; @@ -83,9 +77,7 @@ struct DatePart { template static inline void operation( LEFT_TYPE& /*partSpecifier*/, RIGHT_TYPE& /*input*/, int64_t& /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("Invalid DatePart() call on non-datetime object"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } }; @@ -117,9 +109,7 @@ struct DateTrunc { template static inline void operation( LEFT_TYPE& /*partSpecifier*/, RIGHT_TYPE& /*input*/, RIGHT_TYPE& /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("Invalid DatePart() call on non-datetime object"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } }; diff --git a/src/include/function/list/vector_list_functions.h b/src/include/function/list/vector_list_functions.h index 7307ca6977..ad465ad0fc 100644 --- a/src/include/function/list/vector_list_functions.h +++ b/src/include/function/list/vector_list_functions.h @@ -2,7 +2,7 @@ #include -#include "common/exception/not_implemented.h" +#include "common/exception/binder.h" #include "common/types/int128_t.h" #include "common/types/interval_t.h" #include "function/scalar_function.h" @@ -83,10 +83,8 @@ struct ListFunction { execFunc = ScalarFunction::BinaryExecListStructFunction; } break; - // LCOV_EXCL_START default: { - throw common::NotImplementedException{"ListFunction::getBinaryListOperationDefinition"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } return execFunc; @@ -112,10 +110,8 @@ struct ListFunction { execFunc = ScalarFunction::BinaryExecListStructFunction; } break; - // LCOV_EXCL_START default: { - throw common::NotImplementedException{"ListFunction::getBinaryListOperationDefinition"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } return execFunc; @@ -141,11 +137,8 @@ struct ListFunction { execFunc = ScalarFunction::TernaryExecListStructFunction; } break; - // LCOV_EXCL_START default: { - throw common::NotImplementedException{ - "ListFunction::getTernaryListOperationDefinition"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } return execFunc; @@ -214,7 +207,9 @@ struct ListFunction { OPERATION>; } break; default: { - throw common::NotImplementedException(function->name + "::bindFunc"); + throw common::BinderException( + common::stringFormat("Unsupported inner data type for {}: {}", function->name, + common::LogicalTypeUtils::toString(resultType->getLogicalTypeID()))); } } return std::make_unique(*resultType); diff --git a/src/include/function/string/functions/concat_function.h b/src/include/function/string/functions/concat_function.h index 726a3edfa3..337f83fe9d 100644 --- a/src/include/function/string/functions/concat_function.h +++ b/src/include/function/string/functions/concat_function.h @@ -1,7 +1,6 @@ #pragma once #include "common/api.h" -#include "common/exception/not_implemented.h" #include "common/types/ku_string.h" #include "common/vector/value_vector.h" @@ -12,7 +11,7 @@ struct Concat { template static inline void operation( A& /*left*/, B& /*right*/, R& /*result*/, common::ValueVector& /*valueVector*/) { - throw common::NotImplementedException("Concat called on non-strings"); + KU_UNREACHABLE; } KUZU_API static void concat(const char* left, uint32_t leftLen, const char* right, diff --git a/src/include/function/udf_function.h b/src/include/function/udf_function.h index 30b89225d4..5eddf7a35f 100644 --- a/src/include/function/udf_function.h +++ b/src/include/function/udf_function.h @@ -4,7 +4,6 @@ #include "common/exception/binder.h" #include "common/exception/catalog.h" -#include "common/exception/not_implemented.h" #include "common/types/blob.h" #include "common/types/ku_string.h" #include "function/scalar_function.h" @@ -66,7 +65,7 @@ struct UDF { case common::LogicalTypeID::BLOB: return std::is_same(); default: - throw common::NotImplementedException{"function::validateType"}; + KU_UNREACHABLE; } } @@ -81,7 +80,7 @@ struct UDF { template static function::scalar_exec_func createUnaryExecFunc(RESULT_TYPE (*/*udfFunc*/)(Args...), std::vector /*parameterTypes*/) { - throw common::NotImplementedException{"function::createUnaryExecFunc()"}; + KU_UNREACHABLE; } template @@ -106,7 +105,7 @@ struct UDF { template static function::scalar_exec_func createBinaryExecFunc(RESULT_TYPE (*/*udfFunc*/)(Args...), std::vector /*parameterTypes*/) { - throw common::NotImplementedException{"function::createBinaryExecFunc()"}; + KU_UNREACHABLE; } template @@ -133,7 +132,7 @@ struct UDF { template static function::scalar_exec_func createTernaryExecFunc(RESULT_TYPE (*/*udfFunc*/)(Args...), std::vector /*parameterTypes*/) { - throw common::NotImplementedException{"function::createTernaryExecFunc()"}; + KU_UNREACHABLE; } template @@ -191,7 +190,7 @@ struct UDF { } else if (std::is_same()) { return common::LogicalTypeID::STRING; } else { - throw common::NotImplementedException{"function::getParameterType"}; + KU_UNREACHABLE; } } @@ -218,7 +217,7 @@ struct UDF { std::vector parameterTypes, common::LogicalTypeID returnType) { function_set definitions; if (returnType == common::LogicalTypeID::STRING) { - throw common::NotImplementedException{"function::getFunction"}; + KU_UNREACHABLE; } validateType(returnType); scalar_exec_func scalarExecFunc = getScalarExecFunc(udfFunc, parameterTypes); diff --git a/src/include/processor/operator/persistent/reader/parquet/column_reader.h b/src/include/processor/operator/persistent/reader/parquet/column_reader.h index 3eb7934b06..44eeaedf95 100644 --- a/src/include/processor/operator/persistent/reader/parquet/column_reader.h +++ b/src/include/processor/operator/persistent/reader/parquet/column_reader.h @@ -3,7 +3,6 @@ #include #include "common/constants.h" -#include "common/exception/not_implemented.h" #include "common/types/types.h" #include "common/vector/value_vector.h" #include "parquet/parquet_types.h" @@ -30,22 +29,16 @@ class ColumnReader { virtual inline void skip(uint64_t numValues) { pendingSkips += numValues; } virtual inline void dictionary( std::shared_ptr /*data*/, uint64_t /*num_entries*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("Dictionary"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } virtual inline void offsets(uint32_t* /*offsets*/, uint8_t* /*defines*/, uint64_t /*numValues*/, parquet_filter_t& /*filter*/, uint64_t /*resultOffset*/, common::ValueVector* /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("ColumnReader::offsets"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } virtual inline void plain(std::shared_ptr /*plainData*/, uint8_t* /*defines*/, uint64_t /*numValues*/, parquet_filter_t& /*filter*/, uint64_t /*resultOffset*/, common::ValueVector* /*result*/) { - // LCOV_EXCL_START - throw common::NotImplementedException("ColumnReader::plain"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } virtual inline void resetPage() {} virtual inline uint64_t getGroupRowsAvailable() { return groupRowsAvailable; } diff --git a/src/include/processor/operator/persistent/writer/parquet/basic_column_writer.h b/src/include/processor/operator/persistent/writer/parquet/basic_column_writer.h index d9dc588866..6f94a8b6ab 100644 --- a/src/include/processor/operator/persistent/writer/parquet/basic_column_writer.h +++ b/src/include/processor/operator/persistent/writer/parquet/basic_column_writer.h @@ -67,7 +67,7 @@ class BasicColumnWriter : public ColumnWriter { // Retrieves the row size of a vector at the specified location. Only used for scalar types. virtual uint64_t getRowSize( common::ValueVector* /*vector*/, uint64_t /*index*/, BasicColumnWriterState& /*state*/) { - throw common::NotImplementedException{"BasicColumnWriter::getRowSize"}; + KU_UNREACHABLE; } // Writes a (subset of a) vector to the specified serializer. Only used for scalar types. virtual void writeVector(common::Serializer& bufferedSerializer, ColumnWriterStatistics* stats, @@ -76,14 +76,12 @@ class BasicColumnWriter : public ColumnWriter { virtual bool hasDictionary(BasicColumnWriterState& /*writerState*/) { return false; } // The number of elements in the dictionary. - virtual uint64_t dictionarySize(BasicColumnWriterState& /*writerState*/) { - throw common::NotImplementedException{"BasicColumnWriter::dictionarySize"}; - } + virtual uint64_t dictionarySize(BasicColumnWriterState& /*writerState*/) { KU_UNREACHABLE; } void writeDictionary(BasicColumnWriterState& state, std::unique_ptr bufferedSerializer, uint64_t rowCount); virtual void flushDictionary( BasicColumnWriterState& /*state*/, ColumnWriterStatistics* /*stats*/) { - throw common::NotImplementedException{"BasicColumnWriter::flushDictionary"}; + KU_UNREACHABLE; } void setParquetStatistics( diff --git a/src/include/processor/operator/persistent/writer/parquet/column_writer.h b/src/include/processor/operator/persistent/writer/parquet/column_writer.h index d508f8f460..04765d047d 100644 --- a/src/include/processor/operator/persistent/writer/parquet/column_writer.h +++ b/src/include/processor/operator/persistent/writer/parquet/column_writer.h @@ -1,6 +1,5 @@ #pragma once -#include "common/exception/not_implemented.h" #include "common/serializer/buffered_serializer.h" #include "common/types/types.h" #include "common/vector/value_vector.h" @@ -76,12 +75,10 @@ class ColumnWriter { virtual bool hasAnalyze() { return false; } virtual void analyze(ColumnWriterState& /*state*/, ColumnWriterState* /*parent*/, common::ValueVector* /*vector*/, uint64_t /*count*/) { - throw common::NotImplementedException{"ColumnWriter::analyze"}; + KU_UNREACHABLE; } // Called after all data has been passed to Analyze. - virtual void finalizeAnalyze(ColumnWriterState& /*state*/) { - throw common::NotImplementedException{"ColumnWriter::finalizeAnalyze"}; - } + virtual void finalizeAnalyze(ColumnWriterState& /*state*/) { KU_UNREACHABLE; } virtual void prepare(ColumnWriterState& state, ColumnWriterState* parent, common::ValueVector* vector, uint64_t count) = 0; virtual void beginWrite(ColumnWriterState& state) = 0; diff --git a/src/include/storage/store/string_column_chunk.h b/src/include/storage/store/string_column_chunk.h index 6d11c931ef..fc00c946c7 100644 --- a/src/include/storage/store/string_column_chunk.h +++ b/src/include/storage/store/string_column_chunk.h @@ -1,6 +1,5 @@ #pragma once -#include "common/exception/not_implemented.h" #include "storage/storage_structure/in_mem_file.h" #include "storage/store/column_chunk.h" @@ -21,7 +20,7 @@ class StringColumnChunk : public ColumnChunk { template T getValue(common::offset_t /*pos*/) const { - throw common::NotImplementedException("VarSizedColumnChunk::getValue"); + KU_UNREACHABLE; } common::page_idx_t flushOverflowBuffer(BMFileHandle* dataFH, common::page_idx_t startPageIdx); diff --git a/src/parser/transform/transform_reading_clause.cpp b/src/parser/transform/transform_reading_clause.cpp index 2bd769dec0..ca1f3b6d14 100644 --- a/src/parser/transform/transform_reading_clause.cpp +++ b/src/parser/transform/transform_reading_clause.cpp @@ -1,4 +1,4 @@ -#include "common/exception/not_implemented.h" +#include "common/assert.h" #include "parser/query/reading_clause/in_query_call_clause.h" #include "parser/query/reading_clause/load_from.h" #include "parser/query/reading_clause/match_clause.h" @@ -21,9 +21,7 @@ std::unique_ptr Transformer::transformReadingClause( } else if (ctx.kU_LoadFrom()) { return transformLoadFrom(*ctx.kU_LoadFrom()); } - // LCOV_EXCL_START - throw common::NotImplementedException("Transformer::transformReadingClause"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } std::unique_ptr Transformer::transformMatch(CypherParser::OC_MatchContext& ctx) { diff --git a/src/parser/transform/transform_transaction.cpp b/src/parser/transform/transform_transaction.cpp index f9568e28db..4c382a9c97 100644 --- a/src/parser/transform/transform_transaction.cpp +++ b/src/parser/transform/transform_transaction.cpp @@ -1,4 +1,4 @@ -#include "common/exception/not_implemented.h" +#include "common/assert.h" #include "parser/transaction_statement.h" #include "parser/transformer.h" @@ -25,8 +25,8 @@ std::unique_ptr Transformer::transformTransaction( } else if (ctx.ROLLBACK_SKIP_CHECKPOINT()) { return std::make_unique( TransactionAction::ROLLBACK_SKIP_CHECKPOINTING); - } else { // LCOV_EXCL_START - throw NotImplementedException("Transformer::transformTransaction"); // LCOV_EXCL_STOP + } else { + KU_UNREACHABLE; } } diff --git a/src/parser/transformer.cpp b/src/parser/transformer.cpp index 050f2b5966..b6d70b0235 100644 --- a/src/parser/transformer.cpp +++ b/src/parser/transformer.cpp @@ -1,7 +1,6 @@ #include "parser/transformer.h" #include "common/assert.h" -#include "common/exception/not_implemented.h" #include "common/string_utils.h" #include "parser/explain_statement.h" #include "parser/query/regular_query.h" // IWYU pragma: keep (fixes a forward declaration error) @@ -41,8 +40,8 @@ std::unique_ptr Transformer::transformStatement(CypherParser::OC_Stat return transformCommentOn(*ctx.kU_CommentOn()); } else if (ctx.kU_Transaction()) { return transformTransaction(*ctx.kU_Transaction()); - } else { // LCOV_EXCL_START - throw NotImplementedException("Transformer::transformOcStatement"); // LCOV_EXCL_STOP + } else { + KU_UNREACHABLE; } } diff --git a/src/planner/join_order/cardinality_estimator.cpp b/src/planner/join_order/cardinality_estimator.cpp index 82f52480f6..3c90363e39 100644 --- a/src/planner/join_order/cardinality_estimator.cpp +++ b/src/planner/join_order/cardinality_estimator.cpp @@ -1,7 +1,6 @@ #include "planner/join_order/cardinality_estimator.h" #include "binder/expression/property_expression.h" -#include "common/exception/not_implemented.h" #include "planner/join_order/join_order_util.h" #include "planner/operator/scan/logical_scan_internal_id.h" @@ -137,7 +136,7 @@ double CardinalityEstimator::getExtensionRate( return std::min(oneHopExtensionRate * rel.getUpperBound(), numRels); } default: - throw NotImplementedException("getExtensionRate()"); + KU_UNREACHABLE; } } diff --git a/src/planner/operator/extend/base_logical_extend.cpp b/src/planner/operator/extend/base_logical_extend.cpp index f773cfe438..0257f9a71a 100644 --- a/src/planner/operator/extend/base_logical_extend.cpp +++ b/src/planner/operator/extend/base_logical_extend.cpp @@ -1,7 +1,5 @@ #include "planner/operator/extend/base_logical_extend.h" -#include "common/exception/not_implemented.h" - using namespace kuzu::common; namespace kuzu { @@ -46,7 +44,7 @@ std::string BaseLogicalExtend::getExpressionsForPrinting() const { result += "->"; } break; default: - throw NotImplementedException("BaseLogicalExtend::getExpressionsForPrinting"); + KU_UNREACHABLE; } result += nbrNode->toString(); return result; diff --git a/src/planner/operator/logical_explain.cpp b/src/planner/operator/logical_explain.cpp index 2c47ff5890..291b7d1cec 100644 --- a/src/planner/operator/logical_explain.cpp +++ b/src/planner/operator/logical_explain.cpp @@ -1,7 +1,5 @@ #include "planner/operator/logical_explain.h" -#include "common/exception/not_implemented.h" - using namespace kuzu::common; namespace kuzu { @@ -16,7 +14,7 @@ void LogicalExplain::computeSchema() { createEmptySchema(); break; default: - throw NotImplementedException{"LogicalExplain::computeFlatSchema"}; + KU_UNREACHABLE; } } diff --git a/src/planner/operator/logical_hash_join.cpp b/src/planner/operator/logical_hash_join.cpp index 7ea4bf6984..73c42f6fb3 100644 --- a/src/planner/operator/logical_hash_join.cpp +++ b/src/planner/operator/logical_hash_join.cpp @@ -1,6 +1,5 @@ #include "planner/operator/logical_hash_join.h" -#include "common/exception/not_implemented.h" #include "planner/operator/factorization/flatten_resolver.h" #include "planner/operator/factorization/sink_util.h" #include "planner/operator/scan/logical_scan_internal_id.h" @@ -79,7 +78,7 @@ void LogicalHashJoin::computeFactorizedSchema() { schema->insertToGroupAndScope(mark, markPos); } break; default: - throw NotImplementedException("HashJoin::computeFactorizedSchema()"); + KU_UNREACHABLE; } } @@ -99,7 +98,7 @@ void LogicalHashJoin::computeFlatSchema() { schema->insertToGroupAndScope(mark, 0); } break; default: - throw NotImplementedException("HashJoin::computeFlatSchema()"); + KU_UNREACHABLE; } } @@ -113,7 +112,7 @@ binder::expression_vector LogicalHashJoin::getExpressionsToMaterialize() const { return binder::expression_vector{}; } default: - throw NotImplementedException("HashJoin::getExpressionsToMaterialize"); + KU_UNREACHABLE; } } diff --git a/src/planner/operator/logical_operator.cpp b/src/planner/operator/logical_operator.cpp index e194b12fad..e0badb500b 100644 --- a/src/planner/operator/logical_operator.cpp +++ b/src/planner/operator/logical_operator.cpp @@ -1,7 +1,5 @@ #include "planner/operator/logical_operator.h" -#include "common/exception/not_implemented.h" - using namespace kuzu::common; namespace kuzu { @@ -148,7 +146,7 @@ std::string LogicalOperatorUtils::logicalOperatorTypeToString(LogicalOperatorTyp return "UNWIND"; } default: - throw NotImplementedException("LogicalOperatorUtils::logicalOperatorTypeToString"); + KU_UNREACHABLE; } } diff --git a/src/planner/plan/append_extend.cpp b/src/planner/plan/append_extend.cpp index 2ec1593f5a..6c7d053d3d 100644 --- a/src/planner/plan/append_extend.cpp +++ b/src/planner/plan/append_extend.cpp @@ -2,7 +2,6 @@ #include "binder/expression/property_expression.h" #include "binder/expression_visitor.h" #include "catalog/rel_table_schema.h" -#include "common/exception/not_implemented.h" #include "planner/join_order/cost_model.h" #include "planner/operator/extend/logical_extend.h" #include "planner/operator/extend/logical_recursive_extend.h" @@ -51,7 +50,7 @@ static std::unordered_set getBoundNodeTableIDSet( result.insert(tableSchema->getBoundTableID(RelDataDirection::BWD)); } break; default: - throw NotImplementedException("getBoundNodeTableIDSet"); + KU_UNREACHABLE; } } return result; @@ -75,7 +74,7 @@ static std::unordered_set getNbrNodeTableIDSet( result.insert(tableSchema->getNbrTableID(RelDataDirection::BWD)); } break; default: - throw NotImplementedException("getNbrNodeTableIDSet"); + KU_UNREACHABLE; } } return result; diff --git a/src/planner/plan/plan_copy.cpp b/src/planner/plan/plan_copy.cpp index 03656f1505..3139a6cd45 100644 --- a/src/planner/plan/plan_copy.cpp +++ b/src/planner/plan/plan_copy.cpp @@ -2,7 +2,6 @@ #include "binder/copy/bound_copy_to.h" #include "catalog/node_table_schema.h" #include "catalog/rel_table_schema.h" -#include "common/exception/not_implemented.h" #include "planner/operator/logical_partitioner.h" #include "planner/operator/persistent/logical_copy_from.h" #include "planner/operator/persistent/logical_copy_to.h" @@ -59,11 +58,9 @@ static void appendPartitioner(BoundCopyFromInfo* copyFromInfo, LogicalPlan& plan ColumnDataFormat::REGULAR : ColumnDataFormat::CSR)); } break; - // LCOV_EXCL_START default: { - throw NotImplementedException("PlanMapper::appendIndexScan"); + KU_UNREACHABLE; } - // LCOV_EXCL_STOP } auto partitioner = std::make_shared(std::move(infos), plan.getLastOperator()); diff --git a/src/planner/plan/plan_join_order.cpp b/src/planner/plan/plan_join_order.cpp index f375f1659c..00950d4001 100644 --- a/src/planner/plan/plan_join_order.cpp +++ b/src/planner/plan/plan_join_order.cpp @@ -1,5 +1,4 @@ #include "binder/expression_visitor.h" -#include "common/exception/not_implemented.h" #include "planner/join_order/cost_model.h" #include "planner/operator/scan/logical_scan_internal_id.h" #include "planner/query_planner.h" @@ -94,7 +93,7 @@ std::vector> QueryPlanner::enumerateQueryGraphColle } } break; default: - throw NotImplementedException("QueryPlanner::enumerateQueryGraphCollection"); + KU_UNREACHABLE; } plansPerQueryGraph.push_back(std::move(plans)); } @@ -231,7 +230,7 @@ void QueryPlanner::planBaseTableScans( planCorrelatedExpressionsScan(correlatedExpressions); } break; default: - throw NotImplementedException("QueryPlanner::planBaseTableScan"); + KU_UNREACHABLE; } for (auto relPos = 0u; relPos < queryGraph->getNumQueryRels(); ++relPos) { planRelScan(relPos); @@ -323,7 +322,7 @@ void QueryPlanner::appendExtendAndFilter(std::shared_ptr boundNo appendRecursiveExtend(boundNode, nbrNode, rel, direction, plan); } break; default: - throw NotImplementedException("JoinOrderEnumerator::appendExtendAndFilter"); + KU_UNREACHABLE; } appendFilters(predicates, plan); } diff --git a/src/planner/plan/plan_read.cpp b/src/planner/plan/plan_read.cpp index c4cd742440..ae3fc5f0b2 100644 --- a/src/planner/plan/plan_read.cpp +++ b/src/planner/plan/plan_read.cpp @@ -1,7 +1,6 @@ #include "binder/expression_visitor.h" #include "binder/query/reading_clause/bound_load_from.h" #include "binder/query/reading_clause/bound_match_clause.h" -#include "common/exception/not_implemented.h" #include "planner/query_planner.h" using namespace kuzu::binder; @@ -27,9 +26,7 @@ void QueryPlanner::planReadingClause( planLoadFrom(boundReadingClause, prevPlans); } break; default: - // LCOV_EXCL_START - throw NotImplementedException("QueryPlanner::planReadingClause"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -54,7 +51,7 @@ void QueryPlanner::planMatchClause( } } break; default: - throw NotImplementedException("QueryPlanner::planMatchClause"); + KU_UNREACHABLE; } } diff --git a/src/planner/plan/plan_update.cpp b/src/planner/plan/plan_update.cpp index c2c350e85e..3e2ddd1ef6 100644 --- a/src/planner/plan/plan_update.cpp +++ b/src/planner/plan/plan_update.cpp @@ -2,7 +2,6 @@ #include "binder/query/updating_clause/bound_insert_clause.h" #include "binder/query/updating_clause/bound_merge_clause.h" #include "binder/query/updating_clause/bound_set_clause.h" -#include "common/exception/not_implemented.h" #include "planner/operator/persistent/logical_merge.h" #include "planner/query_planner.h" @@ -38,9 +37,7 @@ void QueryPlanner::planUpdatingClause(BoundUpdatingClause& updatingClause, Logic return; } default: - // LCOV_EXCL_START - throw NotImplementedException("QueryPlanner::planUpdatingClause"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -81,9 +78,7 @@ void QueryPlanner::planMergeClause(binder::BoundUpdatingClause& updatingClause, mark = rel->getInternalIDProperty(); } break; default: - // LCOV_EXCL_START - throw NotImplementedException("QueryPlanner::planMergeClause"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } std::vector> logicalInsertNodeInfos; if (mergeClause.hasInsertNodeInfo()) { diff --git a/src/processor/map/expression_mapper.cpp b/src/processor/map/expression_mapper.cpp index 9f184cabc7..6fc898f6fd 100644 --- a/src/processor/map/expression_mapper.cpp +++ b/src/processor/map/expression_mapper.cpp @@ -7,6 +7,7 @@ #include "binder/expression/parameter_expression.h" #include "binder/expression/rel_expression.h" #include "binder/expression_visitor.h" // IWYU pragma: keep (used in assert) +#include "common/exception/not_implemented.h" #include "common/string_format.h" #include "expression_evaluator/case_evaluator.h" #include "expression_evaluator/function_evaluator.h" diff --git a/src/processor/map/map_copy_to.cpp b/src/processor/map/map_copy_to.cpp index b7e08be3e1..b063d3cc30 100644 --- a/src/processor/map/map_copy_to.cpp +++ b/src/processor/map/map_copy_to.cpp @@ -38,10 +38,8 @@ std::unique_ptr getCopyToInfo(Schema* childSchema, const std::string return std::make_unique( columnNames, vectorsToCopyPos, filePath, std::move(isFlat)); } - // LCOV_EXCL_START default: - throw NotImplementedException{"getCopyToInfo"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -51,10 +49,8 @@ static std::shared_ptr getCopyToSharedState(FileType fileType return std::make_shared(); case FileType::PARQUET: return std::make_shared(); - // LCOV_EXCL_START default: - throw NotImplementedException{"getCopyToSharedState"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/processor/map/map_ddl.cpp b/src/processor/map/map_ddl.cpp index b4fdf7ed15..9ea4060582 100644 --- a/src/processor/map/map_ddl.cpp +++ b/src/processor/map/map_ddl.cpp @@ -1,4 +1,3 @@ -#include "common/exception/not_implemented.h" #include "planner/operator/ddl/logical_alter.h" #include "planner/operator/ddl/logical_create_table.h" #include "planner/operator/ddl/logical_drop_table.h" @@ -43,9 +42,7 @@ std::unique_ptr PlanMapper::mapCreateTable(LogicalOperator* lo return mapCreateRdfGraph(logicalOperator); } default: - // LCOV_EXCL_START - throw NotImplementedException("PlanMapper::mapCreateTable"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -100,9 +97,7 @@ std::unique_ptr PlanMapper::mapAlter(LogicalOperator* logicalO return mapRenameProperty(logicalOperator); } default: - // LCOV_EXCL_START - throw NotImplementedException("PlanMapper::mapAlter"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -131,9 +126,7 @@ std::unique_ptr PlanMapper::mapAddProperty(LogicalOperator* lo extraInfo->dataType->copy(), std::move(expressionEvaluator), storageManager, getOutputPos(alter), getOperatorID(), alter->getExpressionsForPrinting()); default: - // LCOV_EXCL_START - throw NotImplementedException("PlanMapper::mapAddProperty"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/processor/map/map_extend.cpp b/src/processor/map/map_extend.cpp index 4900877c3d..46393e43db 100644 --- a/src/processor/map/map_extend.cpp +++ b/src/processor/map/map_extend.cpp @@ -1,5 +1,4 @@ #include "binder/expression/property_expression.h" -#include "common/exception/not_implemented.h" #include "planner/operator/extend/logical_extend.h" #include "processor/operator/scan/scan_multi_rel_tables.h" #include "processor/operator/scan/scan_rel_csr_columns.h" @@ -74,7 +73,7 @@ static std::unique_ptr populateRelTableCollectionScan } } break; default: - throw NotImplementedException("populateRelTableCollectionScanner"); + KU_UNREACHABLE; } } if (scanInfos.empty()) { diff --git a/src/processor/map/map_semi_masker.cpp b/src/processor/map/map_semi_masker.cpp index 99e61ace41..0ed0595877 100644 --- a/src/processor/map/map_semi_masker.cpp +++ b/src/processor/map/map_semi_masker.cpp @@ -1,4 +1,3 @@ -#include "common/exception/not_implemented.h" #include "planner/operator/sip/logical_semi_masker.h" #include "processor/operator/recursive_extend/recursive_join.h" #include "processor/operator/scan_node_id.h" @@ -40,7 +39,7 @@ std::unique_ptr PlanMapper::mapSemiMasker(LogicalOperator* log } } break; default: - throw NotImplementedException("PlanMapper::mapLogicalSemiMaskerToPhysical"); + KU_UNREACHABLE; } } auto keyPos = DataPos(inSchema->getExpressionPos(*semiMasker->getKey())); @@ -65,7 +64,7 @@ std::unique_ptr PlanMapper::mapSemiMasker(LogicalOperator* log } } default: - throw NotImplementedException("PlanMapper::mapLogicalSemiMaskerToPhysical"); + KU_UNREACHABLE; } } diff --git a/src/processor/map/plan_mapper.cpp b/src/processor/map/plan_mapper.cpp index 313ddb18fb..c3389b1335 100644 --- a/src/processor/map/plan_mapper.cpp +++ b/src/processor/map/plan_mapper.cpp @@ -1,6 +1,5 @@ #include "processor/plan_mapper.h" -#include "common/exception/not_implemented.h" #include "processor/operator/profile.h" using namespace kuzu::common; @@ -170,7 +169,7 @@ std::unique_ptr PlanMapper::mapOperator(LogicalOperator* logic physicalOperator = mapTransaction(logicalOperator); } break; default: - throw NotImplementedException("PlanMapper::mapLogicalOperatorToPhysical()"); + KU_UNREACHABLE; } logicalOpToPhysicalOpMap.insert({logicalOperator, physicalOperator.get()}); return physicalOperator; diff --git a/src/processor/operator/index_lookup.cpp b/src/processor/operator/index_lookup.cpp index d71a93c0bf..49c280c48d 100644 --- a/src/processor/operator/index_lookup.cpp +++ b/src/processor/operator/index_lookup.cpp @@ -1,7 +1,6 @@ #include "processor/operator/index_lookup.h" #include "common/exception/message.h" -#include "common/exception/not_implemented.h" #include "storage/index/hash_index.h" using namespace kuzu::common; @@ -82,11 +81,9 @@ void IndexLookup::fillOffsetArraysFromVector(transaction::Transaction* transacti offsets[i] = keyVector->getValue(pos); } } break; - // LCOV_EXCL_START default: { - throw NotImplementedException("IndexLookup::fillOffsetArraysFromVector"); + KU_UNREACHABLE; } - // LCOV_EXCL_STOP } } diff --git a/src/processor/operator/order_by/order_by_key_encoder.cpp b/src/processor/operator/order_by/order_by_key_encoder.cpp index e44f746dbb..84f6a8b247 100644 --- a/src/processor/operator/order_by/order_by_key_encoder.cpp +++ b/src/processor/operator/order_by/order_by_key_encoder.cpp @@ -3,7 +3,6 @@ #include #include -#include "common/exception/not_implemented.h" #include "common/string_format.h" #include "common/utils.h" #include "storage/storage_utils.h" @@ -260,9 +259,7 @@ void OrderByKeyEncoder::getEncodingFunction(PhysicalTypeID physicalType, encode_ return; } default: - // LCOV_EXCL_START - throw NotImplementedException("OrderByKeyEncoder::getEncodingFunction"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/processor/operator/order_by/top_k.cpp b/src/processor/operator/order_by/top_k.cpp index 669ad5b599..2a2b60b023 100644 --- a/src/processor/operator/order_by/top_k.cpp +++ b/src/processor/operator/order_by/top_k.cpp @@ -1,6 +1,5 @@ #include "processor/operator/order_by/top_k.h" -#include "common/exception/not_implemented.h" #include "function/binary_function_executor.h" #include "function/comparison/comparison_functions.h" @@ -155,7 +154,7 @@ void TopKBuffer::getSelectComparisonFunction( common::interval_t, FUNC>; } break; default: - throw common::NotImplementedException{"TopKBuffer::getSelectComparisonFunction"}; + KU_UNREACHABLE; } } diff --git a/src/processor/operator/persistent/csv_file_writer.cpp b/src/processor/operator/persistent/csv_file_writer.cpp index 59655c14c7..456d7d7450 100644 --- a/src/processor/operator/persistent/csv_file_writer.cpp +++ b/src/processor/operator/persistent/csv_file_writer.cpp @@ -3,7 +3,6 @@ #include #include "common/constants.h" -#include "common/exception/not_implemented.h" #include "common/file_utils.h" #include "common/string_utils.h" #include "common/type_utils.h" @@ -104,7 +103,7 @@ void CSVFileWriter::writeValue(common::ValueVector* vector) { case LogicalTypeID::STRUCT: return writeToBuffer(vector, true /* escapeStringValue */); default: { - throw NotImplementedException("CSVFileWriter::writeValue"); + KU_UNREACHABLE; } } } diff --git a/src/processor/operator/persistent/reader/parquet/column_reader.cpp b/src/processor/operator/persistent/reader/parquet/column_reader.cpp index 0f1286c4b5..bad4d092b1 100644 --- a/src/processor/operator/persistent/reader/parquet/column_reader.cpp +++ b/src/processor/operator/persistent/reader/parquet/column_reader.cpp @@ -251,10 +251,8 @@ std::unique_ptr ColumnReader::createReader(ParquetReader& reader, case common::LogicalTypeID::TIMESTAMP: return createTimestampReader( reader, std::move(type), schema, fileIdx, maxDefine, maxRepeat); - // LCOV_EXCL_START default: - throw common::NotImplementedException{"ColumnReader::createReader"}; - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } @@ -468,13 +466,13 @@ void ColumnReader::prepareDataPage(kuzu_parquet::format::PageHeader& pageHdr) { } case Encoding::DELTA_LENGTH_BYTE_ARRAY: case Encoding::DELTA_BYTE_ARRAY: { - throw common::NotImplementedException("ColumnReader::prepareDataPage"); + KU_UNREACHABLE; } case Encoding::PLAIN: // nothing to do here, will be read directly below break; default: - throw std::runtime_error("Unsupported page encoding"); + throw common::NotImplementedException("Parquet: unsupported page encoding"); } } @@ -522,14 +520,14 @@ std::unique_ptr ColumnReader::createTimestampReader(ParquetReader& ParquetTimeStampUtils::parquetTimestampMsToTimestamp>>( reader, std::move(type), schema, fileIdx, maxDefine, maxRepeat); default: - throw common::NotImplementedException{"ColumnReader::createReader"}; + KU_UNREACHABLE; } // LCOV_EXCL_STOP } } - default: { // LCOV_EXCL_START - throw common::NotImplementedException{"ColumnReader::createReader"}; - } // LCOV_EXCL_STOP + default: { + KU_UNREACHABLE; + } } } diff --git a/src/processor/operator/persistent/reader/rdf/rdf_reader.cpp b/src/processor/operator/persistent/reader/rdf/rdf_reader.cpp index 92f16b08f4..02dd14215b 100644 --- a/src/processor/operator/persistent/reader/rdf/rdf_reader.cpp +++ b/src/processor/operator/persistent/reader/rdf/rdf_reader.cpp @@ -4,7 +4,6 @@ #include "common/constants.h" #include "common/exception/copy.h" -#include "common/exception/not_implemented.h" #include "common/keyword/rdf_keyword.h" #include "common/string_format.h" #include "common/vector/value_vector.h" @@ -197,9 +196,7 @@ SerdStatus RDFReader::readerStatementSink(void* handle, SerdStatementFlags /*fla reader->rowOffset++; } break; default: - // LCOV_EXCL_START - throw NotImplementedException("RDFReader::statementSink"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } return SERD_SUCCESS; diff --git a/src/processor/operator/persistent/writer/parquet/column_writer.cpp b/src/processor/operator/persistent/writer/parquet/column_writer.cpp index 4afb44ff70..16bd061f58 100644 --- a/src/processor/operator/persistent/writer/parquet/column_writer.cpp +++ b/src/processor/operator/persistent/writer/parquet/column_writer.cpp @@ -1,6 +1,5 @@ #include "processor/operator/persistent/writer/parquet/column_writer.h" -#include "common/exception/not_implemented.h" #include "common/string_format.h" #include "function/cast/functions/numeric_limits.h" #include "processor/operator/persistent/writer/parquet/boolean_column_writer.h" @@ -230,10 +229,8 @@ std::unique_ptr ColumnWriter::createWriterRecursive( return std::make_unique(writer, schemaIdx, std::move(schemaPathToCreate), maxRepeatToCreate, maxDefineToCreate, canHaveNullsToCreate); - // LCOV_EXCL_START default: - throw NotImplementedException("ParquetWriter::createWriterRecursive"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } } @@ -307,7 +304,7 @@ void ColumnWriter::compressPage(common::BufferedSerializer& bufferedSerializer, KU_ASSERT(compressedSize <= kuzu_snappy::MaxCompressedLength(bufferedSerializer.getSize())); } break; default: - throw NotImplementedException{"ColumnWriter::compressPage"}; + KU_UNREACHABLE; } if (compressedSize > uint64_t(function::NumericLimits::maximum())) { diff --git a/src/processor/operator/persistent/writer/parquet/parquet_rle_bp_encoder.cpp b/src/processor/operator/persistent/writer/parquet/parquet_rle_bp_encoder.cpp index 6a6e4ab565..2118aae331 100644 --- a/src/processor/operator/persistent/writer/parquet/parquet_rle_bp_encoder.cpp +++ b/src/processor/operator/persistent/writer/parquet/parquet_rle_bp_encoder.cpp @@ -1,7 +1,6 @@ #include "processor/operator/persistent/writer/parquet/parquet_rle_bp_encoder.h" #include "common/assert.h" -#include "common/exception/not_implemented.h" namespace kuzu { namespace processor { @@ -90,7 +89,7 @@ void RleBpEncoder::writeRun(common::Serializer& writer) { writer.write(lastValue); break; default: - throw common::NotImplementedException("RleBpEncoder::WriteRun"); + KU_UNREACHABLE; } currentRunCount = 1; } diff --git a/src/processor/operator/persistent/writer/parquet/parquet_writer.cpp b/src/processor/operator/persistent/writer/parquet/parquet_writer.cpp index 4df2ec0e63..9121d34c24 100644 --- a/src/processor/operator/persistent/writer/parquet/parquet_writer.cpp +++ b/src/processor/operator/persistent/writer/parquet/parquet_writer.cpp @@ -1,7 +1,6 @@ #include "processor/operator/persistent/writer/parquet/parquet_writer.h" #include "common/data_chunk/data_chunk.h" -#include "common/exception/not_implemented.h" #include "thrift/protocol/TCompactProtocol.h" namespace kuzu { @@ -74,7 +73,7 @@ Type::type ParquetWriter::convertToParquetType(LogicalType* type) { case LogicalTypeID::INTERVAL: return Type::FIXED_LEN_BYTE_ARRAY; default: - throw NotImplementedException("ParquetWriter::convertToParquetType"); + KU_UNREACHABLE; } } diff --git a/src/processor/operator/recursive_extend/recursive_join.cpp b/src/processor/operator/recursive_extend/recursive_join.cpp index 1dea421100..57408a6b38 100644 --- a/src/processor/operator/recursive_extend/recursive_join.cpp +++ b/src/processor/operator/recursive_extend/recursive_join.cpp @@ -1,6 +1,5 @@ #include "processor/operator/recursive_extend/recursive_join.h" -#include "common/exception/not_implemented.h" #include "processor/operator/recursive_extend/all_shortest_path_state.h" #include "processor/operator/recursive_extend/scan_frontier.h" #include "processor/operator/recursive_extend/shortest_path_state.h" @@ -39,7 +38,7 @@ void RecursiveJoin::initLocalStateInternal(ResultSet* /*resultSet_*/, ExecutionC } } break; default: - throw NotImplementedException("BaseRecursiveJoin::initLocalStateInternal"); + KU_UNREACHABLE; } } break; case QueryRelType::SHORTEST: { @@ -61,7 +60,7 @@ void RecursiveJoin::initLocalStateInternal(ResultSet* /*resultSet_*/, ExecutionC } } break; default: - throw NotImplementedException("BaseRecursiveJoin::initLocalStateInternal"); + KU_UNREACHABLE; } } break; case QueryRelType::ALL_SHORTEST: { @@ -84,11 +83,11 @@ void RecursiveJoin::initLocalStateInternal(ResultSet* /*resultSet_*/, ExecutionC } } break; default: - throw NotImplementedException("BaseRecursiveJoin::initLocalStateInternal"); + KU_UNREACHABLE; } } break; default: - throw NotImplementedException("BaseRecursiveJoin::initLocalStateInternal"); + KU_UNREACHABLE; } if (vectors->pathVector != nullptr) { auto pathNodesFieldIdx = diff --git a/src/processor/operator/transaction.cpp b/src/processor/operator/transaction.cpp index b74c702372..2d6ab3444f 100644 --- a/src/processor/operator/transaction.cpp +++ b/src/processor/operator/transaction.cpp @@ -1,6 +1,5 @@ #include "processor/operator/transaction.h" -#include "common/exception/not_implemented.h" #include "transaction/transaction_context.h" using namespace kuzu::common; @@ -33,8 +32,8 @@ bool Transaction::getNextTuplesInternal(ExecutionContext* context) { case transaction::TransactionAction::ROLLBACK_SKIP_CHECKPOINTING: { transactionContext->rollbackSkipCheckPointing(); } break; - default: // LCOV_EXCL_START - throw NotImplementedException("Transaction::getNextTuplesInternal"); // LCOV_EXCL_STOP + default: + KU_UNREACHABLE; } return true; } diff --git a/src/storage/buffer_manager/buffer_manager.cpp b/src/storage/buffer_manager/buffer_manager.cpp index dfb3a707fe..1e09c7d02b 100644 --- a/src/storage/buffer_manager/buffer_manager.cpp +++ b/src/storage/buffer_manager/buffer_manager.cpp @@ -4,7 +4,6 @@ #include "common/constants.h" #include "common/exception/buffer_manager.h" -#include "common/exception/not_implemented.h" #if defined(_WIN32) #include @@ -112,9 +111,7 @@ uint8_t* BufferManager::pin( continue; } default: { - // LCOV_EXCL_START - throw NotImplementedException("Invalid PageState in BufferManager::pin!"); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } } diff --git a/src/storage/index/hash_index_builder.cpp b/src/storage/index/hash_index_builder.cpp index 1969d943ce..55c4a44a20 100644 --- a/src/storage/index/hash_index_builder.cpp +++ b/src/storage/index/hash_index_builder.cpp @@ -1,7 +1,5 @@ #include "storage/index/hash_index_builder.h" -#include "common/exception/not_implemented.h" - using namespace kuzu::common; namespace kuzu { @@ -189,7 +187,7 @@ PrimaryKeyIndexBuilder::PrimaryKeyIndexBuilder( std::make_unique>(fName, keyDataType); } break; default: { - throw NotImplementedException("PrimaryKeyIndexBuilder::PrimaryKeyIndexBuilder"); + KU_UNREACHABLE; } } } diff --git a/src/storage/stats/table_statistics.cpp b/src/storage/stats/table_statistics.cpp index a61ec7954d..e1b3c9aeff 100644 --- a/src/storage/stats/table_statistics.cpp +++ b/src/storage/stats/table_statistics.cpp @@ -1,7 +1,6 @@ #include "storage/stats/table_statistics.h" #include "catalog/table_schema.h" -#include "common/exception/not_implemented.h" #include "common/serializer/deserializer.h" #include "common/serializer/serializer.h" #include "storage/stats/node_table_statistics.h" @@ -62,11 +61,9 @@ std::unique_ptr TableStatistics::deserialize(Deserializer& dese case TableType::REL: { result = RelTableStats::deserialize(numTuples, tableID, deserializer); } break; - // LCOV_EXCL_START default: { - throw NotImplementedException("TableStatistics::deserialize"); + KU_UNREACHABLE; } - // LCOV_EXCL_STOP } result->tableType = tableType; result->numTuples = numTuples; diff --git a/src/storage/store/column.cpp b/src/storage/store/column.cpp index f3103de352..ee8a14f235 100644 --- a/src/storage/store/column.cpp +++ b/src/storage/store/column.cpp @@ -3,7 +3,6 @@ #include #include "common/assert.h" -#include "common/exception/not_implemented.h" #include "storage/stats/property_statistics.h" #include "storage/store/column_chunk.h" #include "storage/store/string_column.h" @@ -634,11 +633,9 @@ std::unique_ptr ColumnFactory::createColumn(const common::LogicalType& d return std::make_unique( metaDAHeaderInfo, dataFH, metadataFH, bufferManager, wal, transaction); } - // LCOV_EXCL_START default: { - throw NotImplementedException("ColumnFactory::createColumn"); + KU_UNREACHABLE; } - // LCOV_EXCL_STOP } } diff --git a/src/storage/store/column_chunk.cpp b/src/storage/store/column_chunk.cpp index 8706030844..07fc3d6c5a 100644 --- a/src/storage/store/column_chunk.cpp +++ b/src/storage/store/column_chunk.cpp @@ -500,10 +500,8 @@ std::unique_ptr ColumnChunkFactory::createColumnChunk( case PhysicalTypeID::STRUCT: { return std::make_unique(dataType, capacity, enableCompression); } - // LCOV_EXCL_START default: - throw NotImplementedException("ColumnChunkFactory::createColumnChunk."); - // LCOV_EXCL_STOP + KU_UNREACHABLE; } } diff --git a/src/storage/store/string_column_chunk.cpp b/src/storage/store/string_column_chunk.cpp index 18290a1b04..c673653830 100644 --- a/src/storage/store/string_column_chunk.cpp +++ b/src/storage/store/string_column_chunk.cpp @@ -1,6 +1,5 @@ #include "storage/store/string_column_chunk.h" -#include "common/exception/not_implemented.h" #include "common/type_utils.h" #include "storage/store/table_copy_utils.h" @@ -46,7 +45,7 @@ void StringColumnChunk::append( appendStringColumnChunk(otherChunk, startPosInOtherChunk, numValuesToAppend); } break; default: { - throw NotImplementedException("VarSizedColumnChunk::append"); + KU_UNREACHABLE; } } numValues += numValuesToAppend; diff --git a/src/transaction/transaction_context.cpp b/src/transaction/transaction_context.cpp index 280ba76313..60708f458f 100644 --- a/src/transaction/transaction_context.cpp +++ b/src/transaction/transaction_context.cpp @@ -1,7 +1,6 @@ #include "transaction/transaction_context.h" #include "common/exception/connection.h" -#include "common/exception/not_implemented.h" #include "common/exception/transaction_manager.h" #include "main/database.h" #include "transaction/transaction_manager.h" @@ -101,9 +100,8 @@ void TransactionContext::beginTransactionInternal(TransactionType transactionTyp case TransactionType::WRITE: { activeTransaction = database->transactionManager->beginWriteTransaction(); } break; - default: // LCOV_EXCL_START - throw NotImplementedException( - "TransactionContext::beginTransactionInternal"); // LCOV_EXCL_STOP + default: + KU_UNREACHABLE; } } diff --git a/test/include/graph_test/api_graph_test.h b/test/include/graph_test/api_graph_test.h index 994a8a07ba..1f0c51f001 100644 --- a/test/include/graph_test/api_graph_test.h +++ b/test/include/graph_test/api_graph_test.h @@ -8,7 +8,7 @@ namespace testing { // This class starts database without initializing graph. class APIEmptyDBTest : public BaseGraphTest { - std::string getInputDir() override { throw common::NotImplementedException("getInputDir()"); } + std::string getInputDir() override { KU_UNREACHABLE; } }; // This class starts database in on-disk mode. diff --git a/test/include/graph_test/graph_test.h b/test/include/graph_test/graph_test.h index ef8c5322ea..95bc38a4a6 100644 --- a/test/include/graph_test/graph_test.h +++ b/test/include/graph_test/graph_test.h @@ -30,7 +30,7 @@ class PrivateGraphTest : public BaseGraphTest { // This class starts database without initializing graph. class EmptyDBTest : public PrivateGraphTest { - std::string getInputDir() override { throw common::NotImplementedException("getInputDir()"); } + std::string getInputDir() override { KU_UNREACHABLE; } }; // This class starts database in on-disk mode. diff --git a/test/runner/e2e_test.cpp b/test/runner/e2e_test.cpp index 42eb3bcbf7..383a9dabcb 100644 --- a/test/runner/e2e_test.cpp +++ b/test/runner/e2e_test.cpp @@ -1,3 +1,4 @@ +#include "common/exception/not_implemented.h" #include "common/string_utils.h" #include "graph_test/graph_test.h" #include "test_runner/csv_to_parquet_converter.h" diff --git a/test/test_files/tinysnb/function/list.test b/test/test_files/tinysnb/function/list.test index ad92aa7b61..7928416884 100644 --- a/test/test_files/tinysnb/function/list.test +++ b/test/test_files/tinysnb/function/list.test @@ -1895,4 +1895,4 @@ Ad -LOG ListProductError -STATEMENT Return list_product(["ok"]); ---- error -LIST_PRODUCT::bindFunc +Binder exception: Unsupported inner data type for LIST_PRODUCT: STRING diff --git a/tools/python_api/src_cpp/py_query_result.cpp b/tools/python_api/src_cpp/py_query_result.cpp index 2366ce21c5..f358461a01 100644 --- a/tools/python_api/src_cpp/py_query_result.cpp +++ b/tools/python_api/src_cpp/py_query_result.cpp @@ -3,13 +3,12 @@ #include #include "common/arrow/arrow_converter.h" +#include "common/exception/not_implemented.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 "processor/result/factorized_table.h" -#include "processor/result/flat_tuple.h" using namespace kuzu::common; @@ -211,8 +210,7 @@ py::object PyQueryResult::convertValueToPyObject(const Value& value) { return convertNodeIdToPyDict(value.getValue()); } default: - throw NotImplementedException( - "Unsupported type: " + dataType->toString()); + throw NotImplementedException("Unsupported type: " + dataType->toString()); } } 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 db44440386..7522fe973d 100644 --- a/tools/python_api/src_cpp/py_query_result_converter.cpp +++ b/tools/python_api/src_cpp/py_query_result_converter.cpp @@ -61,7 +61,7 @@ void NPArrayWrapper::appendElement(Value* value) { break; } default: { - throw NotImplementedException("NPArrayWrapper::appendElement"); + KU_UNREACHABLE; } } } @@ -100,7 +100,7 @@ py::dtype NPArrayWrapper::convertToArrayType(const LogicalType& type) { break; } default: { - throw NotImplementedException("NPArrayWrapper::convertToArrayType"); + KU_UNREACHABLE; } } return py::dtype(dtype);