Transforming SQL to SQL with Calcite
I’m trying to utilize Calcite as a SQL query transformer on top of PostgreSQL database.
The schema is somewhat non-trivial. It’s basically a schema of user-defined entities and columns:
How to Dynamically Add Schema in Calcite without Rebuilding All Instances
I am using Calcite for SQL parsing and execution. During the application startup, I have already instantiated SchemaPlus, FrameworkConfig, SqlValidator, VolcanoPlanner, and CalciteCatalogReader.
Calcite’s planner produces incorrect CASE statement in WHERE filter that references computed field
I’m seeing what appears to be a bug when translating a logical plan to a physical plan when a computed column that uses a CASE statement is referenced in a WHERE clause. The generated physical SQL is invalid, as it appears to be trying to coerce a CASE expression into a BOOLEAN. It’s unclear to me if I’m setting this up incorrectly or if this is a problem in the planner logic itself.
Calcite SqlStdOperatorTable.CONCAT not translated to SQL Server appopriately
Using Apache Calcite, I’m trying to generate SQL Server conformant string concatenation, but the result always uses the default “||” operator. I’ve outlined what I’m trying to do below and am wondering if I’m going about this incorrectly.