v.21.6New Feature
Added dictGetOrNull function to return Null for missing keys
Added functiondictGetOrNull. It works likedictGet, but returnNullin case key was not found in dictionary. Closes #22375. #22413 (Maksim Kita).
Why it matters
This function addresses the problem of handling missing keys in dictionaries more gracefully by returningNull instead of causing errors or requiring additional error handling. It simplifies queries and improves robustness when working with dictionaries.How to use it
Use the functiondictGetOrNull in queries similarly to dictGet. If the specified key does not exist in the dictionary, the function will return Null instead of throwing an error.