using the RA nodes generated by calcite • OmniSci generate IR for every RA node. • OmniSci currently supports 8 RA nodes • EnumerableTableScan, LogicalProject, LogicalFilter, LogicalAggregate, LogicalJoin, LogicalSort, LogicalValues and LogicalTableModify • Use explain calcite to generate RA nodes of the query • Use explain to generate LLVM IR of the query Please Read a note on how OmniSci uses calcite here: https://www.omnisci.com/blog/fast-and-flexible-query-analysis-at-mapd-with-apache-calcite-2/
and linked at runtime. These functions are very primitive in their implementations E.g. agg_sum_int32_shared(i32*, i32), ExtractFromTime(i32, i64), DateAddNullable(i32, i64, i64, i32, i64) Find function declarations in QueryEngine/NativeCodegen.cpp Line #288
on every level. • Fragment: Horizontal partition of table • Chunk: Vertical partition of the Fragment • Use \memory_cpu and \memory_gpu to query the chunk placement for in each locality • Chunk Stats: min, max, is_null
has a very well defined algorithm. • Simple examples: sin, tan, likely, now, etc. • Interesting examples: All Geo functions i.e. ST_contains, ST_distance, etc. • Extension functions could be filter or projection functions • You can add your own easily Your function Here
llvm AST (Abstract Syntax Trees) at compile time. See QueryEngine/CMakeList.txt #150, #160 • Calcite loads the available extensions from `ExtensionFunctions.ast`, adds them to its operator table and shares the list with the execution layer in JSON format. Build an in-memory representation of that list here so that it can be used by getLLVMDeclarations(), when the LLVM IR codegen asks for it. • getLLVMDeclarations() converts JSON signature to LLVM representation.
ExtensionFunctions.hpp / ExtensionFunctionsGeo.hpp 2. Make Calcite aware of the function by adding function information in MapDSqlOperatorTable.java 3. Add Logic in RelationalAlgebraTranslator.cpp See the diff file: https://gist.github.com/VrajPandya/152212536f6910178aa066d728acd133
OPEN SOURCE Website download COMMUNITY OmniSci as a service OMNISCI CLOUD Contact sales ENTERPRISE 39 Ask questions and share your experiences @ https://community.omnisci.com