读取包含数据类型为 arrow::large_utf8() 的列的羽毛文件时出现分段错误

问题描述

我已经编写了 C++ 代码来读取羽毛文件并将数据插入到一个箭头::表中,但是如果文件包含任何数据类型为箭头::large_utf8 的列,则会出现分段错误。它仅针对此数据类型给出段错误,utf8/int/float 数据类型没有错误

我认为用于读/写的羽毛 API 实现有问题,因为如果我对镶木地板文件执行相同操作,它就可以正常工作。

我发现了一个与同一问题密切相关的链接,但它与 python - https://github.com/pandas-dev/pandas/issues/24767

有没有人知道为什么会有这种行为?

arrow::Status write_to_feather(std::string path,std::shared_ptr <arrow::Table> table) {
  arrow::fs::LocalFileSystem file_system;
  auto output = file_system.OpenOutputStream(path).ValueOrDie();
  ABORT_ON_FAILURE(arrow::ipc::feather::WriteTable(*table,output.get()));
  return arrow::Status::OK();
}

void read_feather_to_table(std::string path,std::shared_ptr<arrow::Table> *feather_table){
    arrow::fs::LocalFileSystem file_system;
    std::shared_ptr <arrow::io::RandomAccessFile> input_file = file_system.OpenInputFile(path).ValueOrDie();
    std::shared_ptr <arrow::ipc::feather::Reader> feather_reader = arrow::ipc::feather::Reader::Open(input_file).ValueOrDie();
    arrow::Status temp_status = feather_reader -> Read(feather_table);
    if(temp_status.ok()){
        std::cout << "Read feather file Successfully." << std::endl;
        std::cout << ((*feather_table).get()) -> ToString() << std::endl; // this line gives segfault
    }
    else{
        std::cout << "Feather file reading process Failed." << std::endl;
    }
    return;
}

当我使用 write_to_feather 编写一个包含 large_utf8 数据类型的任何列的表时,我的 read_feather_to_table 函数给出了段错误,而在所有其他情况下,这两个函数都可以正常工作。当我尝试打印上面代码中指定的表格内容时,会发生段错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...