Re: [Question] Derived type from string expression with NULL parameter

2024-01-12 Thread Mihai Budiu
So maybe the bug is in the fact that UPPER uses the constructor for SqlFunction (well, almost a constructor) which doesn't supply an operand type inference argument. Still, if the operand type checker requires a CHARACTER family, why is a NULL literal always accepted? Mihai

[Question] Unknown cost calculation/propagation in RelSubsets

2024-01-12 Thread Tony Fiedler
Dear Calcite devs, First of all I really appreciate having a mature framework like Calcite. Please continue your great work on this project! My use case is feeding Calcite (v1.35.0) with an SQL query and doing some optimizations by providing metadata and selected planner rules. I initialize

[jira] [Created] (CALCITE-6198) Add TO_TIMESTAMP_LTZ function (enabled in Snowflake library)

2024-01-12 Thread Tanner Clary (Jira)
Tanner Clary created CALCITE-6198: - Summary: Add TO_TIMESTAMP_LTZ function (enabled in Snowflake library) Key: CALCITE-6198 URL: https://issues.apache.org/jira/browse/CALCITE-6198 Project: Calcite

Re: Why are window functions considered agg function?

2024-01-12 Thread Julian Hyde
Simple answer is that an aggregate function is one that takes a set of values. For example, if you apply the SUM function to values [1, 2, 3] it returns 6. When I execute a GROUP BY statement, the values of a particular column within a particular group (e.g. the group of rows for which deptno =

Re: [Question] Derived type from string expression with NULL parameter

2024-01-12 Thread Julian Hyde
OperandTypeChecker just makes sure that arguments of known type are compatible; another interface, SqlOperandTypeInference, infers the types of arguments of unknown type. Hopefully it’s now a little less mysterious. > On Jan 12, 2024, at 11:12 AM, Mihai Budiu wrote: > > inference in Calcite

Re: [Question] Derived type from string expression with NULL parameter

2024-01-12 Thread Mihai Budiu
inference in Calcite is still mysterious to me. Here it infers the type of the argument of UPPER to be NULL instead of VARCHAR. That's why the result type of UPPER is also NULL. The fact that UPPER has an OperandTypeChecker of "OperandTypes.CHARACTER" is completely ignored: public static final

[jira] [Created] (CALCITE-6197) TIME_SUB is unparsed incorrectly

2024-01-12 Thread Tanner Clary (Jira)
Tanner Clary created CALCITE-6197: - Summary: TIME_SUB is unparsed incorrectly Key: CALCITE-6197 URL: https://issues.apache.org/jira/browse/CALCITE-6197 Project: Calcite Issue Type:

[Question] Derived type from string expression with NULL parameter

2024-01-12 Thread stanilovsky evgeny
Plz help me to understand is it a bug ? From standard: 6.18 ...cut... ::= { UPPER | LOWER } 6)If is specified, then: a) The declared type of the result of is the declared type of the !!. thus i expect that return type from: SELECT UPPER(null) will be VARCHAR but calcite show :