Jenkins build is back to normal : Calcite ยป Calcite-snapshots #72

2022-02-18 Thread Apache Jenkins Server
See

Re: Pushing filters with unsafe operations (CAST/DIVISION) below inner joins

2022-02-18 Thread Viliam Durina
I have observed this issue years ago in well-known databases. My case was much simpler: data recordType:int value:text - -- 0 1 1 a SELECT * FROM data WHERE recordType='1' AND CAST(value AS INT)<10 SQL is declarative, and unlike procedural language

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread xiaobo
Hi Gavin, Can you share a complete example of using a FrameworkConfig object to open a calcite connection, thanks. SchemaPlus rootSchema = Frameworks.createRootSchema(true); Schema schema = new ReflectiveSchema(new HrSchema2(emps1)); r

[HELP][DISCUSS] ReduceExpressionsRule configurability / extensibility

2022-02-18 Thread Ruben Q L
Hello community, I would need some advice for a very specific problem. I find myself in the following situation: I have a plan with a bottom filter (an equality) and a top filter (a user defined function MY_FUNC): ... LogicalFilter(condition: MY_FUNC($0, 42)) LogicalFilter(condition: $0=1)

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread Gavin Ray
Sure Here is a singleton object that uses FrameworkConfig in Kotlin to manage a single master RootSchema + CalciteConnection: https://github.com/GavinRay97/GraphQLCalcite/blob/e4ba2426edb546bda9bd5bd87a61764850138348/src/main/kotlin/CalciteSchemaManager.kt#L23-L117 And here is the same in Java: h

Query Validation Failure

2022-02-18 Thread Yogendra Sharma
Hi Community, I am trying to understand the code written in SqlValidatorImpl class. I wrote a simple piece of code to test/debug this, and to my surprise, even that simple code is failing with error- "No match found for function signature =" I simply calling Validator.validate(node) on a SqlN

Re: [HELP][DISCUSS] ReduceExpressionsRule configurability / extensibility

2022-02-18 Thread Stamatis Zampetakis
Hi Ruben, There was a recent request about preventing simplifications of certain operators [1] that does make sense in certain use cases. Apart from changes in RexSimplify this request would most likely need some kind of changes in various reduce expressions rules like the ones you seem to need as

Re: Pushing filters with unsafe operations (CAST/DIVISION) below inner joins

2022-02-18 Thread Stamatis Zampetakis
Thank you all for the feedback. I will do a small research about the proper term to use for functions that might throw / never throw and log a JIRA to move the discussion further. @Viliam : Note that the problem you mention, although similar, is not exactly the same as the one I brought up now.

Re: Query Validation Failure

2022-02-18 Thread Yogendra Sharma
Turned out to be the operator table trick. I was passing the wrong operator table. Changing the operator table to below fixed it. SqlOperatorTable operatorTable = SqlStdOperatorTable.instance(); Thank you! From: Yogendra Sharma Sent: Saturday, February 19, 2022

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread xiaobo
Thanks Gavin, From the Java example it seems FrameworkConfig can't be attached to calciteconnection something like passing a Property object when opening the connection, and in order to make FrameworkConfig work, we must use the relation related APIs of calcite(like the executeQuery(RelNode re

Re: can we set a default schema for calcite connection to avoid writing schema names in sql

2022-02-18 Thread xiaobo
I tried the example with the following testing calcitedatabse class, String sql = "select count(*) from emps"; Schema schema = new ReflectiveSchema(new HrSchema(emps1, depts1)); CalciteDatabase db = new CalciteDatabase(schema, "hr");