|
|
|
|
|
by zurawiki
838 days ago
|
|
I'm really happy to see we're exploring ways to make SQL more maintainable. TypeScript did a lot for the JS ecosystem, giving us nice autocomplete and making many kinds of bugs impossible to type-check, adding this kind of type-system to SQL makes a bunch of sense. I selfishly hope this can smooth over all the missing SQL functionality in redshift Very cool work team! |
|
Hi! I'm Grant, I work at Cotera and wrote most of the warehouse compatibility stuff for NASTY
Redshift is the bane of my existence. It was definitely the hardest warehouse to write a NASTY compatible SQL gen for.
A couple of annoyances that immediately come to mind.
1. Redshift Query Planner does wild stuff
At Cotera we'll typically develop analytics libraries on one warehouse working closely with a customer and use the same library for other customers afterwards. A library will go to prod on one warehouse and then get start running on others as new customers with different warehouses want the functionality.
Moving a library between Snowflake, BigQuery an Postgres is almost never a problem performance wise. In, Redshift the semantics will be correct but performance can unexpectedly fall off a cliff for innocuous stuff. We typically write a bunch of unit tests so it's pretty easy to refactor, but I've been shocked at the things that Redshift can't optimize that everyone else had no problem with
2. Redshift does silly stuff with types of literals.
Fails with the error `[XX000] ERROR: failed to find conversion function from "unknown" to text` Because 'foo' is passed as `any` type...this fixes is but the error is bizarre and shows up way far away from the problem
(NASTY now fixes this for you when it detects it will happen)3. The `super` type breaks referential transparency
Here's just one head scratching example, but there are many super type limitations
4. Leader Only vs Compute Node Functions. Basic things like `generate_series` blow up in surprising waysFrom the NASTY source code for Redshift