Skip to content

Follow-up to #46: address review feedback#63

Merged
okramarenko merged 7 commits into
masterfrom
pr-46
Jan 30, 2026
Merged

Follow-up to #46: address review feedback#63
okramarenko merged 7 commits into
masterfrom
pr-46

Conversation

@okramarenko
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and storage_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
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The os module is imported but never used in this file. Consider removing this unused import.

Suggested change
import os

Copilot uses AI. Check for mistakes.
"`reference=true` isn't compatible with operations that create temporary tables."
) -%}
{%- endif -%}
{% set storage_type = storage_type ~ ' reference ' -%}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
{% set storage_type = storage_type ~ ' reference ' -%}
{%- if storage_type -%}
{% set storage_type = storage_type ~ ' reference' -%}
{%- else -%}
{% set storage_type = 'reference' -%}
{%- endif -%}

Copilot uses AI. Check for mistakes.
@okramarenko okramarenko merged commit 4989d1f into master Jan 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants