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

feat: data frame with lazy relation AltrepDataFrameRelation #960

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6fa7109
feat: add `AltrepDataFrameRelation` class
Antonov548 Jan 6, 2025
c59db7e
add `rel_project2`
Antonov548 Jan 6, 2025
65e4a64
stop if no expressions
Antonov548 Jan 7, 2025
d3a250e
remove `as.data.frame`
Antonov548 Jan 7, 2025
45ae5e6
add `rel_filter2`
Antonov548 Jan 7, 2025
7e3bdb8
fix: remove `as.data.frame`
Antonov548 Jan 7, 2025
ca1ac17
Maybe this -- but doesn't work yet
krlmlr Jan 7, 2025
af84bd4
Strict
krlmlr Jan 7, 2025
eddf816
add `rapi_rel_from_any_df`
Antonov548 Jan 7, 2025
889af85
use `AltrepDataFrameRelation`
Antonov548 Jan 8, 2025
32a0eb8
add `EXTENSION_RELATION` type
Antonov548 Jan 9, 2025
5a89610
change `rapi_rel_to_altrep` to handle df
Antonov548 Jan 9, 2025
2a0c344
add connection
Antonov548 Jan 9, 2025
4d8b847
add rapi_rel_to_altrep2
Antonov548 Jan 9, 2025
dc1e31e
Throw exception
krlmlr Jan 9, 2025
950f568
Catching exception, but it occurs elsewhere
krlmlr Jan 9, 2025
43220c8
relation rebuild
Antonov548 Jan 10, 2025
bb46c8c
runtime_error
krlmlr Jan 10, 2025
e82f267
fix print method
Antonov548 Jan 14, 2025
3257a09
Remove loop
krlmlr Jan 15, 2025
56e4f7a
Pass df
krlmlr Jan 15, 2025
55cfb52
duckdb
krlmlr Jan 15, 2025
3081a21
No auto_init
krlmlr Jan 15, 2025
7c1799d
Can now remove loops for operators, but not for printing
krlmlr Jan 15, 2025
4b33d77
Don't throw
krlmlr Jan 15, 2025
918afaa
Can now remove loops
krlmlr Jan 15, 2025
01d4292
move to `relational2.cpp`
Antonov548 Jan 16, 2025
194888f
update Makevars
Antonov548 Jan 16, 2025
f08a38d
add aggregate2/order2/join2
Antonov548 Jan 16, 2025
b06fbbb
update R interface
Antonov548 Jan 16, 2025
ba23cc0
add union_all2/limit2/distinct2
Antonov548 Jan 16, 2025
d9c117e
Reorder
krlmlr Jan 17, 2025
3a4c726
Generate
krlmlr Jan 17, 2025
892d069
Reorder
krlmlr Jan 17, 2025
6419a0d
Generate
krlmlr Jan 17, 2025
e63b8c2
Anchor
krlmlr Jan 17, 2025
dce300d
add names functions
Antonov548 Jan 20, 2025
908df89
use generated rethrow
Antonov548 Jan 20, 2025
ac94d7d
add more methods
Antonov548 Jan 20, 2025
829e2b4
fix: change relation to dataframe
Antonov548 Jan 20, 2025
2426a16
change order
Antonov548 Jan 22, 2025
98d2310
add conversion block
Antonov548 Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 120 additions & 32 deletions R/cpp11.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,34 @@ rapi_expr_tostring <- function(expr) {
.Call(`_duckdb_rapi_expr_tostring`, expr)
}

rapi_get_null_SEXP_ptr <- function() {
.Call(`_duckdb_rapi_get_null_SEXP_ptr`)
}

rapi_rel_from_df <- function(con, df, experimental) {
.Call(`_duckdb_rapi_rel_from_df`, con, df, experimental)
}

rapi_rel_to_df <- function(rel) {
.Call(`_duckdb_rapi_rel_to_df`, rel)
}

rapi_rel_sql <- function(rel, sql) {
.Call(`_duckdb_rapi_rel_sql`, rel, sql)
}

rapi_rel_names <- function(rel) {
.Call(`_duckdb_rapi_rel_names`, rel)
}

rapi_rel_alias <- function(rel) {
.Call(`_duckdb_rapi_rel_alias`, rel)
}

