Skip to content

Commit

Permalink
Merge pull request #2446 from kuzudb/cast-fixed-list-to-list
Browse files Browse the repository at this point in the history
finish cast list <-> fixedlist
  • Loading branch information
AEsir777 committed Nov 20, 2023
2 parents 8f9f38e + 0d0b31e commit b7874af
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 14 deletions.
8 changes: 8 additions & 0 deletions dataset/load-from-test/struct/struct_with_fixed_list.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"{a: 2341, b: {[NULL, [NULL, [1], [2], [3], NULL, [4]], [[8], NULL, [7]], NULL, [NULL, [5]], [[6], NULL], NULL]=true}}"
"{a: 1999, b: {[[[1], [2], [3]]]=true}}"
"{a: 1999, b: {[NULL]=true}}"
"{a: 1999, b: {[[NULL]]=true}}"
"{a: -1, b: {[[[1, 2, 3], [4, 5, 6]]]=false}}"
"{a: -1, b: {[[[NULL]]]=false}}"
"{a: -1, b: {[[[9, 9]]]=false}}"
"{a: -1, b: {[[[4, NULL]]]=false}}"
2 changes: 1 addition & 1 deletion src/function/cast_from_string_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ struct SplitStringFixedListOperation {
T value;
auto str = std::string_view{start, (uint32_t)(end - start)};
if (str.empty() || isNull(str)) {
throw ConversionException("Cast failed. NULL is not allowed for FIXEDLIST.");
throw ConversionException("Cast failed. NULL is not allowed for FIXED_LIST.");
}
CastStringHelper::cast(start, str.length(), value);
resultVector->setValue(offset, value);
Expand Down
Loading

0 comments on commit b7874af

Please sign in to comment.