https://slingdata.io logo
Hi all - back again with a (hopefully)
# sling-help
d
Hi all - back again with a (hopefully) simpler question this time... I'm using sling via the dagster_sling component from a windows machine, loading into an oracle database. I'm trying to figure out a way to define strings as xxx char length but to also truncate longer strings to meet this length if they're naturally greater. I suspect a sling transform is the route here. I've tried the below but, regardless of the actual type of Value, it seems to pass the type-check.
Copy code
transforms: 
    - '*': 'type_of(value) == "string" ? (length(value) > 509 ? substring(value,0,505) + "..." : value) : value '
This results in failure on non-string columns: "function error: "length" - cannot get length of type int64" I'd really rather not have to explicitly define this transform on each column, has anyone managed to do something similar?
f
OK, this is fixed for next release. length will work on non-string columns.
2 Views