Skip to content

fix: avoid NOT NULL in Snowflake merge casts - #4683

Open
jamesg31 wants to merge 1 commit into
PeerDB-io:mainfrom
nuvo-tech:fix-snowflake-nullable-cast
Open

fix: avoid NOT NULL in Snowflake merge casts#4683
jamesg31 wants to merge 1 commit into
PeerDB-io:mainfrom
nuvo-tech:fix-snowflake-nullable-cast

Conversation

@jamesg31

@jamesg31 jamesg31 commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • generate Snowflake MERGE cast types without column nullability constraints
  • preserve NOT NULL generation for destination DDL types
  • add a regression test covering required and nullable timestamp columns

Context

PR #3893 fixed the same Snowflake syntax failure by keeping nullability out of CAST types. PR #3923 later routed TableSchema.NullableEnabled into ToDWHColumnType from the MERGE generator, which can emit invalid expressions such as CAST(... AS TIMESTAMP_TZ NOT NULL).

The Snowflake connector is deprecated, but this is a focused regression repair for existing deployments.

Test

go test ./connectors/snowflake -run '^TestGenerateMergeStatementNullableSchemaDoesNotAddNotNullToCasts$'

@jamesg31
jamesg31 requested a review from a team as a code owner August 10, 2026 20:48
@jamesg31
jamesg31 requested a deployment to external-contributor August 10, 2026 20:48 — with GitHub Actions Waiting
@jamesg31
jamesg31 requested a deployment to external-contributor August 10, 2026 20:48 — with GitHub Actions Waiting
@CLAassistant

CLAassistant commented Aug 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deprecated destination connector

This issue or pull request relates to a deprecated destination connector (Snowflake, BigQuery, ElasticSearch, Kafka, Redpanda, Confluent, Azure Event Hubs, Google Pub/Sub, or S3).

These destinations are no longer actively maintained, but remain functional. We are unlikely to prioritize new work here.

Note: BigQuery is deprecated only as a destination — it remains a supported source.

If you depend on one of these connectors, we recommend:

  • Pin to a known-good PeerDB version so behavior stays stable.
  • Fork the repository if you need to carry your own changes.

See the deprecated connectors documentation for details and migration guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants