{
  "id": "data/parquet-int96-timestamp-timezone",
  "signature": "Parquet INT96 timestamp reads with incorrect timezone offset when written by Hive",
  "signature_zh": "由 Hive 写入的 Parquet INT96 时间戳在读取时带有错误的时区偏移",
  "regex": "(?i)(INT96.*timestamp.*timezone|Hive.*INT96.*offset|parquet.*timestamp.*wrong timezone)",
  "domain": "data",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Hive writes INT96 timestamps in UTC but many readers (e.g., older Spark, Impala) assume local timezone, causing off-by-hour errors.",
  "root_cause_type": "generic",
  "root_cause_zh": "Hive 以 UTC 写入 INT96 时间戳，但许多读取器（如旧版 Spark、Impala）假设为本地时区，导致数小时的偏差。",
  "versions": [
    {
      "version": "Apache Hive 3.1.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apache Spark 3.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apache Impala 4.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Setting Spark session timezone to UTC",
      "why_fails": "While this aligns the reader, it does not fix the underlying assumption that INT96 is in local time; the offset is still applied incorrectly.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Converting timestamps using date_add/date_sub with fixed offset",
      "why_fails": "The offset may vary by timezone and daylight saving, making a fixed offset incorrect for many cases.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use Spark with config: spark.sql.parquet.int96TimestampConversion=true and spark.sql.session.timeZone=UTC to force correct conversion.",
      "success_rate": 0.9,
      "how": "Use Spark with config: spark.sql.parquet.int96TimestampConversion=true and spark.sql.session.timeZone=UTC to force correct conversion.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Rewrite Parquet files using a tool like Parquet-MR with Int96WriteSupport to explicitly store timestamps in UTC.",
      "success_rate": 0.85,
      "how": "Rewrite Parquet files using a tool like Parquet-MR with Int96WriteSupport to explicitly store timestamps in UTC.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use Spark with config: spark.sql.parquet.int96TimestampConversion=true and spark.sql.session.timeZone=UTC to force correct conversion.",
    "Rewrite Parquet files using a tool like Parquet-MR with Int96WriteSupport to explicitly store timestamps in UTC."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://issues.apache.org/jira/browse/SPARK-31476",
  "official_doc_section": null,
  "error_code": "No explicit error; timestamp values off by timezone offset",
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2023-09-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}