fn normalize_interval_name(interval_str: &str) -> Option<String>
Expand description
Normalizes an interval expression string into the sql-compatible format. This function handles 2 types of input:
- Abbreviated interval strings (e.g., “1y2mo3d”)
Returns an interval’s full name (e.g., “years”, “hours”, “minutes”) according to the
INTERVAL_ABBREVIATION_MAPPING
If theinterval_str
contains whitespaces, the interval name is considered to be in a full form. - ISO 8601 format strings (e.g., “P1Y2M3D”), case/sign independent Returns a number of milliseconds corresponding to ISO 8601 (e.g., “36525000 milliseconds”)
Note: Hybrid format “1y 2 days 3h” is not supported.