Document parquet ArrowWriter type limitations#5875
Merged
alamb merged 2 commits intoapache:masterfrom Jun 15, 2024
Merged
Conversation
Contributor
Author
|
cc @xinlifoobar |
tustvold
approved these changes
Jun 14, 2024
tustvold
reviewed
Jun 14, 2024
| /// The following are not supported: | ||
| /// | ||
| /// * [`IntervalMonthDayNanoArray`]: Parquet does not [support nanosecond intervals]. | ||
| /// |
Contributor
There was a problem hiding this comment.
Date64 is also not supported IIRC
Contributor
Author
There was a problem hiding this comment.
I double checked and it seems like Date64 can be written:
andrewlamb@Andrews-MacBook-Pro-2:~/Software/arrow-rs$ datafusion-cli -c 'select c1, arrow_typeof(c1) from "/tmp/test.parquet"'
DataFusion CLI v39.0.0
+---------------------+------------------------------------+
| c1 | arrow_typeof(/tmp/test.parquet.c1) |
+---------------------+------------------------------------+
| 1970-01-01T00:00:00 | Date64 |
| 1970-01-01T00:00:00 | Date64 |
+---------------------+------------------------------------+
2 row(s) fetched.
Elapsed 0.005 seconds.fn main() {
let input_array = Date64Array::from(vec![123, 456]);
let batch = RecordBatch::try_from_iter(
vec![("c1", Arc::new(input_array) as _)]
).unwrap();
println!("Input array: {}", pretty_format_batches(&[batch.clone()]).unwrap());
if let Err(e) = std::fs::remove_file("/tmp/test.parquet") {
println!("can't remove file: {e:?}");
}
// round trip to parquet
let f = File::create_new("/tmp/test.parquet").unwrap();
let schema = batch.schema();
let props = None;
let mut writer = ArrowWriter::try_new(f, schema, props).unwrap();
writer.write(&batch).unwrap();
writer.flush().unwrap();
writer.close();
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #5849
Closes #5868
Rationale for this change
It was not clear that the parquet writer is not able to write IntervalMonthDayNano data rather than it was not yet implemented
What changes are included in this PR?
Add documentiation explaining type support to
ArrowWriterAre there any user-facing changes?
Docs only