File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 2424#include < cstdint>
2525#include < string>
2626
27+ #include < nlohmann/json.hpp>
28+
2729#include " iceberg/util/checked_cast.h"
2830#include " iceberg/util/conversions.h"
2931#include " iceberg/util/macros.h"
@@ -488,7 +490,8 @@ std::string Literal::ToString() const {
488490 .value_or (" invalid literal of type decimal" );
489491 }
490492 case TypeId::kString : {
491- return " \" " + std::get<std::string>(value_) + " \" " ;
493+ nlohmann::json json = std::get<std::string>(value_);
494+ return json.dump ();
492495 }
493496 case TypeId::kUuid : {
494497 return std::get<Uuid>(value_).ToString ();
Original file line number Diff line number Diff line change @@ -546,9 +546,9 @@ INSTANTIATE_TEST_SUITE_P(
546546 .expected_type_id = TypeId::kDecimal ,
547547 .expected_string = " 0" },
548548 BasicLiteralTestParam{.test_name = " String" ,
549- .literal = Literal::String (" hello world" ),
549+ .literal = Literal::String (" hello \" world" ),
550550 .expected_type_id = TypeId::kString ,
551- .expected_string = " \" hello world\" " },
551+ .expected_string = " \" hello \\\" world\" " },
552552 BasicLiteralTestParam{
553553 .test_name = " Uuid" ,
554554 .literal = Literal::UUID (
You can’t perform that action at this time.
0 commit comments