ShaiviAgarwal2 commented on issue #39275:
URL: https://github.com/apache/arrow/issues/39275#issuecomment-1882751040
@thisisnic
According to my understanding, if the `schema` is present, we should use it
to write the parquet file. If it's not present, we'll use the default data type
conversion.
Below is the code that I tried to write which shows the same thing. The code
contains `arrow` package which provides the functionality for working with
Parquet files
```r
library(arrow)
write_parquet <- function(data, file, schema = NULL) {
# Check if schema argument is provided
if (!is.null(schema)) {
# Use the provided schema for writing the parquet file
data <- arrow::Table$create(data, schema = schema)
arrow::write_parquet(data, file)
} else {
# Use the default data type conversion for writing the parquet file
arrow::write_parquet(data, file)
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]