Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeUi: Add CAST operations #449

Open
rpbouman opened this issue Feb 9, 2025 · 0 comments
Open

AttributeUi: Add CAST operations #449

rpbouman opened this issue Feb 9, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@rpbouman
Copy link
Owner

rpbouman commented Feb 9, 2025

Esp. with JSON formats like the Blueworks dataset, we can end up with a lot of VARCHAR fields which really are downgraded from a more specific datatype.

Image

It would be nice if we could have derivations that would let us explicitly cast them to a more specific type, and then have all the implied derivations and aggregates appropriate for the target type.

It would be cool to if the output would inform us of a failed cast, in a meaningful way.

For example, we could have a pair of expressions like:

  TRY_CAST( column AS <type> ) as column_type
, CAST column IS NULL THEN NULL ELSE column_type IS NULL END as success

where column_type would represent the casted value, and success indicating whether the cast was successful (it's false if there is an error).
The success indicator could then be used to render some special indicator value to indicate a value error.

It would be even better if the offending value was also somehow visible - we could do that either by including the original value in the title of the cell, or by simply displaying the original value and using some specific styling to indicate an error (f.e. red background)

@rpbouman rpbouman added the enhancement New feature or request label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant