[jira] [Created] (CALCITE-5332) Configuring PruneEmptyRules is cumbersome

2022-10-13 Thread Stamatis Zampetakis (Jira)
Stamatis Zampetakis created CALCITE-5332:


 Summary: Configuring PruneEmptyRules is cumbersome
 Key: CALCITE-5332
 URL: https://issues.apache.org/jira/browse/CALCITE-5332
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.32.0
Reporter: Stamatis Zampetakis
Assignee: Stamatis Zampetakis
 Fix For: 1.33.0


After CALCITE-4787/CALCITE-4839 (release 1.28.0) it is pretty complicated to 
create new PruneEmptyRule instances with slightly different configurations.

The most common use-case is to modify a rule, for instance 
[PruneEmptyProject|https://github.com/apache/calcite/blob/2c30a56158cdd351d35725006bc1f76bb6aac75b/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java#L178],
 and change the operands to enlarge or restrict the matching scope; e.g., 
instead of matching the general {{Project.class}} match only 
{{HiveProject.class}}.

At the moment this task is not straightforward for various reasons.

We cannot create the new rule by obtaining the configuration from the existing 
instance (e.g., PROJECT_INSTANCE) cause the latter is declared as RelOptRule. 
Unless we cast the instance to {{RelRule}} we cannot get access to its 
configuration and change it.

{{ImmutableRemoveEmptySingleRuleConfig}} is package private as every other 
immutable class so again we cannot start from there.

The constructors of {{RemoveEmptySingleRule}} are either deprecated or package 
private so cannot/should not be used.

[RemoveEmptySingleRuleConfig|https://github.com/apache/calcite/blob/2c30a56158cdd351d35725006bc1f76bb6aac75b/core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java#L351]
 does not provide a {{DEFAULT}} configuration instance.

The only way "recommended" way to create a new rule instance at the moment is 
to implement the respective config interface. This is unnecessary and requires 
quite a bit of work if the consumer is not using the immutables library 
annotation processor.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (CALCITE-5333) Query with "WITH" clause is failing after calcite upgrade

2022-10-13 Thread Rish K (Jira)
Rish K created CALCITE-5333:
---

 Summary: Query with "WITH" clause is failing after calcite upgrade
 Key: CALCITE-5333
 URL: https://issues.apache.org/jira/browse/CALCITE-5333
 Project: Calcite
  Issue Type: Bug
  Components: core, extensions
Affects Versions: 1.31.0
Reporter: Rish K


q



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Avatica Pull Requests

2022-10-13 Thread Francis Chuang

Hey everyone,

There are currently 13 open pull requests for Avatica[1]. Since we're 
not in the middle of a Calcite release, would it be possible for 
community members to review and perhaps merge those PRs?


There are a few that look ready to be merged and there are a few that 
are a few years old that could perhaps be closed out. It would be nice 
if we could action on these PRs as there are a few that a few years old 
that are still open.


Francis

[1] https://github.com/apache/calcite-avatica/pulls


Query with "WITH" clause is failing after calcite upgrade

2022-10-13 Thread Rishabh Kedia
Hello,

I have a simple query using "WITH" clause:
"WITH tempTable AS (SELECT * FROM PCOLLECTION WHERE
PCOLLECTION.`user_info`.`name` = 'User1') SELECT * FROM tempTable"

and schema such as:
{
"doc":"More information on the user",
"name":"user_info",
"type":["null", "user_info"],
"default":null
}


This query was running properly with Calcite 1.20. But after upgrade to
Calcite 1.31, the above query is failing with the error:
"java.lang.AssertionError: fieldList must not be null, type = VARCHAR"

I looked through the code but couldnt find a reasonable explanation. Any
idea what could be wrong?

Thanks,
Rishabh Kedia