Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compilation of SerializeToBinaryJson on macos #10783

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -513,7 +513,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 @@ -1239,7 +1239,7 @@ bool CellFromProtoVal(const NScheme::TTypeInfo& type, i32 typmod, const Ydb::Val
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: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fallback -- конкретная имплементация парсера

builtin -- имплементация парсера, выбранная при компиляции

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 @@ -662,13 +662,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;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ui64 -- unsigned long на windows, из-за чего компиляция value.get(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(
Copy link
Collaborator Author

@swalrus1 swalrus1 Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Игнорирование warning'а, чтобы сборка хедеров simdjson не падала на windows

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Правильно ли понял, что здесь это были варнинги внешней библиотеки simdjson?

Copy link
Collaborator Author

@swalrus1 swalrus1 Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, вот они в логах сборки: https://nda.ya.ru/t/HW0alCdi79HxbP

-Wno-assume
)

END()

RECURSE_FOR_TESTS(
Expand Down
Loading