[jira] [Created] (CALCITE-3087) Mappings.apply2 doesn't keep order

2019-05-22 Thread Haisheng Yuan (JIRA)
Haisheng Yuan created CALCITE-3087:
--

 Summary: Mappings.apply2 doesn't keep order
 Key: CALCITE-3087
 URL: https://issues.apache.org/jira/browse/CALCITE-3087
 Project: Calcite
  Issue Type: Bug
Reporter: Haisheng Yuan


Add the following test to MaterializationTest:

{code:java}
@Test public void testAggregateGroupSetsRollUp0() {
checkMaterialize(
"select \"empid\", \"deptno\", count(*) as c, sum(\"salary\") as s from 
\"emps\" "
+ "group by \"empid\", \"deptno\"",
"select count(*) + 1 as c,  \"deptno\" from \"emps\" group by 
cube(\"deptno\", \"empid\")",
HR_FKUK_MODEL,
CalciteAssert.checkResultContains(
"EnumerableCalc(expr#0..2=[{inputs}], expr#3=[1], "
+ "expr#4=[+($t2, $t3)], C=[$t4], deptno=[$t1])\n"
+ "  EnumerableAggregate(group=[{0, 1}], groups=[[{0, 1}, {0}, 
{1}, {}]], agg#0=[$SUM0($2)])\n"
+ "EnumerableTableScan(table=[[hr, m0]])"));
  }
{code}

We got error:

{code:java}
Caused by: java.lang.IllegalArgumentException: must be sorted: [{0, 1}, {1}, 
{0}, {}]
at 
org.apache.calcite.rel.core.Aggregate$Group.induce(Aggregate.java:472)
at 
org.apache.calcite.rel.mutable.MutableAggregate.getGroupType(MutableAggregate.java:83)
at 
org.apache.calcite.plan.SubstitutionVisitor.unifyAggregates(SubstitutionVisitor.java:1281)
at 
org.apache.calcite.plan.SubstitutionVisitor$AggregateOnProjectToAggregateUnifyRule.apply(SubstitutionVisitor.java:1345)
at 
org.apache.calcite.plan.SubstitutionVisitor.go(SubstitutionVisitor.java:531)
at 
org.apache.calcite.plan.SubstitutionVisitor.go(SubstitutionVisitor.java:466)
at 
org.apache.calcite.plan.MaterializedViewSubstitutionVisitor.go(MaterializedViewSubstitutionVisitor.java:56)
at 
org.apache.calcite.plan.RelOptMaterializations.substitute(RelOptMaterializations.java:200)
at 
org.apache.calcite.plan.RelOptMaterializations.useMaterializedViews(RelOptMaterializations.java:72)
at 
org.apache.calcite.plan.volcano.VolcanoPlanner.registerMaterializations(VolcanoPlanner.java:348)
at 
org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:584)
{code}

The reason is that Mappings.apply2 doesn't sort.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CALCITE-3086) MULTI_FUNCTION mapping is not implemented

2019-05-22 Thread Haisheng Yuan (JIRA)
Haisheng Yuan created CALCITE-3086:
--

 Summary: MULTI_FUNCTION mapping is not implemented
 Key: CALCITE-3086
 URL: https://issues.apache.org/jira/browse/CALCITE-3086
 Project: Calcite
  Issue Type: Improvement
Reporter: Haisheng Yuan


When I create a Mapping with MULTI_FUNCTION type, it throws an exception. It is 
not implemented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (CALCITE-3085) Unused stack field in RelShuttleImpl

2019-05-22 Thread Laurent Goujon (JIRA)
Laurent Goujon created CALCITE-3085:
---

 Summary: Unused stack field in RelShuttleImpl
 Key: CALCITE-3085
 URL: https://issues.apache.org/jira/browse/CALCITE-3085
 Project: Calcite
  Issue Type: Bug
  Components: core
Reporter: Laurent Goujon
Assignee: Laurent Goujon


{{RelShuttleImpl}} class has a  protected {{stack}} field which is being 
populated when going over children, but those content is actually never used. 
In Calcite code base, no subclasses are actually using the content of the stack 
({{CorelMapBuilder}} is populating the stack but does not read the content back 
either).

Searching code on github didn't show any usage of it either (but this is not 
foolprof).

As maintaining this stack has a non-negligible impact on memory/performance, I 
would suggest to remove the field.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Calcite-Master - Build # 1178 - Failure

