apache / apache/arrow

[C++] TaggedRecordBatch does not implement operator==

Open
#37,556 0 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

I am a novice in Apache Arrow, and I'm not sure if this is a best practice.

When I tried to compile the demo code, compiler returned an error message:

```
'/usr/local/include/arrow/result.h:276:50: error: no match for 'operator==' (operand types are 'const arrow::dataset::TaggedRecordBatch' and 'const arrow::dataset::TaggedRecordBatch').
```

```demo.cc
#include
#include

#include
#include
#include

namespace ds = arrow::dataset;
namespace fs = arrow::fs;

void scan_dataset(
const std::shared_ptr &filesystem,
const std::shared_ptr &format,
const std::string &base_dir)
{
fs::FileSelector selector;
selector.base_dir = base_dir;
auto factory = ds::FileSystemDatasetFactory::Make(filesystem, selector, format, ds::FileSystemFactoryOptions())
.ValueOrDie();
auto dataset = factory->Finish().ValueOrDie();
auto sb = dataset->NewScan().ValueOrDie();
auto sc = sb->Finish().ValueOrDie();
auto batches = sc->ScanBatches();

// error message is caused by below codes
for(auto batch = batches->begin(); batch != batches->end(); ++batch) {

}
}

int main(int argc, char **argv)
{
auto filesystem = std::make_shared();
auto format = std::make_shared();
const std::string base_dir = "/path/to/dataset/base";

scan_dataset(filesystem, format, base_dir);
}
```

It looks like TaggedRecordBatch hasn't implemented the overload for the operator== method. Should I add an implementation, or am I not supposed to use TaggedRecordBatchIterator this way?

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.