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

@mapmany missing? #35

Open
tlnagy opened this issue Jul 16, 2020 · 3 comments
Open

@mapmany missing? #35

tlnagy opened this issue Jul 16, 2020 · 3 comments

Comments

@tlnagy
Copy link

tlnagy commented Jul 16, 2020

Using master, it looks like the @mapmany command is missing. For the groupby and then split approach mapmany is critical, is it just not implemented? I didn't see it mentioned in the codebase.

julia> db = SQLite.DB("data.sqlite3");

julia> getproperty(db, tbl[1]) |>
    @groupby(_.cell_id) |>
     # filter stuff
    @map({cell_id=key(_), rows=_}) |>
    @mapmany(i->i.rows, (i, j)->{j...}) |>
    DataFrame;
MethodError: no method matching mapmany(::QuerySQLite.SourceCode{SQLite.DB}, ::var"#113#123", ::Expr, ::var"#114#124", ::Expr)
Closest candidates are:
  mapmany(!Matched::QueryOperators.Enumerable, ::Function, ::Expr, ::Function, ::Expr) at /home/tlnagy/.julia/packages/QueryOperators/g4G21/src/enumerable/enumerable_mapmany.jl:42

Stacktrace:
 [1] (::var"#112#122")(::QuerySQLite.SourceCode{SQLite.DB}) at /home/tlnagy/.julia/packages/Query/AwBtd/src/standalone_query_macros.jl:205
 [2] |>(::QuerySQLite.SourceCode{SQLite.DB}, ::var"#112#122") at ./operators.jl:823
 [3] top-level scope at In[30]:1
@bramtayl
Copy link
Collaborator

Nope, just not implemented, but shouldn't be too hard. Do you happen to know what the corresponding SQL code would look like?

@tlnagy
Copy link
Author

tlnagy commented Jul 19, 2020

I'm pretty new to SQL, but maybe the UNIONALL command is what we're looking for? I'm not sure it covers all of @mapmany's functionality.

@bramtayl
Copy link
Collaborator

Hmm, I'm not sure that would do it...do you think you could come up with an example of using @mapmany using the Chinook_Sqlite.sqlite data in the test folder of the package (reading it into julia first, maybe as a dataframe). Then I'll see if I can replicate it in SQL?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants