v.24.6New Feature
Added SQL functions parseReadableSize with OrNull and OrZero variants
Added SQL functionsparseReadableSize(along withOrNullandOrZerovariants). #64742 (Francisco J. Jurado Moreno).
Why it matters
These functions allow users to convert human-readable size strings (e.g., '10MB', '5GB') into their corresponding numeric byte values. This solves the problem of manually parsing size expressions in queries and improves query flexibility when working with size-related data.How to use it
Use the functions directly in SQL queries by passing a string representing the size to parse. For example:SELECT parseReadableSize('10MB');
SELECT parseReadableSizeOrNull('invalid-size');
SELECT parseReadableSizeOrZero('unknown');The
OrNull variant returns NULL on invalid input, while the OrZero variant returns zero.