[jira] [Created] (CALCITE-4900) NullPointerException when send ExectuteRequest via protobuf with no parameters

2021-11-24 Thread Aleksey Stavrov (Jira)
Aleksey Stavrov created CALCITE-4900: Summary: NullPointerException when send ExectuteRequest via protobuf with no parameters Key: CALCITE-4900 URL: https://issues.apache.org/jira/browse/CALCITE-4900

Calcite to build a query

2021-11-24 Thread Sandeep Nayak
Hello, I have been looking for a library which will allow me to use an object tree to generate a SQL. Calcite came up in my search but after taking a look at the codebase my conclusion is that Calcite provides the ability to parse SQL statements into an object tree represented as SQLNode (and deri

Re:Calcite to build a query

2021-11-24 Thread Zhe Hu
Hi, Sandeep If I'm understanding you correctly, it seems that you wanna find a way to transfer a SqlNode or RelNode to SQL statement. As far as I know, you can take a look at SqlNode, where the SqlNode can be transferred to SQL expression through toString() method. And, RelToSqlConverterTest ill

Re: Calcite to build a query

2021-11-24 Thread Cyril Catheu
I'm not a Calcite expert but I've recently worked on a project involving parsing and reconstructing SQL with Calcite. You may want to have a look at the toSqlString

Re: Calcite to build a query

2021-11-24 Thread Florent Martineau
Hi Sandeep, I'm no expert so take what I'm saying with a grain of salt. I use Calcite to generate queries by using the RelBuilder, which will create RelNodes that I can then convert to SQL when I need to execute the query. >From my understanding, if we use Relational Algebra it's because it's mu

[jira] [Created] (CALCITE-4901) RelToSqlConverter adds redundant order by output column for the result sql

2021-11-24 Thread yanjing.wang (Jira)
yanjing.wang created CALCITE-4901: - Summary: RelToSqlConverter adds redundant order by output column for the result sql Key: CALCITE-4901 URL: https://issues.apache.org/jira/browse/CALCITE-4901 Projec

Re: Support for more data types

2021-11-24 Thread Ricardo Peres
Hi Julian, Thanks for your reply. We will create a ticket and start working on supporting SQLXML type for now, this should allow us to familiarise with the source code and potentially work on other not supported standard data types in the future. Kind regards. Ricardo Peres. On Mon, 22 Nov 2021

[jira] [Created] (CALCITE-4902) Support for SQLXML type in Avatica

2021-11-24 Thread Ricardo Peres (Jira)
Ricardo Peres created CALCITE-4902: -- Summary: Support for SQLXML type in Avatica Key: CALCITE-4902 URL: https://issues.apache.org/jira/browse/CALCITE-4902 Project: Calcite Issue Type: Task

How to avoid Planner rewriting RelNodes ?

2021-11-24 Thread Florent Martineau
Hi all! I'm using RelBuilder to create RelNodes, that I then save as JSON using RelJsonWriter. When doing so, it seems to me that the planner rewrites my query. For instance, if I set a filter that will always be false, it rewrites my query so that it basically outputs nothing. For instance, addi

Re: UNNEST in relational algebra

2021-11-24 Thread Stamatis Zampetakis
Hi Daniel, If you are able to create a valid SQL for the plan using the CalciteSqlDialect then the fact that it is not possible to do so using BigQuerySqlDialect is likely a bug. Please log a JIRA if that's the case. What happens when you parse some of the example SQL queries you mentioned above.

[jira] [Created] (CALCITE-4903) Avatica pads values returned from values-clause to same length

2021-11-24 Thread Magnus Mogren (Jira)
Magnus Mogren created CALCITE-4903: -- Summary: Avatica pads values returned from values-clause to same length Key: CALCITE-4903 URL: https://issues.apache.org/jira/browse/CALCITE-4903 Project: Calcite

Re: Calcite to build a query

2021-11-24 Thread Sandeep Nayak
Thanks all for the pointer to go with the relational algebra approach. I will work with that route, I did have a follow up question on that path. Is there support in the RelBuilder to apply predicates on JSON data stored in a single column in a table? I noted tests in RelToSqlConverterTest for que

Possible SqlConverter issue?

2021-11-24 Thread Tremper, Diego (ESI)
Hello, First, thanks to this community for supporting this amazing project. I’m using Calcite to convert sql statements into relational algebra, when running my tests with assertions enabled I’m facing the following issue to a specific statement: java.lang.AssertionError: All correlation variab

Re: Why calcite does not support outer join in materialized view

2021-11-24 Thread hongkang jiang
I found a reason for not supporting materialized view outer join. There is the verification code in JoinOnLeftCalcToJoinUnifyRule class apply() method: if (joinRelType != JoinRelType.INNER && !(joinRelType.isOuterJoin() && qInput1Cond.isAlwaysTrue())) { return null; } then, I try to remove

Re: ProjectRemoveRule replaces project with its input ignoring alias

2021-11-24 Thread Jacques Nadeau
Are you looking at the RelRoot's field names or the field names of the RelNodes in the plan? The names of the fields in RelNodes are semantically meaningless in Calcite's eyes (rule semantics are based on ordinal position, not field name). The validated row type (and correct field names) may only e