rapi_rel_set_alias <- function(rel, alias) {
.Call(`_duckdb_rapi_rel_set_alias`, rel, alias)
}

rapi_rel_filter <- function(rel, exprs) {
.Call(`_duckdb_rapi_rel_filter`, rel, exprs)
}
Expand Down Expand Up @@ -112,8 +136,28 @@ rapi_rel_distinct <- function(rel) {
.Call(`_duckdb_rapi_rel_distinct`, rel)
}

rapi_rel_to_df <- function(rel) {
.Call(`_duckdb_rapi_rel_to_df`, rel)
rapi_rel_set_intersect <- function(rel_a, rel_b) {
.Call(`_duckdb_rapi_rel_set_intersect`, rel_a, rel_b)
}

rapi_rel_set_diff <- function(rel_a, rel_b) {
.Call(`_duckdb_rapi_rel_set_diff`, rel_a, rel_b)
}

rapi_rel_set_symdiff <- function(rel_a, rel_b) {
.Call(`_duckdb_rapi_rel_set_symdiff`, rel_a, rel_b)
}

rapi_rel_from_sql <- function(con, sql) {
.Call(`_duckdb_rapi_rel_from_sql`, con, sql)
}

rapi_rel_from_table <- function(con, schema_name, table_name) {
.Call(`_duckdb_rapi_rel_from_table`, con, schema_name, table_name)
}

rapi_rel_from_table_function <- function(con, function_name, positional_parameters_sexps, named_parameters_sexps) {
.Call(`_duckdb_rapi_rel_from_table_function`, con, function_name, positional_parameters_sexps, named_parameters_sexps)
}

rapi_rel_tostring <- function(rel, format) {
Expand All @@ -128,64 +172,108 @@ rapi_rel_explain <- function(rel, type, format) {
.Call(`_duckdb_rapi_rel_explain`, rel, type, format)
}

rapi_rel_alias <- function(rel) {
.Call(`_duckdb_rapi_rel_alias`, rel)
rapi_rel_to_parquet <- function(rel, file_name, options_sexps) {
invisible(.Call(`_duckdb_rapi_rel_to_parquet`, rel, file_name, options_sexps))
}

rapi_get_null_SEXP_ptr <- function() {
.Call(`_duckdb_rapi_get_null_SEXP_ptr`)
rapi_rel_to_csv <- function(rel, file_name, options_sexps) {
invisible(.Call(`_duckdb_rapi_rel_to_csv`, rel, file_name, options_sexps))
}

rapi_rel_set_alias <- function(rel, alias) {
.Call(`_duckdb_rapi_rel_set_alias`, rel, alias)
rapi_rel_to_table <- function(rel, schema_name, table_name, temporary) {
invisible(.Call(`_duckdb_rapi_rel_to_table`, rel, schema_name, table_name, temporary))
}

rapi_rel_sql <- function(rel, sql) {
.Call(`_duckdb_rapi_rel_sql`, rel, sql)
rapi_rel_insert <- function(rel, schema_name, table_name) {
invisible(.Call(`_duckdb_rapi_rel_insert`, rel, schema_name, table_name))
}

rapi_rel_names <- function(rel) {
.Call(`_duckdb_rapi_rel_names`, rel)
rapi_rel_names2 <- function(df, con) {
.Call(`_duckdb_rapi_rel_names2`, df, con)
}

rapi_rel_set_intersect <- function(rel_a, rel_b) {
.Call(`_duckdb_rapi_rel_set_intersect`, rel_a, rel_b)
rapi_rel_alias2 <- function(df, con) {
.Call(`_duckdb_rapi_rel_alias2`, df, con)
}

rapi_rel_set_diff <- function(rel_a, rel_b) {
.Call(`_duckdb_rapi_rel_set_diff`, rel_a, rel_b)
rapi_rel_set_alias2 <- function(df, con, alias) {
.Call(`_duckdb_rapi_rel_set_alias2`, df, con, alias)
}

rapi_rel_set_symdiff <- function(rel_a, rel_b) {
.Call(`_duckdb_rapi_rel_set_symdiff`, rel_a, rel_b)
rapi_rel_filter2 <- function(df, con, exprs) {
.Call(`_duckdb_rapi_rel_filter2`, df, con, exprs)
}

rapi_rel_from_sql <- function(con, sql) {
.Call(`_duckdb_rapi_rel_from_sql`, con, sql)
rapi_rel_project2 <- function(df, con, exprs) {
.Call(`_duckdb_rapi_rel_project2`, df, con, exprs)
}

rapi_rel_from_table <- function(con, schema_name, table_name) {
.Call(`_duckdb_rapi_rel_from_table`, con, schema_name, table_name)
rapi_rel_aggregate2 <- function(df, con, groups, aggregates) {
.Call(`_duckdb_rapi_rel_aggregate2`, df, con, groups, aggregates)
}

rapi_rel_from_table_function <- function(con, function_name, positional_parameters_sexps, named_parameters_sexps) {
.Call(`_duckdb_rapi_rel_from_table_function`, con, function_name, positional_parameters_sexps, named_parameters_sexps)
rapi_rel_order2 <- function(df, con, orders, ascending) {
.Call(`_duckdb_rapi_rel_order2`, df, con, orders, ascending)
}

rapi_rel_to_parquet <- function(rel, file_name, options_sexps) {
invisible(.Call(`_duckdb_rapi_rel_to_parquet`, rel, file_name, options_sexps))
rapi_rel_join2 <- function(left, right, con, conds, join, join_ref_type) {
.Call(`_duckdb_rapi_rel_join2`, left, right, con, conds, join, join_ref_type)
}

rapi_rel_to_csv <- function(rel, file_name, options_sexps) {
invisible(.Call(`_duckdb_rapi_rel_to_csv`, rel, file_name, options_sexps))
rapi_rel_union_all2 <- function(left, right, con) {
.Call(`_duckdb_rapi_rel_union_all2`, left, right, con)
}

rapi_rel_to_table <- function(rel, schema_name, table_name, temporary) {
invisible(.Call(`_duckdb_rapi_rel_to_table`, rel, schema_name, table_name, temporary))
rapi_rel_limit2 <- function(df, con, n) {
.Call(`_duckdb_rapi_rel_limit2`, df, con, n)
}

rapi_rel_insert <- function(rel, schema_name, table_name) {
invisible(.Call(`_duckdb_rapi_rel_insert`, rel, schema_name, table_name))
rapi_rel_distinct2 <- function(df, con) {
.Call(`_duckdb_rapi_rel_distinct2`, df, con)
}

rapi_rel_set_intersect2 <- function(left, right, con) {
.Call(`_duckdb_rapi_rel_set_intersect2`, left, right, con)
}

rapi_rel_set_diff2 <- function(left, right, con) {
.Call(`_duckdb_rapi_rel_set_diff2`, left, right, con)
}

rapi_rel_set_symdiff2 <- function(left, right, con) {
.Call(`_duckdb_rapi_rel_set_symdiff2`, left, right, con)
}

rapi_rel_from_sql2 <- function(con, sql) {
.Call(`_duckdb_rapi_rel_from_sql2`, con, sql)
}

rapi_rel_from_table2 <- function(con, schema_name, table_name) {
.Call(`_duckdb_rapi_rel_from_table2`, con, schema_name, table_name)
}

rapi_rel_from_table_function2 <- function(con, function_name, positional_parameters_sexps, named_parameters_sexps) {
.Call(`_duckdb_rapi_rel_from_table_function2`, con, function_name, positional_parameters_sexps, named_parameters_sexps)
}

rapi_rel_explain2 <- function(df, con, type, format) {
.Call(`_duckdb_rapi_rel_explain2`, df, con, type, format)
}

rapi_rel_to_parquet2 <- function(df, con, file_name, options_sexps) {
invisible(.Call(`_duckdb_rapi_rel_to_parquet2`, df, con, file_name, options_sexps))
}

rapi_rel_to_csv2 <- function(df, con, file_name, options_sexps) {
invisible(.Call(`_duckdb_rapi_rel_to_csv2`, df, con, file_name, options_sexps))
}

rapi_rel_to_table2 <- function(df, con, schema_name, table_name, temporary) {
invisible(.Call(`_duckdb_rapi_rel_to_table2`, df, con, schema_name, table_name, temporary))
}

rapi_rel_insert2 <- function(df, con, schema_name, table_name) {
invisible(.Call(`_duckdb_rapi_rel_insert2`, df, con, schema_name, table_name))
}

rapi_rel_to_altrep <- function(rel, allow_materialization) {
Expand Down
Loading