Question about SqlTypeUtil#equalSansNullability

2024-01-25 Thread P.F. ZHAN
Hi, devs. I have some confuse about the method SqlTypeUtil#equalSansNullability(org.apache.calcite.rel.type.RelDataType, org.apache.calcite.rel.type.RelDataType). For example, the RexCall is *(2, cast(5 as double)), so the first type is BasicSqlType( INTEGER), the second type is

Re: gradle build main branch encounters error

2023-09-24 Thread P.F. ZHAN
Thank you all. I deleted the project and pulled the code again. The problem disappeared. It seems to be an environmental problem. On Sat, Sep 23, 2023 at 12:51 AM P.F. ZHAN wrote: > The step to reproduce step: > > ./gradlew clean > ./gradlew build -x test --info | tee build.log >

Re: gradle build main branch encounters error

2023-09-22 Thread P.F. ZHAN
ache and try again, it will works. > > Best Regards, > Ran Tao > > > P.F. ZHAN 于2023年9月22日周五 02:54写道: > > > I rebased the newest code, and built the code locally > > > > * What went wrong: > > Execution failed for task ':linq4j:forbiddenApisMain'. > > &g

Re: gradle build main branch encounters error

2023-09-21 Thread P.F. ZHAN
It seems caused by the pr of issue, https://issues.apache.org/jira/browse/CALCITE-5920 I revert this pr locally, it works. On Fri, Sep 22, 2023 at 2:54 AM P.F. ZHAN wrote: > I rebased the newest code, and built the code locally > > * What went wrong: > Execution fai

gradle build main branch encounters error

2023-09-21 Thread P.F. ZHAN
I rebased the newest code, and built the code locally * What went wrong: Execution failed for task ':linq4j:forbiddenApisMain'. > de.thetaphi.forbiddenapis.ForbiddenApiException: Check for forbidden API calls failed while scanning class 'org.apache.calcite.linq4j.QueryableRecorder$57':

Re: [Discussion] Can we forbidden SEARCH operator when use other execution engine?

2023-08-09 Thread P.F. ZHAN
; > > > Julian Hyde 于2023年8月9日周三 04:28写道: > > > > > The optimizations are the reason that SEARCH (and Sarg) exist. For the > > > simplifier to handle all of the combinations of <, <=, >, >=, =, <>, > and > > > AND, OR, NOT is prohibitively ex

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-08 Thread P.F. ZHAN
ect-specific operators in calcite includes OFFSET and > ORDINAL for BigQuery. > https://calcite.apache.org/docs/reference.html#dialect-specific-operators > > So you want to be able to write a[x] and it should be interpreted as > a[OFFSET (x)] when using BigQuery? > > Mihai >

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-08 Thread P.F. ZHAN
query/docs/arrays, you seem to need to use > either OFFSET or ORDINAL. > > But I don't see any exception, certainly not a parse exception. > > I don't understand what you mean by "Calcite does not support split > function without array subscript operators." > > Mihai

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-08 Thread P.F. ZHAN
nder if we should support this kind of usage of this function? On Wed, Aug 9, 2023 at 1:23 AM wrote: > The mailing list strips images from emails. > > > > Mihai > > > > From: P.F. ZHAN > Sent: Tuesday, August 08, 2023 10:23 AM > To: dev@calcite.apache.org

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-08 Thread P.F. ZHAN
gt; Mihai > > -Original Message----- > From: P.F. ZHAN > Sent: Tuesday, August 08, 2023 8:21 AM > To: dev@calcite.apache.org > Subject: Re: [Discussion] Split function has some wrong and strange > behaviors > > I rechecked Calcite's implementation of the split

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-08 Thread P.F. ZHAN
t; select split('aaa-bbb-ccc', '-')[ offset(0)] Maybe Calcite should support this kind of usage rather than treat it as a limitation. On Tue, Aug 8, 2023 at 10:31 AM P.F. ZHAN wrote: > Thank you mbudiu, Ran Tao and Lake Shen. > > I have tried your suggestions and debugged the code,

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-07 Thread P.F. ZHAN
> ./gradlew build), you should use > Fixture.forOperators(true) to execute in unit tests. You can check this > usage, hope it helps you. > > > Best Regards, > Ran Tao > https://github.com/chucheng92 > > > P.F. ZHAN 于2023年8月7日周一 15:22写道: > > > Sorry,

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-07 Thread P.F. ZHAN
] I guess this is a bug. On Mon, Aug 7, 2023 at 4:34 PM LakeShen wrote: > Hi P.F ZHAN, > From the exception you posted, it seems that after changing the behavior of > the Split function, you are affecting the results of BIGQUERY. You should > investigate why you are affecting

