cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Positional parameters: INVALID_PARAMETER_MARKER_VALUE.DUPLICATE_NAME

RickB
New Contributor II

When trying to execute a query via sql warehouse, I get the following error:
INVALID_PARAMETER_MARKER_VALUE.DUPLICATE_NAME

the sql statement uses ? placeholders and the correct number of arguments are being passed.

I am not able to use named placeholders with my library, before I refactor I am wondering if there is something I am missing.

Sample SQL:

SELECT client_ip, count(*) as requests FROM {redacted} WHERE log_event_hour >= ? AND log_event_hour <= ? AND log_event_date >= ? AND log_event_date <= ? LIMIT 10 args: [1724332222,1724335822,"2024-08-22","2024-08-22"]

 

3 REPLIES 3

szymon_dybczak
Contributor III

Hi @RickB ,

Which API are you using to invoke this? Parameter markers can be provided by:

Because in each one there are subtle differences how to provide arguments to unnamed parameter markers. Take a look at below documentation entry:

Parameter markers | Databricks on AWS

 

If you are using sql, you should have something like below (example from documentation)

> DECLARE stmtStr = 'SELECT current_timestamp() + ?, ? * ? AS square';
> EXECUTE IMMEDIATE stmtStr USING INTERVAL '3' HOURS, 15.0, 15.0;

 

 

 

I am using the go-sql-driver: https://docs.databricks.com/en/dev-tools/go-sql-driver.html

Looking through the code it looks like it only works with named params which is a shame.

Hi @RickB ,

Yeah, I've checked github repo and it looks like it currently supports only named params 😕

databricks-sql-go/parameters.go at main · databricks/databricks-sql-go · GitHub

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group