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

[CT-502] [Bug] dbt seed returning '0 parameter markers' error #334

Closed
1 task done
crystalro0 opened this issue Apr 15, 2022 · 4 comments
Closed
1 task done

[CT-502] [Bug] dbt seed returning '0 parameter markers' error #334

crystalro0 opened this issue Apr 15, 2022 · 4 comments
Labels
Stale type:bug Something isn't working

Comments

@crystalro0
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

User is running dbt seed as a step in a job run in their deployment environment and getting the following error:
The SQL contains 0 parameter markers, but x parameters were supplied

Possibly related to this code snippet: https://github.com/dbt-labs/dbt-spark/blob/main/dbt/adapters/spark/connections.py#L284

Expected Behavior

Should be processing seed by converting the %s to ? before query execution.

Steps To Reproduce

  1. Set up environment with Databricks and ODBC.
  2. Create job with a dbt seed step.
  3. Run job.
  4. Error should occur.

Relevant log output

06:04:48    ('The SQL contains 0 parameter markers, but 32144 parameters were supplied', 'HY000')

Environment

- dbt: 1.0.4

What database are you using dbt with?

other (mention it in "Additional Context")

Additional Context

Databricks on AWS with SQL endpoint connection.
I believe this issue is related to this.

@crystalro0 crystalro0 added type:bug Something isn't working triage:product labels Apr 15, 2022
@github-actions github-actions bot changed the title [Bug] dbt seed returning '0 parameter markers' error [CT-499] [Bug] dbt seed returning '0 parameter markers' error Apr 15, 2022
@crystalro0
Copy link
Author

I have the internal ZD ticket number and some customer logs, if needed. Please let me know.

@jtcohen6
Copy link
Contributor

jtcohen6 commented Apr 18, 2022

@crystalro0 Thanks for opening! I'm going to transfer this issue to the dbt-spark repository, since I believe that's where the relevant code is located, and where any code changes would need to happen.

In v1.0, we added another spot where we'll return a different parameter marker depending on the connection method:

{% macro spark__get_binding_char() %}
{{ return('?' if target.method == 'odbc' else '%s') }}
{% endmacro %}

That means dbt's own debug-level logs should include ?, rather than %s; we don't need to trust that they'll be converted appropriately at the last minute via sqlparams.

I'll reach out to you for details about the ZD ticket and logs.

@jtcohen6 jtcohen6 transferred this issue from dbt-labs/dbt-core Apr 18, 2022
@github-actions github-actions bot changed the title [CT-499] [Bug] dbt seed returning '0 parameter markers' error [CT-502] [CT-499] [Bug] dbt seed returning '0 parameter markers' error Apr 18, 2022
@jtcohen6
Copy link
Contributor

Quick updates:

  • I haven't been able to reproduce this, using the same seed CSV file (thanks @crystalro0!). When I run dbt seed with it in dbt Cloud (IDE), using an ODBC connection, it works just fine.
  • Because spark__get_binding_char doesn't do quite the thing I thought it does, there's no easy way to tell just from the logs that the (in)correct binding character is being used. We should fix that more generally, hence Add method to _connection_keys #336

@leahwicz leahwicz changed the title [CT-502] [CT-499] [Bug] dbt seed returning '0 parameter markers' error [CT-502] [Bug] dbt seed returning '0 parameter markers' error Apr 19, 2022
@github-actions
Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants