{
  "id": "data/parquet-bloom-filter-corruption",
  "signature": "Parquet bloom filter hash mismatch: unexpected hash algorithm ID 0",
  "signature_zh": "Parquet布隆过滤器哈希不匹配：意外的哈希算法ID 0",
  "regex": "bloom filter hash mismatch.*unexpected hash algorithm ID",
  "domain": "data",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Parquet file written by an older version of a library uses an unsupported or unregistered bloom filter hash algorithm, causing read failures in newer readers that strictly validate algorithm IDs.",
  "root_cause_type": "generic",
  "root_cause_zh": "由旧版本库写入的Parquet文件使用了不支持或未注册的布隆过滤器哈希算法，导致在新版读取器中因严格校验算法ID而读取失败。",
  "versions": [
    {
      "version": "Parquet 2.10+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apache Arrow 12.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "PyArrow 14.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Spark 3.5+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The hash algorithm ID is an on-disk property of the Parquet file; updating the reader library does not change the file's content.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "If the original writer is still the old library, the regenerated file will have the same unsupported algorithm ID.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This flag only disables bloom filter creation, not reading. The reader still attempts to parse existing bloom filters.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Rewrite the Parquet file using a newer version of the writer library that registers algorithm ID 0 as a known algorithm. For PyArrow: `import pyarrow.parquet as pq; table = pq.read_table('file.parquet'); pq.write_table(table, 'file_fixed.parquet')`",
      "success_rate": 0.85,
      "how": "Rewrite the Parquet file using a newer version of the writer library that registers algorithm ID 0 as a known algorithm. For PyArrow: `import pyarrow.parquet as pq; table = pq.read_table('file.parquet'); pq.write_table(table, 'file_fixed.parquet')`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use an older reader that does not validate bloom filter algorithm IDs. For Spark: downgrade to Spark 3.4 or earlier, then read and rewrite the file.",
      "success_rate": 0.7,
      "how": "Use an older reader that does not validate bloom filter algorithm IDs. For Spark: downgrade to Spark 3.4 or earlier, then read and rewrite the file.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Strip bloom filters from the Parquet file using parquet-tools: `java -jar parquet-tools-1.12.3.jar meta file.parquet | grep bloom`, then use a custom script to remove the bloom filter metadata pages.",
      "success_rate": 0.65,
      "how": "Strip bloom filters from the Parquet file using parquet-tools: `java -jar parquet-tools-1.12.3.jar meta file.parquet | grep bloom`, then use a custom script to remove the bloom filter metadata pages.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "使用更新版本的写入库重写Parquet文件，该库将算法ID 0注册为已知算法。对于PyArrow：`import pyarrow.parquet as pq; table = pq.read_table('file.parquet'); pq.write_table(table, 'file_fixed.parquet')`",
    "使用不验证布隆过滤器算法ID的旧版读取器。对于Spark：降级到Spark 3.4或更早版本，然后读取并重写文件。",
    "使用parquet-tools从Parquet文件中剥离布隆过滤器：`java -jar parquet-tools-1.12.3.jar meta file.parquet | grep bloom`，然后使用自定义脚本删除布隆过滤器元数据页面。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://parquet.apache.org/docs/file-format/bloom-filter/",
  "official_doc_section": null,
  "error_code": "ParquetBloomFilterHashMismatch",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.78,
  "resolvable": "partial",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}