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

Queries that finishes with single quote fails #87

Closed
armaseg opened this issue Oct 11, 2022 · 0 comments · Fixed by #88
Closed

Queries that finishes with single quote fails #87

armaseg opened this issue Oct 11, 2022 · 0 comments · Fixed by #88
Labels
bug Something isn't working

Comments

@armaseg
Copy link
Collaborator

armaseg commented Oct 11, 2022

Describe the bug

If a query finishes with single quote ('), the execution of the query will fail.

Steps To Reproduce

Execute a query that ends with single quote (') Ex: WHERE column='foo'

Expected behavior

A query succesful executed

Screenshots and log output

Glue cursor returned `error` for statement None for code SqlWrapper2.execute('''create table dbt_nyc_metrics.gold_nyctaxi_cost_metrics
      using PARQUET
      
      LOCATION 's3://bucket/dbt_nyc_metrics/gold_nyctaxi_cost_metrics/'
      
      as
        SELECT (avg_total_amount/avg_trip_distance) as avg_cost_per_distance
  , (avg_total_amount/avg_duration) as avg_cost_per_minute
  , year
  , month 
  , type
  FROM dbt_nyc_metrics.silver_nyctaxi_avg_metrics
  WHERE type = 'yellow''''), SyntaxError: EOL while scanning string literal (<stdin>, line 14)
  compiled SQL at target/run/dbtgluenyctaxidemo/models/gold_metrics/gold_nyctaxi_cost_metrics.sql
21:23:36.132301 [debug] [Thread-1  ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '8f256c47-d137-4a73-9765-61ad270e3900', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7f2918b7df10>]}
21:23:36.133364 [error] [Thread-1  ]: 1 of 3 ERROR creating table model dbt_nyc_metrics.gold_nyctaxi_cost_metrics .... [ERROR in 21.39s]

System information

The output of dbt --version:

dbt --version
Core:
  - installed: 1.2.1
  - latest:    1.2.2 - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - spark: 1.2.0 - Up to date!

The operating system you're using:
MacOS Monterey
The output of python --version:
Python 3.7.10

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

Successfully merging a pull request may close this issue.

1 participant