commit | 888e8795598395a72b3ff2f6ecff8e488b21ebde | [log] [tgz] |
---|---|---|
author | rkondakov <kondakov87@mail.ru> | Sun May 03 15:54:28 2020 +0300 |
committer | Haisheng Yuan <h.yuan@alibaba-inc.com> | Mon May 11 13:28:48 2020 -0500 |
tree | 74557c15b4716faefb76930af813c824dd21dfe9 | |
parent | de3bef9b06502886f87b60ab36d8e54ebc55f05c [diff] |
[CALCITE-3969] Trait keys remapping may throw exception when some trait key is not mapped (Roman Kondakov) Currently method RelTrait.apply(Mappings.Mapping) might throw an exception when collation/distribution keys are not covered by mapping. For example when we apply project SELECT name on input id, name ORDER BY id Method RelTrait.apply(Mappings.Mapping) throws NPE because of internals of RexUtil.apply where assumed that all sort keys [0] should be covered by project mapping keys name=[1]. And when this assumption is wrong, the exception is thrown. In this patch the graceful handling for such situations added for both collation and distribution traits. When collation or distribution cannot be derived from the mapping, RelDistributions#ANY and RelCollations#EMPTY are returned accordingly. Close #1959
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.