김선우
6b40acabbc
Add support for sqlite_version() scalar function
2024-09-16 18:38:42 +09:00
JeanArhancet
d03a734f21
feat: add sign function
2024-09-15 14:57:01 +02:00
jussisaurio
3f0162c76c
Support grouping by a function expression
2024-09-15 09:58:46 +03:00
jussisaurio
6b8cd02f71
Fix function expressions in like pattern not working
2024-09-15 09:57:54 +03:00
jussisaurio
234c56ca81
Fix two issues with LIKE operator ( #319 )
2024-09-15 09:57:54 +03:00
김선우
8b3e4da8da
Apply comments
...
- Specify the number of arguments using arg_count
- Add test for concat_ws
2024-09-15 10:04:30 +09:00
김선우
fc07ca9d73
Add support for concat_ws
2024-09-14 23:47:45 +09:00
jussisaurio
a108dea825
GROUP BY
2024-09-14 16:14:45 +03:00
jussisaurio
0839211a49
Pass FuncCtx to Insn::Function to keep track of arg count
2024-09-14 12:38:14 +03:00
rjhallsted
dc3d3a492a
Fix register positions of binary expression arguments to fix where-like-fn case
2024-09-12 12:03:27 -07:00
sonhmai
9cc965186f
core: support modifiers in date function
2024-09-03 14:28:07 +07:00
Rajiv Harlalka
3447a553e1
chore: move tests
...
Signed-off-by: Rajiv Harlalka <rajivharlalka009@gmail.com >
2024-08-30 20:34:48 +05:30
Rajiv Harlalka
e2013b0ef6
add unixepoch tests
...
Signed-off-by: Rajiv Harlalka <rajivharlalka009@gmail.com >
2024-08-30 20:28:35 +05:30
sonhmai
c32bb91dd5
core: support modifiers in time function
2024-08-24 18:31:34 +07:00
Pekka Enberg
51eebb8ea5
Merge 'Add support for nullif scalar function' from Kim Seon Woo
...
### EXPLAIN nullif(1,2)
<img width="1339" alt="image" src="https://github.com/user-attachments/assets/08230797-914d-4922-b52c-5b2b2b4c2a12 ">
### Issue
https://github.com/penberg/limbo/issues/144
Closes #299
2024-08-20 20:47:35 +03:00
Kim Seon Woo
8bb2a48cb6
Add support for nullif scalar function
2024-08-20 18:36:06 +02:00
Kim Seon Woo
9d878fda55
Remove failing test for now
2024-08-18 21:05:01 +02:00
Kim Seon Woo
a95fcc0fc1
Fix test to check whether error message is included
2024-08-18 21:00:37 +02:00
Kim Seon Woo
c6402aa341
Add tcl
2024-08-18 21:00:36 +02:00
Pekka Enberg
edf0f754f6
Merge 'More structured query planner' from Jussi Saurio
...
Reader's guide to this PR:
The aim is to have a more structured and maintainable approach to generating bytecode from the query AST so that different parts of the query processing pipeline have clearer responsibilities, so that developing new functionality is easier. E.g.:
- If you want to implement join reordering -> you do it in `Optimizer`
- If you want to implement `GROUP BY` -> you change `QueryPlanNode::Aggregate` to include it, parse it in `Planner` and handle the code generation for it in `Emitter`
The pipeline is:
`SQL text -> Parser -> Planner -> Optimizer -> Emitter`
and this pipeline generates:
`SQL text -> AST -> Logical Plan -> Optimized Logical Plan -> SQLite Bytecode`
---
Module structure:
`plan.rs`: defines the `Operator` enum. An `Operator` is a tree of other `Operators`, e.g. an `Operator::Join` has `left` and `right` children, etc.
`planner.rs`: Parses an `ast::Select` into a `Plan` which is mainly a wrapper for a root `Operator`
`optimizer.rs`: Makes a new `Plan` from an input `Plan` - does predicate pushdown, constant elimination and turns `Scan` nodes into `SeekRowId` nodes where applicable
`emitter.rs`: Generates bytecode instructions from an input `Plan`.
---
Adds feature `EXPLAIN QUERY PLAN <stmt>` which shows the logical query plan instead of the bytecode plan
---
Other changes:
- Almost everything from `select.rs` removed; things like `translate_aggregation()` moved to `expr.rs`
- `where_clause.rs` removed, some things from it like `translate_condition_expr()` moved to `expr.rs`
- i.e.: there is nothing _new_ in `expr.rs`, stuff just moved there
---
Concerns:
- Perf impact: there's a lot more indirection than before (`Operator`s are very "traditional" trees where they refer to other operators via Boxes etc)
Closes #281
2024-08-18 16:36:51 +03:00
JeanArhancet
b6c720c90a
feat: add quote function
2024-08-17 09:28:14 +02:00
jussisaurio
d70eb6b3d7
fix seekrowid operator not emitting result when root
2024-08-17 09:16:24 +03:00
jussisaurio
2d35641b86
whitespace
2024-08-16 19:42:03 +03:00
jussisaurio
989066eedf
remove duplicate test after rebase
2024-08-16 19:42:03 +03:00
jussisaurio
2e32ca0bdb
More structured query planner
2024-08-16 19:42:03 +03:00
Kim Seon Woo
48d3c05fb0
Rebase
2024-08-16 21:40:30 +09:00
Pekka Enberg
c9c0d2808c
Merge 'Add support for ifnull scalar function' from Kim Seon Woo
...
Add support for `ifnull` scalar function
### EXPLAIN SELECT ifnull(null, 20);

### Related issue
https://github.com/penberg/limbo/issues/144
Closes #290
2024-08-16 14:37:08 +03:00
Pekka Enberg
ba3acedbc8
Merge 'Add support for substr scalar function' from Kim Seon Woo
...
Add support for `substr` scalar function. We can reuse the `substring` logic which is already implemted.
## Related issue
https://github.com/penberg/limbo/issues/144
Closes #289
2024-08-16 14:36:55 +03:00
김선우
10d452de2a
Nit
2024-08-16 09:27:38 +09:00
김선우
8fbcd10e0e
Add support for ifnull scalar function
2024-08-16 09:25:04 +09:00
김선우
27d9af2bf4
Add support for substr scalar function
2024-08-16 08:26:42 +09:00
김선우
77c3d130f3
Add char function support
2024-08-16 06:26:06 +09:00
김선우
aff13de125
Nit
2024-08-15 18:50:40 +09:00
김선우
dc48c2e71d
Add substring scala function with 2 arg
2024-08-15 18:47:32 +09:00
김선우
3fa3c5c002
Add substr scala function
2024-08-15 18:27:18 +09:00
Vegard Stikbakke
e54fd83f49
Handle FunctionCallStar in analyze_expr
2024-08-11 13:59:49 +02:00
JeanArhancet
4050a3ebe2
refactor: impl json5 direclty
2024-08-04 12:47:08 +02:00
JeanArhancet
4d0a25c1b4
test: add json tcl test
2024-08-04 10:56:52 +02:00
Pekka Enberg
d9b1cac27b
testing: Add test database + WAL file
2024-08-03 12:16:34 +03:00
jussisaurio
d5ade427c2
add test for seekrowid order independence
2024-08-01 17:58:38 +03:00
jussisaurio
551b11303f
Broaden the type of expr that qualifies as seekrowid candidate
2024-08-01 17:23:59 +03:00
sonhmai
789ae4becf
feat: add time() scalar function partial support without modifier #158
2024-08-01 13:06:07 +07:00
Pekka Enberg
0c703a228d
testing: Make individual test files executable
...
Each test file is standalone to make it easy to run just some specific
tests. However, some of the files didn't have the executable bit.
2024-07-29 09:41:40 +03:00
macroexpansion
918b99b7a3
feat: add RTRIM(X) and RTRIM(X,Y) scalar function
2024-07-28 21:17:53 +07:00
Pekka Enberg
ccf76aac54
Merge pull request #237 from penberg/optimize-constant-conditions
2024-07-27 22:56:56 +03:00
Pekka Enberg
0256de7bad
Merge pull request #238 from macroexpansion/feature/add-ltrim-scalar-function
2024-07-27 15:57:48 +03:00
macroexpansion
750f18be35
feat: add ltrim scalar function
2024-07-27 19:46:27 +07:00
jussisaurio
700d9ee976
Optimize constant conditions
2024-07-27 15:08:30 +03:00
jussisaurio
016379fea4
core/translate: #154 : implement WHERE IN (...)
2024-07-26 18:13:05 +03:00
jussisaurio
e3cc3da7ca
Implement #216 : order by column number
2024-07-26 14:35:33 +03:00