apache / apache/arrow-java

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

Offen
#64 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Type: usage
Vorherrschende Sprache
Java
Sterne
94
Forks
152
Ø Merge
3 T. 16 Std.
Gemergte PRs (30 T.)
11

Beschreibung

### 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit Java DatasetFileWriter::write und dem JNI-Aufruf zu writeFromScannerToFile und untersuche anschließend C++ FileSystemDatasetWriteOptions::basename_template. Ermittle, ob ein nicht partitionierter Schreibvorgang einen exakten Dateinamen ohne {i} akzeptieren kann; abgeschlossen ist die Aufgabe, wenn das unterstützte Verhalten festgestellt ist und der Java/C++-Pfad diesen Fall behandelt oder eindeutig dokumentiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, java
Bereich
data-engineering
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.