v.21.6New Feature

Added dictGetOrNull function to return Null for missing keys

Added function dictGetOrNull. It works like dictGet, but return Null in case key was not found in dictionary. Closes #22375. #22413 (Maksim Kita).
Added the dictGetOrNull function, which behaves like dictGet but returns Null if the key is not found in the dictionary.

Why it matters

This function addresses the problem of handling missing keys in dictionaries more gracefully by returning Null 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 function dictGetOrNull 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.