Skip to content

Commit

Permalink
KIKIMR-19712: fix validation and add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov committed Oct 14, 2023
1 parent 3e77d96 commit 500a0e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ydb/core/formats/arrow/reader/read_filter_merger.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ class TSortableScanData {
TSortableScanData() = default;
TSortableScanData(std::shared_ptr<arrow::RecordBatch> batch, const std::vector<std::string>& columns);

bool IsSameSchema(const std::shared_ptr<arrow::Schema> schema) const {
bool IsSameSchema(const std::shared_ptr<arrow::Schema>& schema) const {
if (Fields.size() != (size_t)schema->num_fields()) {
return false;
}
for (ui32 i = 0; i < Fields.size(); ++i) {
if (Fields[i]->type() != schema->field(i)->type()) {
if (!Fields[i]->type()->Equals(schema->field(i)->type())) {
return false;
}
if (Fields[i]->name() != schema->field(i)->name()) {
Expand All @@ -37,6 +37,10 @@ class TSortableScanData {

NJson::TJsonValue DebugJson(const i32 position) const {
NJson::TJsonValue result = NJson::JSON_MAP;
auto& jsonFields = result.InsertValue("fields", NJson::JSON_ARRAY);
for (auto&& i : Fields) {
jsonFields.AppendValue(i->ToString());
}
for (ui32 i = 0; i < Columns.size(); ++i) {
auto& jsonColumn = result["sorting_columns"].AppendValue(NJson::JSON_MAP);
jsonColumn["name"] = Fields[i]->name();
Expand Down

0 comments on commit 500a0e1

Please sign in to comment.