You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/01/29 02:56:52 UTC
[GitHub] [calcite] wojustme commented on pull request #2702: [CALCITE-4800] Define a new rule of SortToSortUnifyRule in SubstitutionVisitor to support sort's match
wojustme commented on pull request #2702:
URL: https://github.com/apache/calcite/pull/2702#issuecomment-1024816813
Handle for Sort's mv-match
- Equal collation's info, we just check offset and fetch. Query could be rewritten by mv, when mv's data-range must be larger than query's.
such as:
--query:
Sort(collation: [1], offset: 3)
Calc(program: (expr#0..4=[{inputs}], name=[$t2], deptno=[$t1]))
Scan(table: [hr, emps])
--mv:
Sort(collation: [1], offset: 2)
Calc(program: (expr#0..4=[{inputs}], name=[$t2], deptno=[$t1]))
Scan(table: [hr, emps])
--rewrite:
Sort(collation: [], offset: 1)
Sort(collation: [1], offset: 2)
Calc(program: (expr#0..4=[{inputs}], name=[$t2], deptno=[$t1]))
Scan(table: [hr, emps])
- No-equal collation's info, we could build a new sort above mv's, which collation must be query's
such as:
--query:
Sort(collation: [1 DESC])
Calc(program: (expr#0..4=[{inputs}], name=[$t2], deptno=[$t1]))
Scan(table: [hr, emps])
--mv:
Sort(collation: [1])
Calc(program: (expr#0..4=[{inputs}], name=[$t2], deptno=[$t1]))
Scan(table: [hr, emps])
--rewrite:
Sort(collation: [1 DESC])
Sort(collation: [1])
Calc(program: (expr#0..4=[{inputs}], name=[$t2], deptno=[$t1]))
Scan(table: [hr, emps])
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org