[jira] [Created] (CALCITE-3276) Add MV rules to match Join on compensating Project(s)

2019-08-21 Thread jin xing (Jira)
jin xing created CALCITE-3276:
-

 Summary: Add MV rules to match Join on compensating Project(s)
 Key: CALCITE-3276
 URL: https://issues.apache.org/jira/browse/CALCITE-3276
 Project: Calcite
  Issue Type: Sub-task
  Components: core
Reporter: jin xing






--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Re: Match Converter Rule based on Child Nodes

2019-08-21 Thread Stamatis Zampetakis
The Volcano planner works in a top-down fashion. It starts by transforming
the root and move towards the leafs of the plan. Due to this when
transforming a logical join its inputs are still in the logical convention
so in principle they should not have any physical properties.

Normally when the physical join algorithm is chosen the respective rule
should be responsible for demanding the inputs of the join to have certain
properties.

Long story short, I think in your use case you should not make the rule
match based on the properties of the child nodes but it should match
unconditionally and if necessary demand some properties in its inputs. If I
remember well the EnumerableMergeJoinRule follows this approach so you can
have a look there.

Best,
Stamatis

On Tue, Aug 20, 2019, 5:07 PM Michael Mior  wrote:

> If you just want to control whether the rule gets applied, you can
> override RelOptRule#matches which canreturns a boolean indicating
> whether the rule should be applied.
> --
> Michael Mior
> mm...@apache.org
>
> Le ven. 9 août 2019 à 08:48, rahul patwari
>  a écrit :
> >
> > Hi,
> >
> > We want to create a ConverterRule which converts the default calling
> > Convention to external storage-specific calling convention depending on
> the
> > Children nodes, like RelOptRule.
> >
> > For example, depending on the properties of the child nodes, we want to
> > convert LogicalJoin to external system's specific Join implementation.
> >
> > Currently, ConverterRule
> > <
> https://github.com/apache/calcite/blob/5212d6c47e36995943f4d955a1714bf03eb08e7e/core/src/main/java/org/apache/calcite/rel/convert/ConverterRule.java#L75
> >
> > cannot take Children and Child Policy is
> RelOptRuleOperandChildPolicy.ANY.
> >
> > What is the preferred way to achieve this task?
> >
> > Thanks,
> > Rahul
>


[jira] [Created] (CALCITE-3277) calcite-avatica-go: panic: proto: can't skip unknown wire type 4

2019-08-21 Thread Shurmin Evgeniy (Jira)
Shurmin Evgeniy created CALCITE-3277:


 Summary: calcite-avatica-go: panic: proto: can't skip unknown wire 
type 4
 Key: CALCITE-3277
 URL: https://issues.apache.org/jira/browse/CALCITE-3277
 Project: Calcite
  Issue Type: Bug
  Components: avatica-go
Reporter: Shurmin Evgeniy
Assignee: Francis Chuang


I can't perform simple query to druid using 
{{github.com/apache/calcite-avatica-go. }}

Code:

{{package main}}

{{import (}}
{{ "database/sql"}}
{{ "fmt"}}
{{ _ "github.com/apache/calcite-avatica-go/v4"}}
{{)}}

{{func main() {}}
{{ db, err := sql.Open("avatica", 
"http://:/druid/v2/sql/avatica/";)}}
{{ if err != nil \{ panic(err) }}}
{{ rows, err := db.Query(`SELECT * FROM sys.servers`)}}
{{ if err != nil \{ panic(err) }}}
{{ defer func() {}}
{{ if err := rows.Close(); err != nil \{ panic(err) }}}
{{ }()}}
{{ for rows.Next() {}}
{{ var server, host float64}}
{{ err = rows.Scan(&server, &host)}}
{{ if err != nil \{ panic(err) }}}
{{ fmt.Printf("server: %v, host: %v\n", server, host)}}
{{ }}}
{{}}}

Console:

