MCPcopy Create free account
hub / github.com/apache/arrow / Decode

Method Decode

cpp/src/arrow/csv/converter.cc:413–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411 parser_(*options_.timestamp_parsers[0]) {}
412
413 Status Decode(const uint8_t* data, uint32_t size, bool quoted, value_type* out) {
414 bool zone_offset_present = false;
415 if (ARROW_PREDICT_FALSE(!parser_(reinterpret_cast<const char*>(data), size, unit_,
416 out, &zone_offset_present))) {
417 return GenericConversionError(type_, data, size);
418 }
419 if (zone_offset_present != expect_timezone_) {
420 if (expect_timezone_) {
421 return Status::Invalid("CSV conversion error to ", type_->ToString(),
422 ": expected a zone offset in '",
423 std::string(reinterpret_cast<const char*>(data), size),
424 "'. If these timestamps are in local time, parse them as "
425 "timestamps without timezone, then call assume_timezone. "
426 "If using strptime, ensure '%z' is in the format string.");
427 } else {
428 return Status::Invalid("CSV conversion error to ", type_->ToString(),
429 ": expected no zone offset in '",
430 std::string(reinterpret_cast<const char*>(data), size),
431 "'");
432 }
433 }
434 return Status::OK();
435 }
436
437 protected:
438 TimeUnit::type unit_;

Callers

nothing calls this directly

Calls 4

GenericConversionErrorFunction · 0.70
InvalidFunction · 0.50
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected