cnosdb icon indicating copy to clipboard operation
cnosdb copied to clipboard

[Feature] Enhanc RowExpressionToDomainsVisitor to support BETWEEN AND expr push down

Open yukkit opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Expr pushed down to tskv, the 'BETWEEN' expression is not supported yet.

Describe the solution you'd like

  • syntax
-- SELECT column1_name, column2_name, columnN_name FROM table_name WHERE column_name BETWEEN min_value AND max_value;

<between predicate> ::=
  <column name>  <between predicate part> 

<between predicate part> ::=
  [ NOT ] BETWEEN
      <literal value min>  AND <literal value max> 

eg.

SELECT * FROM employees
WHERE
  salary BETWEEN 7000 AND 9000;
  • suggest implement Expr::Between branch logic in pre_visit and post_visit of domain::RowExpressionToDomainsVisitor

Describe alternatives you've considered

Additional context

notes

only support column and literal value in between operator ohter expr in between operator will translate to Domain::All (mean the operator match all records)

As part of https://github.com/cnosdb/cnosdb/issues/539 for predicate push down.

yukkit avatar Aug 20 '22 06:08 yukkit