You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "XiDuo You (Jira)" <ji...@apache.org> on 2026/09/02 07:20:00 UTC
[jira] [Created] (SPARK-59168) Avoid NoSuchElementException on missing keys in KVStore reads and writes
XiDuo You created SPARK-59168:
---------------------------------
Summary: Avoid NoSuchElementException on missing keys in KVStore reads and writes
Key: SPARK-59168
URL: https://issues.apache.org/jira/browse/SPARK-59168
Project: Spark
Issue Type: Improvement
Components: Spark Core
Affects Versions: 5.0.0
Reporter: XiDuo You
RocksDB.get and LevelDB.get throw NoSuchElementException for a missing key, and callers that treat a missing key as normal (getMetadata, the store constructor reading type aliases, and updateBatch probing for an existing entry) catch it. updateBatch does this probe on every write, and most writes during an event log rebuild are new entries, so each of those writes pays the cost of throwing and filling in an exception stack trace.
Make get return null for a missing key and let the callers check for null directly. read keeps throwing NoSuchElementException to preserve the KVStore contract.
--
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