Skip to content

Commit

Permalink
removed unused enum constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Tishj committed Apr 19, 2024
1 parent 3e8d2ec commit 8838f07
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 26 deletions.
10 changes: 0 additions & 10 deletions src/common/enum_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3802,14 +3802,10 @@ const char* EnumUtil::ToChars<MapInvalidReason>(MapInvalidReason value) {
switch(value) {
case MapInvalidReason::VALID:
return "VALID";
case MapInvalidReason::NULL_KEY_LIST:
return "NULL_KEY_LIST";
case MapInvalidReason::NULL_KEY:
return "NULL_KEY";
case MapInvalidReason::DUPLICATE_KEY:
return "DUPLICATE_KEY";
case MapInvalidReason::NULL_VALUE_LIST:
return "NULL_VALUE_LIST";
case MapInvalidReason::NOT_ALIGNED:
return "NOT_ALIGNED";
case MapInvalidReason::INVALID_PARAMS:
Expand All @@ -3824,18 +3820,12 @@ MapInvalidReason EnumUtil::FromString<MapInvalidReason>(const char *value) {
if (StringUtil::Equals(value, "VALID")) {
return MapInvalidReason::VALID;
}
if (StringUtil::Equals(value, "NULL_KEY_LIST")) {
return MapInvalidReason::NULL_KEY_LIST;
}
if (StringUtil::Equals(value, "NULL_KEY")) {
return MapInvalidReason::NULL_KEY;
}
if (StringUtil::Equals(value, "DUPLICATE_KEY")) {
return MapInvalidReason::DUPLICATE_KEY;
}
if (StringUtil::Equals(value, "NULL_VALUE_LIST")) {
return MapInvalidReason::NULL_VALUE_LIST;
}
if (StringUtil::Equals(value, "NOT_ALIGNED")) {
return MapInvalidReason::NOT_ALIGNED;
}
Expand Down
4 changes: 0 additions & 4 deletions src/common/types/vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2089,10 +2089,6 @@ void MapVector::EvalMapInvalidReason(MapInvalidReason reason) {
throw InvalidInputException("Map keys must be unique.");
case MapInvalidReason::NULL_KEY:
throw InvalidInputException("Map keys can not be NULL.");
case MapInvalidReason::NULL_KEY_LIST:
throw InvalidInputException("The list of map keys must not be NULL.");
case MapInvalidReason::NULL_VALUE_LIST:
throw InvalidInputException("The list of map values must not be NULL.");
case MapInvalidReason::NOT_ALIGNED:
throw InvalidInputException("The map key list does not align with the map value list.");
case MapInvalidReason::INVALID_PARAMS:
Expand Down
3 changes: 0 additions & 3 deletions src/function/table/arrow_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,6 @@ static void ArrowToDuckDBMapVerify(Vector &vector, idx_t count) {
case MapInvalidReason::NULL_KEY: {
throw InvalidInputException("Arrow map contains NULL as map key, which isn't supported by DuckDB map type");
}
case MapInvalidReason::NULL_KEY_LIST: {
throw InvalidInputException("Arrow map contains NULL as key list, which isn't supported by DuckDB map type");
}
default: {
throw InternalException("MapInvalidReason not implemented");
}
Expand Down
10 changes: 1 addition & 9 deletions src/include/duckdb/common/types/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,15 +464,7 @@ struct FSSTVector {
DUCKDB_API static idx_t GetCount(Vector &vector);
};

enum class MapInvalidReason : uint8_t {
VALID,
NULL_KEY_LIST,
NULL_KEY,
DUPLICATE_KEY,
NULL_VALUE_LIST,
NOT_ALIGNED,
INVALID_PARAMS
};
enum class MapInvalidReason : uint8_t { VALID, NULL_KEY, DUPLICATE_KEY, NOT_ALIGNED, INVALID_PARAMS };

struct MapVector {
DUCKDB_API static const Vector &GetKeys(const Vector &vector);
Expand Down

0 comments on commit 8838f07

Please sign in to comment.