apache / apache/arrow-java

[C++][Java] When i use DatasetFileWriter::write method write a file, I can't specify a file name

未关闭
#64 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Type: usage
主要语言
Java
星标
94
派生
152
平均合并
3 天 16 小时
30 天内合并 PR
11

描述

### Describe the usage question you have. Please include as many useful details as possible.

I use this static method to write a parquet file into fs, I give empty partition array, so it will be in a file; and i give the `baseNameTemplate` arg is "test.parquet" to specify the filename, but it leads to an error: `basename_template did not contain '{i}'`.
```java
public static void write(BufferAllocator allocator, ArrowReader reader, FileFormat format, String uri,
String[] partitionColumns, int maxPartitions, String baseNameTemplate) {
try (final ArrowArrayStream stream = ArrowArrayStream.allocateNew(allocator)) {
Data.exportArrayStream(allocator, reader, stream);
JniWrapper.get().writeFromScannerToFile(stream.memoryAddress(),
format.id(), uri, partitionColumns, maxPartitions, baseNameTemplate);
}
}
```
read the cpp jni code and cpp dataset's code, the FileSystemDatasetWriteOptions::basename_template seems not supported to specify the file name without `{i}`.
```cpp
/// \brief Options for writing a dataset.
struct ARROW_DS_EXPORT FileSystemDatasetWriteOptions {
.
.
.
/// Template string used to generate fragment basenames.
/// {i} will be replaced by an auto incremented integer.
std::string basename_template;
.
.
.
}
```
If there is any method to specify the filename when none partition?

### Component(s)

Java

贡献指南

打开贡献指南

调研方向

从 Java DatasetFileWriter::write 和对 writeFromScannerToFile 的 JNI 调用开始,然后检查 C++ FileSystemDatasetWriteOptions::basename_template。确定非分区写入是否可以接受不带 {i} 的确切文件名;当已确定受支持的行为,并且 Java/C++ 路径能够处理该情况或对其进行明确文档说明时,即为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, java
领域
data-engineering
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。