You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jungtaek Lim (Jira)" <ji...@apache.org> on 2026/10/01 04:11:00 UTC
[jira] [Resolved] (SPARK-58300) Add from_protobuf option to keep Timestamp/Duration as struct
[ https://issues.apache.org/jira/browse/SPARK-58300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jungtaek Lim resolved SPARK-58300.
----------------------------------
Fix Version/s: 4.4.0
Resolution: Fixed
Issue resolved by pull request 57474
[https://github.com/apache/spark/pull/57474]
> 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
> Assignee: Ben Hollis
> Priority: Minor
> Labels: pull-request-available
> Fix For: 4.4.0
>
>
> `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