You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ben Hollis (Jira)" <ji...@apache.org> on 2026/07/23 21:07:00 UTC
[jira] [Created] (SPARK-58300) Add from_protobuf option to keep Timestamp/Duration as struct
Ben Hollis created SPARK-58300:
----------------------------------
Summary: Add from_protobuf option to keep Timestamp/Duration as struct<seconds, nanos>
Key: SPARK-58300
URL: https://issues.apache.org/jira/browse/SPARK-58300
Project: Spark
Issue Type: Improvement
Components: Protobuf
Affects Versions: 4.3.0
Reporter: Ben Hollis
`from_protobuf` always maps `google.protobuf.Timestamp` -> `TimestampType` and `google.protobuf.Duration` -> `DayTimeIntervalType`. This is Spark's well-known-type conversion and there is currently no way to turn it off.
This adds a `from_protobuf` reader option `convert.timestamp.duration.to.native` (default `true`, preserving today's behavior). When set to `false`, both well-known types fall through to the generic message path and deserialize as their raw proto shape `struct<seconds: bigint, nanos: int>`.
Motivation: a consumer whose downstream schema was defined against the \{seconds, nanos} struct representation (e.g. a table populated by a different decode path) and must stay stable, or that needs the exact seconds/nanos rather than a microsecond-truncated interval/timestamp.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org