forked from ydb-platform/ydb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add WriteNanAsString option in Yson::SerializeJson (ydb-platform#1871)
- Loading branch information
kinash-varvara
authored
Feb 18, 2024
1 parent
b92e8dc
commit a04d89b
Showing
7 changed files
with
105 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
ydb/library/yql/udfs/common/yson2/test/canondata/test.test_JsonWithNanAsString_/results.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[ | ||
{ | ||
"Write" = [ | ||
{ | ||
"Type" = [ | ||
"ListType"; | ||
[ | ||
"StructType"; | ||
[ | ||
[ | ||
"column0"; | ||
[ | ||
"OptionalType"; | ||
[ | ||
"DataType"; | ||
"Json" | ||
] | ||
] | ||
]; | ||
[ | ||
"column1"; | ||
[ | ||
"OptionalType"; | ||
[ | ||
"DataType"; | ||
"Json" | ||
] | ||
] | ||
]; | ||
[ | ||
"column2"; | ||
[ | ||
"OptionalType"; | ||
[ | ||
"DataType"; | ||
"Json" | ||
] | ||
] | ||
] | ||
] | ||
] | ||
]; | ||
"Data" = [ | ||
[ | ||
[ | ||
"\"nan\"" | ||
]; | ||
[ | ||
"\"inf\"" | ||
]; | ||
[ | ||
"\"-inf\"" | ||
] | ||
] | ||
] | ||
} | ||
] | ||
} | ||
] |
8 changes: 8 additions & 0 deletions
8
ydb/library/yql/udfs/common/yson2/test/cases/JsonWithNanAsString.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
$src = Yson::From(0./0.); -- nan | ||
$src1 = Yson::From(1./0.); -- inf | ||
$src2 = Yson::From(-1./0.); -- -inf | ||
|
||
SELECT | ||
Yson::SerializeJson($src, true AS WriteNanAsString), | ||
Yson::SerializeJson($src1, true AS WriteNanAsString), | ||
Yson::SerializeJson($src2, true AS WriteNanAsString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters