Skip to content

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

Conversation

MisterWheatley
Copy link
Contributor

@MisterWheatley MisterWheatley commented Jul 4, 2025

Prior to this PR, the RisingWave dialect used the BasePostgressAdapter implementation of def 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.

@CLAassistant
Copy link

CLAassistant commented Jul 4, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@georgesittas georgesittas left a 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.

Copy link
Contributor

@georgesittas georgesittas left a 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.

@MisterWheatley
Copy link
Contributor Author

LGTM– thanks for addressing comments! A few more minor ones from me and the PR should be good to merge.

Thank you for the guidance and the quick replies! I have applied your suggestions now and look forward to seeing it merged.

@georgesittas georgesittas requested a review from a team July 7, 2025 13:41
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)
Copy link
Collaborator

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 👍

@georgesittas georgesittas merged commit e3daa8f into TobikoData:main Jul 7, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants