-
Notifications
You must be signed in to change notification settings - Fork 238
Fix: Ensure correct datatypes are fetched for RisingWave dialect #4903
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
Fix: Ensure correct datatypes are fetched for RisingWave dialect #4903
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! Seems reasonable, just a few comments to take this to the finish line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM– thanks for addressing comments! A few more minor ones from me and the PR should be good to merge.
tests/core/engine_adapter/integration/test_integration_risingwave.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Jo <[email protected]>
Thank you for the guidance and the quick replies! I have applied your suggestions now and look forward to seeing it merged. |
if not resp: | ||
raise SQLMeshError(f"Could not get columns for table {table_name}. Table not found.") | ||
return { | ||
column_name: exp.DataType.build(data_type, dialect=self.dialect, udt=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to check what udt=True
does but it looks like we still try to parse into a known datatype and only use a user-defined type as a fallback, so this LGTM 👍
Prior to this PR, the RisingWave dialect used the
BasePostgressAdapter
implementation ofdef columns(..)
to fetch column names and data-types.However the PG catalog tables in RisingWave doesn't support e.g.
struct
types instead returning???
as datatype. This PR updates the RisingWave adapter to use the RisingWave catalogs instead to get correct datatypes.Edit: Also added a integration test file for RisingWave upon request of maintainers for the columns function.