Re: [Discussion] Split function has some wrong and strange behaviors

2023-08-07 Thread P.F. ZHAN
jupiter.api.AssertionUtils.fail(AssertionUtils.java:38) > at org.junit.jupiter.api.Assertions.fail(Assertions.java:135) > at org.apache.calcite.test.QuidemTest.checkRun(QuidemTest.java:183) > at org.apache.calcite.test.QuidemTest.test(QuidemTest.java:236) > > On

[Discussion] Split function has some wrong and strange behaviors

2023-08-07 Thread P.F. ZHAN
大家好。我在测试 split 函数功能的时候,添加了个 case org.apache.calcite.test.SqlOperatorTest#testSplitFunction > f.checkScalar("SPLIT('h-e-l-l-o', '-')[0]", "h", "VARCHAR"); > 我发现我使用 gradlew build 整个项目时会出错,但我单独在 IDEA 里面执行这个 case 是成功的。 > FAILURE 0.3sec, org.apache.calcite.test.CalciteSqlOperatorTest > >

Re: [Discussion] Can we forbidden SEARCH operator when use other execution engine?

2023-08-04 Thread P.F. ZHAN
n > > > > On Aug 4, 2023, at 7:22 AM, P.F. ZHAN wrote: > > > > Very nice suggestion. I wonder can we introduce this feature by config? > > Maybe it’s better for users using more than one query engine to interpret > > and execute query. > > > >

Re: [Discussion] Can we forbidden SEARCH operator when use other execution engine?

2023-08-04 Thread P.F. ZHAN
> > > > https://github.com/apache/calcite/blob/98f3048fb1407e2878162ffc80388d4f9dd094b2/core/src/main/java/org/apache/calcite/rex/RexSimplify.java#L2132 > > > > Best, > > LakeShen > > > > Soumyadeep Mukhopadhyay 于2023年8月4日周五 20:29写道: > > > > &g

Re: [Discussion] Can we forbidden SEARCH operator when use other execution engine?

2023-08-04 Thread P.F. ZHAN
ptimisations of Calcite when you are using Spark? Is it possible for you > to share a general approach where we will be able to keep the optimisations > done by Calcite and use Spark on top of it? > > > On Fri, 4 Aug 2023 at 5:19 PM, P.F. ZHAN wrote: > > > Generally speaki

[Discussion] Can we forbidden SEARCH operator when use other execution engine?

2023-08-04 Thread P.F. ZHAN
Generally speaking, the SEARCH operator is very good, but when we use Calcite to optimize the logical plan and then use Spark to execute, this is unsupported. So is there a more elegant way to close the SEARCH operator? Or how to convert the SEARCH operator to the IN operator before converting the

Re: Request review code

2023-07-28 Thread P.F. ZHAN
Anyone can help review my pr, the link has been pasted in the issue. On Tue, Jul 25, 2023 at 01:37 P.F. ZHAN wrote: > Related issue: https://issues.apache.org/jira/browse/CALCITE-5860 > >

Discuss: SubQueryRemoveRule sometimes can be convert to inner join to get a more better logical plan

2023-07-27 Thread P.F. ZHAN
Suppose there is a sql like this: select sum(sal), sum(case when hiredate = '2020-01-01' then sal end) from ( select hiredate, sal, job from emp ) a where 1 = 1 and hiredate = ( select max(hiredate) from emp ) The optimized plan as follows: LogicalAggregate(group=[{}], EXPR$0=[SUM($0)],

Request review code

2023-07-24 Thread P.F. ZHAN
Related issue: https://issues.apache.org/jira/browse/CALCITE-5860

Who can help review my pull request?

2023-07-24 Thread P.F. ZHAN
Who can help review my pull request? https://issues.apache.org/jira/browse/CALCITE-5860 https://github.com/apache/calcite/pull/3326