Compiled sql for an input list parameter results in incorrect syntax in 4.0.4

Open
#629 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python, sql
Domain
databases

Research direction

Reproduce the 4.0.4 case with a list parameter such as [1, 2, 3] and inspect the path that compiles the SQL for input parameters. Confirm that an IN clause no longer produces ARRAY(1, 2, 3), and that the completed output uses the valid form IN (1, 2, 3).

Written by the indexing model from the issue text.

Description

In 4.0.4 it seems like the partial implementation of supporting complex types like arrays etc is resulting in incorrect syntax

For example (where the list parameter is [1, 2, 3]):

… WHERE something IN %s

Is resulting in:

… WHERE something IN ARRAY(1, 2, 3)

Which is invalid syntax as of the current runtime. It should be

… WHERE something IN (1, 2, 3)
Dominant language
Python
Stars
233
Forks
152
Avg merge
21h 5m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/databricks-sql-python

All issues in databricks/databricks-sql-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.