Skip to content
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

SNOW-1960433: Regression in binding of some parameter types in 1.11.0/1.11.1 (silent failure when binding []uuid.UUID) #1322

Closed
kaiterramike opened this issue Mar 4, 2025 · 2 comments
Assignees
Labels
duplicate status-triage_done Initial triage done, will be further handled by the driver team

Comments

@kaiterramike
Copy link

kaiterramike commented Mar 4, 2025

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of GO driver are you using?
    1.12.1

  2. What operating system and processor architecture are you using?
    Linux/amd64

  3. What version of GO are you using?
    1.23.5

4.Server version:* E.g. 1.90.1
9.4.3

  1. What did you do?
    I'm running a query that copies its results into an S3 stage. The query looks like this:
import (
    "github.com/google/uuid"
    "github.com/jmoiron/sqlx"
)

// ...

	begin := time.Date(2025, 2, 1, 0, 0, 0, 0, time.UTC)
	end := time.Date(2025, 3, 1, 0, 0, 0, 0, time.UTC)
	ids := []uuid.UUID{uuid.New()}

	query, args, err := sqlx.In(`
COPY INTO @SOME_STAGE/some_folder/
FROM (
	select * from table(some_udf_name(
		?::timestamp_tz,
		?::timestamp_tz,
		array_construct_compact(?)
	))
)
HEADER = TRUE
	`, begin.Format("2006-01-02 15:04:05 Z07:00"), end.Format("2006-01-02 15:04:05 Z07:00"), ids)
	if err != nil {
		panic(err)
	}

	query = db.Rebind(query)

	rows, err := db.Queryx(query, args...)

where db is an instance of sqlx.DB.

Some_udf_name is defined like this:

CREATE OR REPLACE FUNCTION {{ target.schema }}.some_udf_name(
	time_from timestamp_tz,
	time_to timestamp_tz,
	udids array
)

RETURNS TABLE(
	udid varchar,
	time timestamp_tz,
	value float
)

AS $$

	SELECT
		udid,
		time,
		value
	FROM some_table

$$;

The result is that the query returns without an error, but no CSV files are written to the S3 stage.

On 1.10.1, this works as expected.
On 1.11.0, this code results in a panic at github.com/snowflakedb/[email protected]/converter.go:276
On 1.11.1, this code silently fails.

One workaround is to use a []string instead of a []uuid.UUID, but this shouldn't be necessary -- Google's uuid.UUID type has a Value() method and a String() method. Other database drivers, like postgresql, handle this scenario just fine.

  1. What did you expect to see?
    Files show up in the S3 stage.

  2. Can you set logging to DEBUG and collect the logs?
    (I can get logs if needed, but it should be easy to repro, and I've already spent about three hours root-causing this bug)

@kaiterramike kaiterramike added the bug Erroneous or unexpected behaviour label Mar 4, 2025
@github-actions github-actions bot changed the title Regression in binding of some parameter types in 1.11.0/1.11.1 (silent failure when binding []uuid.UUID) SNOW-1960433: Regression in binding of some parameter types in 1.11.0/1.11.1 (silent failure when binding []uuid.UUID) Mar 4, 2025
@sfc-gh-dszmolka sfc-gh-dszmolka added duplicate status-triage_done Initial triage done, will be further handled by the driver team and removed bug Erroneous or unexpected behaviour labels Mar 4, 2025
@sfc-gh-dszmolka
Copy link
Contributor

looks to be a duplicate of #1209 which is already fixed in recent driver releases.

Can you please take a look?

If you have the same issue with the latest driver too, please do comment and I can reopen and look.

@kaiterramike
Copy link
Author

Yep looks like a duplicate. Thanks! Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants