sirixdb / brackit

Query processor with proven optimizations, ready to use for your JSON store to query semi-structured data with JSONiq. Can also be used as an ad-hoc in-memory query processor.
http://brackit.io
Other
46 stars 10 forks source link

Add constant folding #44

Open JohannesLichtenberger opened 2 years ago

dvlpsh commented 3 days ago

Hi @JohannesLichtenberger could you add a description for this issue as to what really is to be done?

JohannesLichtenberger commented 3 days ago

At compile time certain expressions can be evaluated already and thus, the AST has to be rewritten: https://gavinray97.github.io/blog/what-good-are-record-patterns

In brackit some rewrites (not constant folding) are already performed: https://github.com/sirixdb/brackit/tree/master/src/main/java/io/brackit/query/compiler/optimizer/walker/topdown