2019-05-22 Thread Apache Jenkins Server
The Apache Jenkins build system has built Calcite-Master (build #1178)

Status: Failure

Check console output at https://builds.apache.org/job/Calcite-Master/1178/ to 
view the results.

Re: Rejected commits to master

2019-05-22 Thread Julian Hyde
That sounds plausible.

It looks as if the system accepted a commit from Laurent on one repo,
and a commit from me in another, while the repos where not in sync. It
sent emails confirming them, then later lost my commit. The CAP
theorem holds - we had availability in the presence of a partition,
but lost consistency. I'd rather sacrifice availability. Or only let
people commit to one of the repos.

I am worried that Apache INFRA don't realize that a distributed
transactional system is a difficult beast.

Julian

On Wed, May 22, 2019 at 2:17 PM Kevin Risden  wrote:
>
> I think there have been some delays syncing between github and gitbox. I
> think it depends which origin you are pointing at and which commit is there.
>
> Since both github and gitbox are masters, we can actually push to either
> one and I would guess there is some checks to make sure commits don't have
> issues but a pull might be slightly out of date?
>
> Kevin Risden
>
>
> On Wed, May 22, 2019 at 5:12 PM Julian Hyde  wrote:
>
> > I pushed a commit to the master branch this morning and it was
> > rejected due to an intervening commit from Laurent. But that
> > intervening commit did not appear when I did 'git fetch origin'.
> >
> > Just now, I was just able to push successfully. In both cases I used
> > 'git push origin master' from the command line, without the '-f'
> > (force) flag.
> >
> > You can see that both commits generated emails: [1] [3]. Laurent's
> > intervening commit also generated an email: [2].
> >
> > All, Has anyone else seen this behavior?
> >
> > Laurent, What command did you use to commit?
> >
> > Julian
> >
> > [1]
> > https://lists.apache.org/thread.html/ac70079b65305a9040bfe2ed0720768343d2f6dc038b9a63c081ff0b@%3Ccommits.calcite.apache.org%3E
> >
> > [2]
> > https://lists.apache.org/thread.html/bddfd2ad8cbe3148820b334b1554fae23d4e05a2b00967b71e5d7191@%3Ccommits.calcite.apache.org%3E
> >
> > [3]
> > https://lists.apache.org/thread.html/335c042be3fbd042f327e9742d45de790d731d8a7f883294dacf9322@%3Ccommits.calcite.apache.org%3E
> >


Re: Rejected commits to master

2019-05-22 Thread Kevin Risden
I think there have been some delays syncing between github and gitbox. I
think it depends which origin you are pointing at and which commit is there.

Since both github and gitbox are masters, we can actually push to either
one and I would guess there is some checks to make sure commits don't have
issues but a pull might be slightly out of date?

Kevin Risden


On Wed, May 22, 2019 at 5:12 PM Julian Hyde  wrote:

> I pushed a commit to the master branch this morning and it was
> rejected due to an intervening commit from Laurent. But that
> intervening commit did not appear when I did 'git fetch origin'.
>
> Just now, I was just able to push successfully. In both cases I used
> 'git push origin master' from the command line, without the '-f'
> (force) flag.
>
> You can see that both commits generated emails: [1] [3]. Laurent's
> intervening commit also generated an email: [2].
>
> All, Has anyone else seen this behavior?
>
> Laurent, What command did you use to commit?
>
> Julian
>
> [1]
> https://lists.apache.org/thread.html/ac70079b65305a9040bfe2ed0720768343d2f6dc038b9a63c081ff0b@%3Ccommits.calcite.apache.org%3E
>
> [2]
> https://lists.apache.org/thread.html/bddfd2ad8cbe3148820b334b1554fae23d4e05a2b00967b71e5d7191@%3Ccommits.calcite.apache.org%3E
>
> [3]
> https://lists.apache.org/thread.html/335c042be3fbd042f327e9742d45de790d731d8a7f883294dacf9322@%3Ccommits.calcite.apache.org%3E
>


Rejected commits to master

2019-05-22 Thread Julian Hyde
I pushed a commit to the master branch this morning and it was
rejected due to an intervening commit from Laurent. But that
intervening commit did not appear when I did 'git fetch origin'.

Just now, I was just able to push successfully. In both cases I used
'git push origin master' from the command line, without the '-f'
(force) flag.

You can see that both commits generated emails: [1] [3]. Laurent's
intervening commit also generated an email: [2].

All, Has anyone else seen this behavior?

Laurent, What command did you use to commit?

Julian

[1] 
https://lists.apache.org/thread.html/ac70079b65305a9040bfe2ed0720768343d2f6dc038b9a63c081ff0b@%3Ccommits.calcite.apache.org%3E

[2] 
https://lists.apache.org/thread.html/bddfd2ad8cbe3148820b334b1554fae23d4e05a2b00967b71e5d7191@%3Ccommits.calcite.apache.org%3E

[3] 
https://lists.apache.org/thread.html/335c042be3fbd042f327e9742d45de790d731d8a7f883294dacf9322@%3Ccommits.calcite.apache.org%3E


Windows breakage

2019-05-22 Thread Julian Hyde
My latest change broke CI on windows. Sorry! I’ll fix in the next couple of 
hours. 

Julian

Re: Avatica tags in Calcite repository

2019-05-22 Thread Francis Chuang
I think this happens when a new Calcite release is created. Notice that 
the Avatica 1.14.0 and 1.15.0 tags are not in the Calcite repository 
(for now). My feeling is that it's the configuration of the Maven 
release plugin.


On 22/05/2019 9:49 pm, Michael Mior wrote:

This is probably a question for INFRA since I doubt anyone has been
doing this explicitly. I don't think it's a huge problem, but it would
be good to stop that.

--
Michael Mior
mm...@apache.org

Le mar. 21 mai 2019 à 19:34, Francis Chuang  a écrit :


I just noticed that tags for Avatica are being pushed to the Calcite
repository [1].

Is this intended? My understanding is that since Avatica was split into
its own repository in early 2016, it's considered a separate sub-project
of Calcite.

Francis

[1] https://github.com/apache/calcite/releases


Re: Avatica tags in Calcite repository

2019-05-22 Thread Michael Mior
This is probably a question for INFRA since I doubt anyone has been
doing this explicitly. I don't think it's a huge problem, but it would
be good to stop that.

--
Michael Mior
mm...@apache.org

Le mar. 21 mai 2019 à 19:34, Francis Chuang  a écrit :
>
> I just noticed that tags for Avatica are being pushed to the Calcite
> repository [1].
>
> Is this intended? My understanding is that since Avatica was split into
> its own repository in early 2016, it's considered a separate sub-project
> of Calcite.
>
> Francis
>
> [1] https://github.com/apache/calcite/releases


Re: Has issue when parse DDL file using SqlDdlParserImpl

2019-05-22 Thread Michael Mior
Please do! The more examples of working code the better. This is the
sort of thing I would love to add to
http://github.com/michaelmior/calcite-notebooks
--
Michael Mior
mm...@apache.org

Le mar. 21 mai 2019 à 21:39, Yuzhao Chen  a écrit :
>
> Sorry I only found the grammar template in our site [1] and some simple test 
> demos in ServerParserTest [2].
>
> I think we should support detail doc with demos of all kinds of supported 
> DDLs and DMLs, will fire a JIRA about this.
>
> [1] http://calcite.apache.org/docs/reference.html#ddl-extensions
> [2] 
> https://github.com/apache/calcite/blob/61b858db13c2e1997e92172a09f38c639ffdceee/server/src/test/java/org/apache/calcite/test/ServerParserTest.java#L136
>
> Best,
> Danny Chan
> 在 2019年5月22日 +0800 AM7:19,Phạm Minh Đức ,写道:
> > Dear Dev Team's Apache Calcite,
> > My name is Duc. I'm working at Toshiba Group in Vietnam.
> > I'm implementing how to parser DDL file using library Apache Calcite.
> > I'm trying with below solution, but has exception is thrown and i don't 
> > know that why.
> > InputStream ddlFile = new FileInputStream("ddlTest.sql");
> > SqlDdlParserImpl ddlParser = new SqlDdlParserImpl(ddlFile,"UTF8");
> > SqlNode node = ddlParser.SqlStmt();
> > Could you please send me a example of DDL file or give me a suggestion 
> > about this proplem.
> > Thank you very much for your hear m !
> > Best regards,
> > Pham Minh Duc.
> > --
> > This mail was scanned by BitDefender
> > For more information please visit http://www.bitdefender.com