Re: Joining JIRA as a contributor

2021-06-10 Thread Haisheng Yuan
Hi Nick,

I have added you to the contributor list.

Haisheng

On 2021/06/11 01:37:59, Nick Riasanovsky  wrote: 
> Hi I'd like to join the JIRA contributor list. My Jira username is njriasan.
> 


Joining JIRA as a contributor

2021-06-10 Thread Nick Riasanovsky
Hi I'd like to join the JIRA contributor list. My Jira username is njriasan.


[jira] [Created] (CALCITE-4648) Except returns wrong results

2021-06-10 Thread Sean Broeder (Jira)
Sean Broeder created CALCITE-4648:
-

 Summary: Except returns wrong results
 Key: CALCITE-4648
 URL: https://issues.apache.org/jira/browse/CALCITE-4648
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.26.0
Reporter: Sean Broeder


select n_nationkey from
(select n_nationkey, n_name from 
(values (0, 'ALGERIA'), (1, 'ARGENTINA'), (2, 'BRAZIL'), (3, 'CANADA'))
as nation(n_nationkey, n_name)
except
select n_nationkey, n_name from 
(values (2, 'BRAZIL'), (3, 'CANADA'), (4, 'EGYPT'))
as nation2(n_nationkey, n_name))

should return 
N_NATIONKEY=0
N_NATIONKEY=1

but returns 
N_NATIONKEY=0
N_NATIONKEY=1
N_NATIONKEY=2
N_NATIONKEY=3



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (CALCITE-4647) intersect returns wrong results

2021-06-10 Thread Sean Broeder (Jira)
Sean Broeder created CALCITE-4647:
-

 Summary: intersect returns wrong results
 Key: CALCITE-4647
 URL: https://issues.apache.org/jira/browse/CALCITE-4647
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.26.0
Reporter: Sean Broeder


select n_nationkey from
(select n_nationkey, n_name from 
(values (0, 'ALGERIA'), (1, 'ARGENTINA'), (2, 'BRAZIL'), (3, 'CANADA'))
as nation(n_nationkey, n_name)
intersect
select n_nationkey, n_name from 
(values (2, 'BRAZIL'), (3, 'CANADA'), (4, 'EGYPT'))
as nation2(n_nationkey, n_name))

should return:
N_NATIONKEY=2
N_NATIONKEY=3

but returns an empty result



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Problem with Spool (de-)serialization

2021-06-10 Thread Julian Hyde
It would be great to unify this. Can you log a JIRA case?

The changes might be breaking. You can mitigate this by making the
reader more liberal (e.g. accept both upper-case and lower-case enum
names), and also by communicating what you intend to change. People
should speak up if they expect the format to be exactly the same
between versions.

It would be useful if you ensure that everything you intend to change
occurs in at least one test, before you make the change. Then the
before-and-after will be clearly visible in the patch.

Julian

On Wed, Jun 9, 2021 at 7:57 AM Konstantin Orlov  wrote:
>
> Yes, it’s possible.
>
> But my concern is the lack of common approach. Here a few examples:
>
> 1) Correlate and Join both explains joinType as lowerName of enum’s value, 
> hence it could be simply restored by relInput.getEnum("joinType", 
> JoinRelType.class)
>
>   @Override public RelWriter explainTerms(RelWriter pw) {
> return super.explainTerms(pw)
> .item("joinType", joinType.lowerName)
> ...
>   }
>
> 2) MultiJoin uses similar approach, but instead of lowerName uses original 
> enum’s name
>
>   @Override public RelWriter explainTerms(RelWriter pw) {
> List joinTypeNames = new ArrayList<>();
> ...
> for (int i = 0; i < inputs.size(); i++) {
>   joinTypeNames.add(joinTypes.get(i).name());
> ...
> }
>
> return pw.item("joinFilter", joinFilter)
> ...
> .item("joinTypes", joinTypeNames)
> ...
>   }
>
> 3) TableModify uses RelEnumTypes.fromEnum(getOperation())) to explain 
> operation type, but uses input.getEnum("operation", Operation.class) to 
> restore it,
> whereas there is RelEnumTypes#toEnum(String) method
>
> 4) Spool explains both types as enum value, and probably will fail during 
> serialisation to json cause 
> org.apache.calcite.rel.externalize.RelJson#toJson(java.lang.Object)
> doesn’t know how to handle enum
>
>   @Override public RelWriter explainTerms(RelWriter pw) {
> return super.explainTerms(pw)
> .item("readType", readType)
> .item("writeType", writeType);
>   }
>
> Does it make any sense to unify this?
>
>
> --
> Regards,
> Konstantin Orlov
>
>
>
>
> > On 8 Jun 2021, at 22:03, Julian Hyde  wrote:
> >
> > Including class names in serialized JSON makes me nervous. It is a common 
> > attack surface. Could we, say, include the name of the enum (without 
> > package name) and map it to a list of supported Enums?
> >
> >> On Jun 8, 2021, at 9:20 AM, Konstantin Orlov  wrote:
> >>
> >> Hi, folks!
> >>
> >> We have a problem with Spool node deserialisation. Currently it explains 
> >> both readType and writeType fields as Enum,
> >> thus those fields being serialized as map:
> >>
> >> {
> >>"id":"2",
> >>"relOp”:"MyTableSpool",
> >>"readType":{
> >>   "class":"org.apache.calcite.rel.core.Spool$Type",
> >>   "name":"LAZY"
> >>},
> >>"writeType":{
> >>   "class":"org.apache.calcite.rel.core.Spool$Type",
> >>   "name":"EAGER"
> >>}
> >> }
> >>
> >> When deserializing, we use RelInput#getEnum which expects the provided tag 
> >> being a string value representing the enum's value name.
> >>
> >> Should we follow the way used for serialization of JoinRelType within the 
> >> Join node (serialize the enum value as its name in lower case)? Here is 
> >> example:
> >>
> >> {
> >>"id":"4",
> >>"relOp”:"MyJoin",
> >>"condition":{
> >>   "op":{
> >>  "name":">",
> >>  "kind":"SqlKind#GREATER_THAN",
> >>  "syntax":"SqlSyntax#BINARY"
> >>   },
> >>   "operands":[
> >>  {
> >> "input":1,
> >> "name":"$1"
> >>  },
> >>  {
> >> "input":4,
> >> "name":"$4"
> >>  }
> >>   ]
> >>},
> >>"joinType":"inner",
> >>"variablesSet":[0],
> >>"correlationVariables":[0],
> >>"inputs":["0","3"]
> >> }
> >>
> >> Or it's better to get the RelInput being able to deserialize enum 
> >> represented as map as well?
> >>
> >> Personally I prefer the first option cause the type of the enum is known 
> >> for sure, so it's better not to waste the time to (de-)serialize it.
> >>
> >>
> >> --
> >> Regards,
> >> Konstantin Orlov
> >>
> >>
> >>
> >>
> >
>


[jira] [Created] (CALCITE-4646) SPNEGO fails with Jetty 9.4.39.v20210325

2021-06-10 Thread Istvan Toth (Jira)
Istvan Toth created CALCITE-4646:


 Summary: SPNEGO fails with Jetty 9.4.39.v20210325
 Key: CALCITE-4646
 URL: https://issues.apache.org/jira/browse/CALCITE-4646
 Project: Calcite
  Issue Type: Bug
  Components: avatica
Reporter: Istvan Toth
Assignee: Istvan Toth


Updating jetty.version to 9.4.39.v20210325
causes several SPENGO tests to fail.
We also see SPNEGO auth breaking in Phoenix Query Server.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)