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

Method Decode

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

Source from the content-addressed store, hash-verified

371 }
372
373 Status Decode(const uint8_t* data, uint32_t size, bool quoted, value_type* out) {
374 bool zone_offset_present = false;
375 if (ARROW_PREDICT_FALSE(
376 !internal::ParseTimestampISO8601(reinterpret_cast<const char*>(data), size,
377 unit_, out, &zone_offset_present))) {
378 return GenericConversionError(type_, data, size);
379 }
380 if (zone_offset_present != expect_timezone_) {
381 if (expect_timezone_) {
382 return Status::Invalid("CSV conversion error to ", type_->ToString(),
383 ": expected a zone offset in '",
384 std::string(reinterpret_cast<const char*>(data), size),
385 "'. If these timestamps are in local time, parse them as "
386 "timestamps without timezone, then call assume_timezone.");
387 } else {
388 return Status::Invalid("CSV conversion error to ", type_->ToString(),
389 ": expected no zone offset in '",
390 std::string(reinterpret_cast<const char*>(data), size),
391 "'");
392 }
393 }
394 return Status::OK();
395 }
396
397 protected:
398 TimeUnit::type unit_;

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected