commit | 2558c13cdb8b6a8e1608112a902b1bf9d97b5386 | [log] [tgz] |
---|---|---|
author | Oliver Lee <oliverlee@google.com> | Mon Jan 29 19:27:35 2024 +0000 |
committer | Julian Hyde <jhyde@apache.org> | Mon Feb 26 17:50:09 2024 -0800 |
tree | 1e6920e2d17e9e0f41edb2d6a6e9dcee9505f880 | |
parent | 96485c0ec8366d04f08f5c9a72bbee5b47503d6e [diff] |
[CALCITE-6219] 'Must-filter' columns A table can declare that some of its columns must be filtered by implementing `interface SemanticTable`. If such columns are not filtered in a WHERE or HAVING clause, the validator throws. There are several purposes of these columns, one of which is to prevent expensive full-table scans (for example, reading all Orders without restricting on orderDate). Implementation is via the method SqlValidatorNamespace.getMustFilterFields(). For a table namespace, that method returns the declared must-filter fields. For a query namespce, that method returns any must-filter fields that have not been filtered in that query; such fields become the responsibility of the enclosing query. If a field is must-filter and is not in the SELECT clause of a sub-query, that is also an error, because of course it is now impossible for the enclosing query to filter it. Close apache/calcite#3688 Co-authored-by: Julian Hyde <jhyde@apache.org>
Apache Calcite is a dynamic data management framework.
It contains many of the pieces that comprise a typical database management system but omits the storage primitives. It provides an industry standard SQL parser and validator, a customisable optimizer with pluggable rules and cost functions, logical and physical algebraic operators, various transformation algorithms from SQL to algebra (and the opposite), and many adapters for executing SQL queries over Cassandra, Druid, Elasticsearch, MongoDB, Kafka, and others, with minimal configuration.
For more details, see the home page.
The project uses JIRA for issue tracking. For further information, please see the JIRA accounts guide.