Skip to content

Commit

Permalink
Merge pull request duckdb#13760 from carlopi/fix_json_create
Browse files Browse the repository at this point in the history
json_create: Handle VARINT + explicit all cases
  • Loading branch information
Mytherin authored Sep 5, 2024
2 parents 95a9fe9 + 23c1467 commit ef6037e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion extension/json/json_functions/json_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ static void CreateValues(const StructNames &names, yyjson_mut_doc *doc, yyjson_m
case LogicalTypeId::TIMESTAMP_NS:
case LogicalTypeId::TIMESTAMP_MS:
case LogicalTypeId::TIMESTAMP_SEC:
case LogicalTypeId::VARINT:
case LogicalTypeId::UUID: {
Vector string_vector(LogicalTypeId::VARCHAR, count);
VectorOperations::DefaultCast(value_v, string_vector, count);
Expand All @@ -562,7 +563,17 @@ static void CreateValues(const StructNames &names, yyjson_mut_doc *doc, yyjson_m
TemplatedCreateValues<double, double>(doc, vals, double_vector, count);
break;
}
default:
case LogicalTypeId::INVALID:
case LogicalTypeId::UNKNOWN:
case LogicalTypeId::ANY:
case LogicalTypeId::USER:
case LogicalTypeId::CHAR:
case LogicalTypeId::STRING_LITERAL:
case LogicalTypeId::INTEGER_LITERAL:
case LogicalTypeId::POINTER:
case LogicalTypeId::VALIDITY:
case LogicalTypeId::TABLE:
case LogicalTypeId::LAMBDA:
throw InternalException("Unsupported type arrived at JSON create function");
}
}
Expand Down

0 comments on commit ef6037e

Please sign in to comment.