queryverse / queryverse/QuerySQLite.jl

error using the in operator

Open
#33 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
4
Forks
2
Avg merge
2d 3h
Merged PRs (30d)
1

Description

I was trying to do a filter for a value in an array. Here's an example using the Chinook db:

using Query, QuerySQLite
database = Database(joinpath(pathof(QuerySQLite) |> dirname |> dirname, "test", "Chinook_Sqlite.sqlite"))
database.Track |> @filter(_.AlbumId in [1,5,9])

which returns the error:

SQLite.SQLiteException("no such table: 1, 5, 9")

and piping to get_sql has [ ] around the array, where SQL needs parens ( ).

If we run:

using SQLite, DataFrames
result = DBInterface.execute(db,"SELECT * FROM (Track) WHERE AlbumId IN (1, 5, 9)") |> DataFrame

we get the expected results.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the Chinook example from the issue and inspect the SQL produced by get_sql for the array used with the in operator. Compare it with the working DBInterface query; done means the filter emits valid SQLite IN syntax with parentheses and returns the expected rows.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia, sqlite
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.