Default operator override in Apache Calcite

2022-07-09 Thread Vladimir Ozerov
Hi, Apache Calcite has a powerful but complicated and non-documented function library. Some projects may require overriding some of the existing operators to introduce custom type deduction, custom validation, etc. This includes the base arithmetic functions (e.g, disallow INT + VARCHAR), aggregat

Re: Default operator override in Apache Calcite

2022-07-11 Thread Julian Hyde
Remember the rule of Chesterton’s fence: before you change something you must know why it exists the way it is. Since you don’t cover it in your email, let’s review the purpose of SqlStdOperatorTable. As the ’Std’ indicates, it is intended to contain the operators that are defined by the SQL st

Re: Default operator override in Apache Calcite

2022-07-14 Thread Vladimir Ozerov
Hi Julian, The motivation for the proposal is a requirement to change the way how some operators, like PLUS or SUM, does the type inference and validation. I understand you concern about the complexity. How would you suggest to override the behavior of PLUS/SUM in the downstream project, provided

Re: Default operator override in Apache Calcite

2022-07-14 Thread Vladimir Ozerov
> "As the ’Std’ indicates, it is intended to contain the operators that are defined by the SQL standard. And which presumably would be enabled in any configuration." Makes sense from the operator availability perspective. However, the SQL standard mostly silent on how types should be inferred and

Re: Default operator override in Apache Calcite

2022-07-10 Thread Yanjing Wang
+1, Thanks Vladimir for pointing the pains out and the solutions looks more clean and extensible. Vladimir Ozerov 于2022年7月9日周六 15:01写道: > Hi, > > Apache Calcite has a powerful but complicated and non-documented function > library. Some projects may require overriding some of the existing > opera