Skip to content

Tracking issue for new expression framework #6547

@andylokandy

Description

@andylokandy

This is a tracking issue for the design and implementation of the new scalar expression framework.

Summary

The new expression framework contains these improvements:

  1. Compile-time (for SQL, aka, when planning) type checking, which could capture all type errors in the beginning, and provide nice-looking error reports.
  2. Untyped expression evaluation, which means function evaluation will no longer worry about data typing.
  3. Auto vectorization, generics, auto downcasting, and more ergonomic improvements for writing SQL function.
  4. Distributed evaluation in mind on the first day.

Reference

RFC: Formal Type System
Demo: Typed Type Exercise in Rust

Migration plan

The new expression framework will replace the legacy common-datavalues, common-datablocks and refactor all functions in common-function. So it's a tough task, and we are going to break it into small steps:

  1. Add a new common-expression crate with expression definition (AST), type checking, and evaluation runtime.
  2. Run benchmark on the new framework and make necessary improvements.
  3. Migrate all functions to the new framework.

Tasks

features

refactor

migration

We can generate new test files via using env REGENERATE_GOLDENFILES=1 cargo test and git diff to show differs

Metadata

Metadata

Labels

C-featureCategory: featureC-improvementCategory: improvementmake-life-easyMake the databend core team life easier

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions