Skip to content

Commit

Permalink
using make_valid_time_unit()
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Sep 27, 2019
1 parent 4055f67 commit 1166264
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions r/R/parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ ParquetArrowWriterProperties_Builder <- R6Class("ParquetArrowWriterProperties_Bu
},
set_coerce_timestamps = function(coerce_timestamps = NULL) {
if (!is.null(coerce_timestamps)) {
if (coerce_timestamps == "ms") {
parquet___ArrowWriterProperties___Builder__coerce_timestamps(TimeUnit$MILLI)
} else if (coerce_timestamps == "us") {
parquet___ArrowWriterProperties___Builder__coerce_timestamps(TimeUnit$MICRO)
} else {
abort("Invalid value for coerce_timestamps")
}
unit <- make_valid_time_unit(coerce_timestamps,
c("ms" = TimeUnit$MILLI, "us" = TimeUnit$MICRO)
)
parquet___ArrowWriterProperties___Builder__coerce_timestamps(unit)
}
self
},
Expand Down

0 comments on commit 1166264

Please sign in to comment.