Skip to content

Commit

Permalink
fix compilation of SerializeToBinaryJson on macos (ydb-platform#10783)
Browse files Browse the repository at this point in the history
  • Loading branch information
swalrus1 authored and zverevgeny committed Jan 5, 2025
1 parent ee80d28 commit 2d1b60a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ydb/core/formats/arrow/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ static arrow::Status ConvertColumn(const NScheme::TTypeInfo colType, std::shared
} else {
const auto binaryJson = NBinaryJson::SerializeToBinaryJson(valueBuf);
if (binaryJson.IsFail()) {
return arrow::Status::SerializationError(
"Cannot serialize json (", binaryJson.GetErrorMessage(), "): ", valueBuf.SubStr(0, Min(valueBuf.Size(), 1024ul)));
return arrow::Status::SerializationError("Cannot serialize json (", binaryJson.GetErrorMessage(),
"): ", valueBuf.SubStr(0, Min(valueBuf.Size(), size_t{1024})));
}
auto appendResult = builder.Append(binaryJson->Data(), binaryJson->Size());
if (!appendResult.ok()) {
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/ydb_convert/ydb_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ Y_FORCE_INLINE void ConvertData(NUdf::TDataTypeId typeId, const Ydb::Value& valu
CheckTypeId(value.value_case(), Ydb::Value::kTextValue, "JsonDocument");
const auto binaryJson = NBinaryJson::SerializeToBinaryJson(value.text_value());
if (binaryJson.IsFail()) {
throw yexception() << "Invalid JsonDocument value";
throw yexception() << "Invalid JsonDocument value: " << binaryJson.GetErrorMessage();
}
res.SetBytes(binaryJson->Data(), binaryJson->Size());
break;
Expand Down Expand Up @@ -1218,7 +1218,7 @@ bool CellFromProtoVal(NScheme::TTypeInfo type, i32 typmod, const Ydb::Value* vp,
case NScheme::NTypeIds::JsonDocument : {
const auto binaryJson = NBinaryJson::SerializeToBinaryJson(val.Gettext_value());
if (binaryJson.IsFail()) {
err = "Invalid JSON for JsonDocument provided";
err = "Invalid JSON for JsonDocument provided: " + binaryJson.GetErrorMessage();
return false;
}
const auto binaryJsonInPool = valueDataPool.AppendString(TStringBuf(binaryJson->Data(), binaryJson->Size()));
Expand Down
16 changes: 8 additions & 8 deletions ydb/library/binary_json/write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,25 +571,25 @@ template <typename TOnDemandValue>
}
case simdjson::ondemand::json_type::number: {
switch (value.get_number_type()) {
case simdjson::fallback::number_type::floating_point_number: {
case simdjson::builtin::number_type::floating_point_number: {
double v;
RETURN_IF_NOT_SUCCESS(value.get(v));
callbacks.OnDouble(v);
break;
}
case simdjson::fallback::number_type::signed_integer: {
i64 v;
case simdjson::builtin::number_type::signed_integer: {
int64_t v;
RETURN_IF_NOT_SUCCESS(value.get(v));
callbacks.OnInteger(v);
break;
}
case simdjson::fallback::number_type::unsigned_integer: {
ui64 v;
case simdjson::builtin::number_type::unsigned_integer: {
uint64_t v;
RETURN_IF_NOT_SUCCESS(value.get(v));
callbacks.OnUInteger(v);
break;
}
case simdjson::fallback::number_type::big_integer:
case simdjson::builtin::number_type::big_integer:
double v;
RETURN_IF_NOT_SUCCESS(value.get(v));
callbacks.OnDouble(v);
Expand Down Expand Up @@ -664,13 +664,13 @@ template <typename TOnDemandValue>
break;
}
case simdjson::dom::element_type::INT64: {
i64 v;
int64_t v;
RETURN_IF_NOT_SUCCESS(value.get(v));
callbacks.OnInteger(v);
break;
}
case simdjson::dom::element_type::UINT64: {
ui64 v;
uint64_t v;
RETURN_IF_NOT_SUCCESS(value.get(v));
callbacks.OnUInteger(v);
break;
Expand Down
4 changes: 4 additions & 0 deletions ydb/library/binary_json/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ SRCS(

GENERATE_ENUM_SERIALIZATION(format.h)

CFLAGS(
-Wno-assume
)

END()

RECURSE_FOR_TESTS(
Expand Down

0 comments on commit 2d1b60a

Please sign in to comment.