Robert Howell
02/18/2025, 11:25 PMRobert Howell
02/18/2025, 11:31 PMRobert Howell
02/18/2025, 11:34 PMCory Grinstead
02/19/2025, 6:11 PM# decode as "gzip" or return NULL on failure
col("my_bytes").try_decode("gzip")in another issue/PR you mentioned the need for
try_cast
An expression that I really want to add is a try expression, instead of individual try_ methods.Cory Grinstead
02/19/2025, 6:14 PMtry_(col("my_bytes").decode("gzip")).except_(lit(b"an error decoding"))Robert Howell
02/19/2025, 6:19 PMRobert Howell
02/19/2025, 6:22 PMtry_cast and it would have came in handy for SUMMARIZE to permissively support more types.jay
02/21/2025, 6:28 PMstoi expression or similar
⢠int to string cast should call a to_string expression
⢠string to date should call a strptime expression
⢠date to string can call a strftime expression, with a default setting (e.g. YYYY-MM-DDTHH-MM-SS)
etc etc
This would make our casting docs easier (we can call out exactly which expression we call out to under the hood for various cast operations) and also allow people to be more explicit when moving between different datatypes...jay
02/21/2025, 6:29 PMRobert Howell
02/21/2025, 6:45 PMclass Expr:
def to_str(self):
# a cast with no type args
def to_decimal(self, precision, scale):
# cast with args
# daft.functions
def to_str(expr): ...
def to_decimal(expr, precision, scale): ...jay
02/21/2025, 6:46 PMRobert Howell
02/21/2025, 6:47 PMRobert Howell
03/04/2025, 7:46 PMCory Grinstead
03/04/2025, 8:27 PMRobert Howell
03/04/2025, 8:31 PMRobert Howell
03/05/2025, 9:52 PM