{{panic: proto: can't skip unknown wire type 4}}
{{goroutine 1 [running]:main.main() main.go:17 +0x30d}}
{{Process finished with exit code 2}}

Golang:

{{go version go1.12.7 darwin/amd64}}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-3278) Simplify the use to translate RexNode to Expression for evaluating

2019-08-21 Thread Wang Yanlin (Jira)
Wang Yanlin created CALCITE-3278:


 Summary: Simplify the use to translate RexNode to Expression for 
evaluating
 Key: CALCITE-3278
 URL: https://issues.apache.org/jira/browse/CALCITE-3278
 Project: Calcite
  Issue Type: Improvement
  Components: core
Reporter: Wang Yanlin


 The method *forAggregation* of *RexToLixTranslator*  is designed to work for 
translating aggregate functions, with some parameters that we actually do not 
need, if we just want to translate a single RexNode. 
We lack a more common sense function to get an instance of RexToLixTranslator. 
And, the translated expression is a *ParameterExpression*, not fit for 
evaluating. When evaluating, we get an exception like this

{code:java}
java.lang.RuntimeException: parameter v not on stack

at org.apache.calcite.linq4j.tree.Evaluator.peek(Evaluator.java:51)
at 
org.apache.calcite.linq4j.tree.ParameterExpression.evaluate(ParameterExpression.java:55)
at 
org.apache.calcite.linq4j.tree.GotoStatement.evaluate(GotoStatement.java:97)
at 
org.apache.calcite.linq4j.tree.BlockStatement.evaluate(BlockStatement.java:83)
at org.apache.calcite.linq4j.tree.Evaluator.evaluate(Evaluator.java:55)
at 
org.apache.calcite.linq4j.tree.FunctionExpression.lambda$compile$0(FunctionExpression.java:87)
at 
org.apache.calcite.adapter.enumerable.RexToLixTranslatorTest.testRawTranslateRexNode(RexToLixTranslatorTest.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at 
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
{code}




--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Created] (CALCITE-3279) java.lang.ExceptionInInitializerError

2019-08-21 Thread xzh_dz (Jira)
xzh_dz created CALCITE-3279:
---

 Summary: java.lang.ExceptionInInitializerError
 Key: CALCITE-3279
 URL: https://issues.apache.org/jira/browse/CALCITE-3279
 Project: Calcite
  Issue Type: Bug
Reporter: xzh_dz
 Attachments: image-2019-08-21-23-17-02-049.png

When i run the SparkRules main method.And i get the exception as below.

!image-2019-08-21-23-17-02-049.png!



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Applying to be contributor

2019-08-21 Thread Rui Wang
Hi,

Can I have contributor permission such that I can take some JIRA? Here is
my JIRA id: amaliujia



-Rui


Re: Applying to be contributor

2019-08-21 Thread Francis Chuang

Hi Rui,

I've added your jira account to the contributor role.

Francis

On 22/08/2019 3:04 am, Rui Wang wrote:

Hi,

Can I have contributor permission such that I can take some JIRA? Here is
my JIRA id: amaliujia



-Rui



[jira] [Created] (CALCITE-3280) Cannot parse query REGEXP_REPLACE in Redshift

2019-08-21 Thread Ryan Fu (Jira)
Ryan Fu created CALCITE-3280:


 Summary: Cannot parse query REGEXP_REPLACE in Redshift
 Key: CALCITE-3280
 URL: https://issues.apache.org/jira/browse/CALCITE-3280
 Project: Calcite
  Issue Type: Improvement
Reporter: Ryan Fu


REGEXP_REPLACE error:

No match found for function signature REGEXP_REPLACE(, , 
)

 

Example query:

 

{{}}
{code:java}

{code}
{{ SELECT * , MD5(TRIM(BOTH ' ' FROM REGEXP_REPLACE(LOWER(name), 
'([[:space:]]|\\,)+([iInNcC]|[lLcC]).*$', ''))) AS company_id FROM 
public.account}}

 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[DISCUSS] ANTLR4 parse template for Calcite ?

2019-08-21 Thread Danny Chan
Now some of our fellows want to do the syntax promote in the WEB page, and they 
what a parser in the front-page; The ANTLR4 can generate JS parser directly but 
JAVACC couldn’t.

So I’m wondering do you have the similar requests ? And do you think there is 
necessity to support ANTLR4 g4 file in Calcite ?


Best,
Danny Chan


[jira] [Created] (CALCITE-3281) Support mixed Primitive types for BinaryExpression evaluate method.

2019-08-21 Thread Wang Yanlin (Jira)
Wang Yanlin created CALCITE-3281:


 Summary:  Support mixed Primitive types for BinaryExpression 
evaluate method.
 Key: CALCITE-3281
 URL: https://issues.apache.org/jira/browse/CALCITE-3281
 Project: Calcite
  Issue Type: Bug
Reporter: Wang Yanlin


{code:java}
// code placeholder
{code}
Currently, the value of [expression0 |http://www.baidu.com/] and [expression1|] 
should be



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Re: [DISCUSS] ANTLR4 parse template for Calcite ?

2019-08-21 Thread Julian Hyde
ANTLR isn’t significantly better than, or worse than, JavaCC, but it’s 
different. So translating to ANTLR would be a rewrite, and would be a HUGE 
amount of work.



> On Aug 21, 2019, at 8:01 PM, Danny Chan  wrote:
> 
> Now some of our fellows want to do the syntax promote in the WEB page, and 
> they what a parser in the front-page; The ANTLR4 can generate JS parser 
> directly but JAVACC couldn’t.
> 
> So I’m wondering do you have the similar requests ? And do you think there is 
> necessity to support ANTLR4 g4 file in Calcite ?
> 
> 
> Best,
> Danny Chan