<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=INT96_timestamp</id>
	<title>INT96 timestamp - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://openlakehouse.io/w/index.php?action=history&amp;feed=atom&amp;title=INT96_timestamp"/>
	<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=INT96_timestamp&amp;action=history"/>
	<updated>2026-12-06T00:07:59Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://openlakehouse.io/w/index.php?title=INT96_timestamp&amp;diff=96&amp;oldid=prev</id>
		<title>Open Lakehouse Wiki sync: Sync from open-lakehouse/wiki@f2492a3</title>
		<link rel="alternate" type="text/html" href="https://openlakehouse.io/w/index.php?title=INT96_timestamp&amp;diff=96&amp;oldid=prev"/>
		<updated>2026-11-23T00:34:51Z</updated>

		<summary type="html">&lt;p&gt;Sync from open-lakehouse/wiki@f2492a3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox concept&lt;br /&gt;
| name            = INT96 timestamp&lt;br /&gt;
| also_known_as   = INT96; Impala timestamp&lt;br /&gt;
| field           = Data storage formats&lt;br /&gt;
| introduced      = Physical type in [[Apache Parquet]]; written for timestamps by Impala, Hive and Spark&lt;br /&gt;
| key_parts       = 12 bytes: nanoseconds within the day (8 bytes) and a Julian day number (4 bytes)&lt;br /&gt;
| implementations = [[Apache Parquet]], [[Apache Spark]], [[Apache Iceberg]] (read only)&lt;br /&gt;
| related         = [[Logical type]], [[Apache Parquet]], [[Apache Hive]]&lt;br /&gt;
}}&lt;br /&gt;
{{Verified|2026-11-22|parquet.thrift at parquet-format tags 2.4.0, 2.5.0, 2.12.0 and 2.14.0, the parquet-format 2.5.0 changelog, PARQUET-323 and PARQUET-1065, Apache Spark SQLConf.scala at v3.1.1, v3.5.0, v4.0.0 and v4.3.0, ParquetSchemaConverter.scala and DateTimeUtils.scala at v4.3.0, the Spark 3.5 to 4.0 SQL migration guide, SPARK-46440 and SPARK-46447, and the Apache Iceberg spec at apache-iceberg-1.12.0}}&lt;br /&gt;
{{Status|deprecated |since=parquet-format 2.5.0 |replacement=an &amp;lt;code&amp;gt;INT64&amp;lt;/code&amp;gt; column with the Parquet &amp;lt;code&amp;gt;TIMESTAMP&amp;lt;/code&amp;gt; [[Logical type|logical type]] |note=Apache Spark 4.3.0 still writes timestamps as INT96 by default. |ref=&amp;lt;ref name=&amp;quot;pq323&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/PARQUET-323 |title=PARQUET-323: INT96 should be marked as deprecated |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
An &amp;#039;&amp;#039;&amp;#039;INT96 timestamp&amp;#039;&amp;#039;&amp;#039; is a timestamp stored in the 12-byte &amp;lt;code&amp;gt;INT96&amp;lt;/code&amp;gt; physical type of [[Apache Parquet]]: 8 bytes of nanoseconds within the day followed by 4 bytes of day number.&amp;lt;ref name=&amp;quot;thrift&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/parquet-format/blob/apache-parquet-format-2.14.0/src/main/thrift/parquet.thrift |title=parquet.thrift (parquet-format 2.14.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; The encoding was introduced for nanosecond timestamps in Impala, and [[Apache Spark]] originally used the same timestamp type as Impala and Hive.&amp;lt;ref name=&amp;quot;sparkconv&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala |title=ParquetSchemaConverter.scala (Apache Spark v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; INT96 carries no [[logical type]] annotation, so a reader has to know the convention to treat it as a timestamp. The Parquet format has marked INT96 as deprecated since parquet-format 2.5.0, but the type is still common because Spark writes it by default.&amp;lt;ref name=&amp;quot;pq323&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;conf&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala |title=SQLConf.scala (Apache Spark v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Status ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Parquet format.&amp;#039;&amp;#039;&amp;#039; PARQUET-323, &amp;quot;INT96 should be marked as deprecated&amp;quot;, was fixed in parquet-format 2.5.0, together with PARQUET-1065, which deprecated type-defined sort ordering for INT96 statistics.&amp;lt;ref name=&amp;quot;pq323&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;changes&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/parquet-format/blob/apache-parquet-format-2.5.0/CHANGES.md |title=CHANGES.md (parquet-format 2.5.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; In &amp;lt;code&amp;gt;parquet.thrift&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;INT96&amp;lt;/code&amp;gt; entry has no comment at 2.4.0, is commented &amp;quot;deprecated, only used by legacy implementations&amp;quot; from 2.5.0, and since 2.12.0 reads &amp;quot;deprecated, new Parquet writers should not write data in INT96&amp;quot;.&amp;lt;ref name=&amp;quot;thrift240&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/parquet-format/blob/apache-parquet-format-2.4.0/src/main/thrift/parquet.thrift |title=parquet.thrift (parquet-format 2.4.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;thrift250&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/parquet-format/blob/apache-parquet-format-2.5.0/src/main/thrift/parquet.thrift |title=parquet.thrift (parquet-format 2.5.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;thrift2120&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/parquet-format/blob/apache-parquet-format-2.12.0/src/main/thrift/parquet.thrift |title=parquet.thrift (parquet-format 2.12.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; The type has not been removed: parquet-format 2.14.0 added an &amp;lt;code&amp;gt;INT96_TIMESTAMP_ORDER&amp;lt;/code&amp;gt; column order, which tells readers that INT96 statistics are ordered chronologically, and the thrift file notes that INT96 is still used in many legacy systems.&amp;lt;ref name=&amp;quot;thrift&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Apache Spark.&amp;#039;&amp;#039;&amp;#039; Spark has not deprecated writing INT96. In Spark 4.3.0, &amp;lt;code&amp;gt;spark.sql.parquet.outputTimestampType&amp;lt;/code&amp;gt; still defaults to &amp;lt;code&amp;gt;INT96&amp;lt;/code&amp;gt;, as it has since the setting was added in Spark 2.3.0.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt; A comment in Spark&amp;#039;s Parquet schema converter says that &amp;lt;code&amp;gt;TIMESTAMP_MICROS&amp;lt;/code&amp;gt; is recommended but INT96 stays the default to keep earlier behaviour.&amp;lt;ref name=&amp;quot;sparkconv&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
An INT96 value is 12 bytes. The thrift definition describes the legacy ordering rule: the last 4 bytes are the day as a little-endian 32-bit signed integer, and the first 8 bytes are nanoseconds as a little-endian 64-bit signed integer.&amp;lt;ref name=&amp;quot;thrift&amp;quot; /&amp;gt; Spark interprets the day as a Julian day number and converts the value to microseconds since the Unix epoch, dividing the nanoseconds by 1,000, so sub-microsecond precision is lost on read.&amp;lt;ref name=&amp;quot;dtu&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.3.0/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala |title=DateTimeUtils.scala (Apache Spark v4.3.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the type has no logical type, nothing in the file says whether a value is UTC-normalized or local time. Spark&amp;#039;s &amp;lt;code&amp;gt;spark.sql.parquet.int96TimestampConversion&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;) applies a time zone adjustment for INT96 data written by Impala, which the setting&amp;#039;s documentation says uses a different offset than Hive and Spark.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt; Spark reads INT96 as a timestamp only while &amp;lt;code&amp;gt;spark.sql.parquet.int96AsTimestamp&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, the default; otherwise it rejects the column.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&amp;lt;ref name=&amp;quot;sparkconv&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Calendar rebasing in Spark ==&lt;br /&gt;
Spark 3.0 moved from the hybrid Julian and Gregorian calendar to the Proleptic Gregorian calendar, which changes the meaning of very old dates and timestamps.&amp;lt;ref name=&amp;quot;mig30&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v3.0.0/docs/sql-migration-guide.md |title=Spark SQL Migration Guide (docs/sql-migration-guide.md at v3.0.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt; Spark 3.1 added &amp;lt;code&amp;gt;spark.sql.legacy.parquet.int96RebaseModeInRead&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;InWrite&amp;lt;/code&amp;gt;, defaulting to &amp;lt;code&amp;gt;EXCEPTION&amp;lt;/code&amp;gt;, so that reading or writing INT96 timestamps before 1900-01-01 failed instead of silently shifting.&amp;lt;ref name=&amp;quot;conf311&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v3.1.1/sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala |title=SQLConf.scala (Apache Spark v3.1.1) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;mig40&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/spark/blob/v4.0.0/docs/sql-migration-guide.md |title=Spark SQL Migration Guide (docs/sql-migration-guide.md at v4.0.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Spark 4.0.0 changed the defaults of these rebase settings to &amp;lt;code&amp;gt;CORRECTED&amp;lt;/code&amp;gt;, which reads and writes values as they are (SPARK-46440), and removed the &amp;lt;code&amp;gt;spark.sql.legacy&amp;lt;/code&amp;gt; names in favour of &amp;lt;code&amp;gt;spark.sql.parquet.int96RebaseModeInRead&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;spark.sql.parquet.int96RebaseModeInWrite&amp;lt;/code&amp;gt; (SPARK-46447).&amp;lt;ref name=&amp;quot;s46440&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-46440 |title=SPARK-46440: Set the rebase configs to the CORRECTED mode by default |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;s46447&amp;quot;&amp;gt;{{Cite web |url=https://issues.apache.org/jira/browse/SPARK-46447 |title=SPARK-46447: Remove the legacy datetime rebasing SQL configs |publisher=Apache Software Foundation JIRA |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;mig40&amp;quot; /&amp;gt; Both settings are internal in Spark 4.3.0 and default to &amp;lt;code&amp;gt;CORRECTED&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== INT96 compared with standard Parquet timestamps ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! INT96 timestamp !! INT64 with TIMESTAMP logical type&lt;br /&gt;
|-&lt;br /&gt;
! Status in Parquet&lt;br /&gt;
| Deprecated since parquet-format 2.5.0&amp;lt;ref name=&amp;quot;pq323&amp;quot; /&amp;gt;&lt;br /&gt;
| Current&lt;br /&gt;
|-&lt;br /&gt;
! Size&lt;br /&gt;
| 12 bytes&lt;br /&gt;
| 8 bytes&lt;br /&gt;
|-&lt;br /&gt;
! Precision&lt;br /&gt;
| Nanoseconds in storage; Spark keeps microseconds&amp;lt;ref name=&amp;quot;dtu&amp;quot; /&amp;gt;&lt;br /&gt;
| Unit stated in the annotation: &amp;lt;code&amp;gt;MILLIS&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;MICROS&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;NANOS&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;lt&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/parquet-format/blob/apache-parquet-format-2.14.0/LogicalTypes.md |title=Parquet Logical Type Definitions (LogicalTypes.md, parquet-format 2.14.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! UTC or local time&lt;br /&gt;
| Not recorded in the file&lt;br /&gt;
| Recorded by &amp;lt;code&amp;gt;isAdjustedToUTC&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;lt&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Spark write setting&lt;br /&gt;
| &amp;lt;code&amp;gt;spark.sql.parquet.outputTimestampType=INT96&amp;lt;/code&amp;gt; (default)&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
| &amp;lt;code&amp;gt;TIMESTAMP_MICROS&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;TIMESTAMP_MILLIS&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! Apache Iceberg&lt;br /&gt;
| Not used in the spec&amp;#039;s Parquet type mapping; readable in imported data files&amp;lt;ref name=&amp;quot;icespec&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/iceberg/blob/apache-iceberg-1.12.0/format/spec.md |title=Iceberg Table Spec (format/spec.md at apache-iceberg-1.12.0) |publisher=Apache Software Foundation |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&amp;lt;ref name=&amp;quot;ice6962&amp;quot;&amp;gt;{{Cite web |url=https://github.com/apache/iceberg/pull/6962 |title=Arrow: Support vectorized read of INT96 timestamp in imported data (#6962) |publisher=GitHub, apache/iceberg |access-date=2026-11-22}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
| The spec&amp;#039;s mapping for &amp;lt;code&amp;gt;timestamp&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;timestamptz&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;icespec&amp;quot; /&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
In Spark, setting the output type before writing produces standard &amp;lt;code&amp;gt;INT64&amp;lt;/code&amp;gt; timestamps instead of INT96:&amp;lt;ref name=&amp;quot;conf&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
spark.conf.set(&amp;quot;spark.sql.parquet.outputTimestampType&amp;quot;, &amp;quot;TIMESTAMP_MICROS&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
df = spark.sql(&amp;quot;SELECT TIMESTAMP &amp;#039;2026-11-22 10:00:00&amp;#039; AS ts&amp;quot;)&lt;br /&gt;
df.write.mode(&amp;quot;overwrite&amp;quot;).parquet(&amp;quot;/tmp/ts_micros&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The setting changes only new files. Files already written with INT96 keep that encoding until they are rewritten.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Logical type]]&lt;br /&gt;
* [[Apache Parquet]]&lt;br /&gt;
* [[Apache Spark]]&lt;br /&gt;
* [[Apache Iceberg]]&lt;br /&gt;
* [[Apache Hive]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Navbox open lakehouse}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Concepts]]&lt;br /&gt;
[[Category:Glossary terms]]&lt;br /&gt;
[[Category:Apache Spark]]&lt;/div&gt;</summary>
		<author><name>Open Lakehouse Wiki sync</name></author>
	</entry>
</feed>