Follow-up to #46: address review feedback#63
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request is a follow-up to PR #46, implementing support for SingleStore reference tables with validation and testing. Reference tables in SingleStore are special table types that are not sharded and are replicated across all nodes in a distributed cluster.
Changes:
- Adds configuration options for
reference(boolean) andstorage_type(string) in table creation - Implements validation to prevent incompatible configurations (reference tables with shard keys or temporary tables)
- Adds comprehensive functional tests for reference table creation and validation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dbt/include/singlestore/macros/common.sql | Adds reference table support with validation logic and DDL generation changes to handle reference and storage_type configurations |
| tests/functional/adapter/test_reference_table.py | Adds functional tests for reference table creation (basic, rowstore) and validates error handling for incompatible shard_key configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,55 @@ | |||
| import pytest | |||
| import os | |||
There was a problem hiding this comment.
The os module is imported but never used in this file. Consider removing this unused import.
| import os |
| "`reference=true` isn't compatible with operations that create temporary tables." | ||
| ) -%} | ||
| {%- endif -%} | ||
| {% set storage_type = storage_type ~ ' reference ' -%} |
There was a problem hiding this comment.
The string concatenation on this line adds trailing whitespace that will result in extra spaces in the generated SQL. When storage_type is empty (''), this produces ' reference ' which results in 'create reference table' with double spaces. When storage_type is 'rowstore', this produces 'rowstore reference ' which results in 'create rowstore reference table' with an extra space before 'table'. Consider changing to use storage_type ~ ' reference' (without trailing space) or conditionally handle the empty string case to avoid extraneous whitespace in the generated DDL.
| {% set storage_type = storage_type ~ ' reference ' -%} | |
| {%- if storage_type -%} | |
| {% set storage_type = storage_type ~ ' reference' -%} | |
| {%- else -%} | |
| {% set storage_type = 'reference' -%} | |
| {%- endif -%} |
No description provided.