Deduplicate correlate variables question.

2021-05-28 Thread stanilovsky evgeny
Hi, calciters ) I am trying to figure out why DeduplicateCorrelateVariables [1] is called only if withExpand [2] flag is true ? Why we don`t need to deduplicate in appropriate case ? [1] https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelCo

Re: Deduplicate correlate variables question.

2021-06-03 Thread stanilovsky evgeny
s for both code paths. Some day I'd like to officially deprecate, then obsolete, "expand=true". It is de facto deprecated because we put more effort into the "expand=false" path. Julian On Fri, May 28, 2021 at 1:19 AM stanilovsky evgeny wrote: Hi, ca

Re: Deduplicate correlate variables question.

2021-06-03 Thread stanilovsky evgeny
basis of whether it fixes the bug. That may sound like a lot of process. But the alternative is people just randomly changing code. No, this sounds like a proper way ) Ok, i understand you ! On Jun 3, 2021, at 7:37 AM, stanilovsky evgeny wrote: Julian, thanks for reply and comments. Can

[QUESTION] Calcite 1.27.0 Potential Sarg problems

2021-06-11 Thread stanilovsky evgeny
Hello ! After 1.27.0 upgrading i found problems with correctness of condition definition. I have simple query : SELECT * FROM products WHERE name = 'Canon' OR category = 'Video' and table like : 5, "Video", 2, "Camera Media", 21, "Media 3" 6, "Video", 2, "Camera Lens", 22, "Len

Re: [QUESTION] Calcite 1.27.0 Potential Sarg problems

2021-06-11 Thread stanilovsky evgeny
Sorry, my fault, seems no problem on calcite side here. Hello ! After 1.27.0 upgrading i found problems with correctness of condition definition. I have simple query : SELECT * FROM products WHERE name = 'Canon' OR category = 'Video' and table like : 5, "Video", 2, "Camera Media", 2

Re: Deduplicate correlate variables question.

2021-06-30 Thread stanilovsky evgeny
is people just randomly changing code. No, this sounds like a proper way ) Ok, i understand you ! On Jun 3, 2021, at 7:37 AM, stanilovsky evgeny wrote: Julian, thanks for reply and comments. Can you explain, is it would possible to commit PR containing deduplication code moved upper

Contributor rights

2021-06-30 Thread stanilovsky evgeny
Hi, Could you please grant me contributor rights in Calcite JIRA? My username is "zstan". Thank you. Evgeniy.

Re: Deduplicate correlate variables question.

2021-06-30 Thread stanilovsky evgeny
thanks! done, i hope ) Thanks! Can you improve the JIRA subject, so that everyone reading the release notes will understand it? (I had to look up COLLECTION_TABLE.) On Jun 30, 2021, at 5:12 AM, stanilovsky evgeny wrote: Guys, i fill the ticket [1] and PR is ready for check, can anyone

Re: Difficulties writing custom parser in SBT build system

2021-08-30 Thread stanilovsky evgeny
hello, you can take as a starting point this PR for example : https://issues.apache.org/jira/browse/IGNITE-13547 Hello Calcite developers, I am trying to add custom types to the Calcite parser. From what I know, it seems that I need configure a config.fmpp file, modify Parser.jj, and run FMP

COALESCE returns maximum of available CHAR capacity.

2021-09-21 Thread stanilovsky evgeny
hi community ! I found that COALESCE('a', 'bb') will return 'a ' <-- whitespace is present, i found that now it expands for maximum presented CHAR (RelDataType#inferReturnType logic) sql 92 standard tolds: ''' COALESCE (V1, V2) is equivalent to the following : CASE WHEN V1 IS NOT NULL THEN V

Re: COALESCE returns maximum of available CHAR capacity.

2021-09-22 Thread stanilovsky evgeny
sorry for typo, 'fill the ticket' of course )) hi community ! I found that COALESCE('a', 'bb') will return 'a ' <-- whitespace is present, i found that now it expands for maximum presented CHAR (RelDataType#inferReturnType logic) sql 92 standard tolds: ''' COALESCE (V1, V2) is equivalent t

Re: COALESCE returns maximum of available CHAR capacity.

2021-09-22 Thread stanilovsky evgeny
27;a' gets 'a '. I`m wrong ? The current behavior looks ok to me. The expression has type CHAR(2) because the arguments have types CHAR(1) and CHAR(2). So ‘a’ is widened to ‘a ‘. Julian On Sep 22, 2021, at 12:00 AM, stanilovsky evgeny wrote: sorry for typo, 'fill t

Re: COALESCE returns maximum of available CHAR capacity.

2021-09-22 Thread stanilovsky evgeny
null it strange instead of expected 'a' gets 'a '. I`m wrong ? The current behavior looks ok to me. The expression has type CHAR(2) because the arguments have types CHAR(1) and CHAR(2). So ‘a’ is widened to ‘a ‘. Julian On Sep 22, 2021, at 12:00 AM, stanilovsky evgeny wr

Can`t build master of calcite.

2021-10-05 Thread stanilovsky evgeny
hi ! can`t build top of calcite (sha: commit 74e97780add051cb71a122075e5bcbceb) $ ./gradlew build Task :core:compileJava /home/zstan/work/repo/calcite/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java:39: warning: [deprecation] org.apache.calcite.rel.metadata.CachingRelMetada

Re: Can`t build master of calcite.

2021-10-06 Thread stanilovsky evgeny
Thanks, i suppose it`s all ok with java java -version openjdk version "13.0.7" 2021-04-20 OpenJDK Runtime Environment (build 13.0.7+5-Ubuntu-0ubuntu120.04) OpenJDK 64-Bit Server VM (build 13.0.7+5-Ubuntu-0ubuntu120.04, mixed mode) and not ok with: build.gradle.kts ''' val werror by props(true)

Re: Can`t build master of calcite.

2021-10-06 Thread stanilovsky evgeny
s [1] https://issues.apache.org/jira/browse/CALCITE-4798 On Wed, Oct 6, 2021 at 9:31 AM stanilovsky evgeny < estanilovs...@gridgain.com> wrote: Thanks, i suppose it`s all ok with java java -version openjdk version "13.0.7" 2021-04-20 OpenJDK Runtime Environment (build 13.0.7+5

CALCITE-4833 review request.

2021-10-08 Thread stanilovsky evgeny
Guys i found that some kinds of nested subqueries are failed [1]. i.e. SELECT t1.empid FROM emps t1 LEFT JOIN emps t2 ON (SELECT t2.empid)<=100 Fix a little bit hack as for me, but all tests are done. Additionally i fix some redundant gc pressure a bit. Plz make a review. thanks ! [1] https:/

Re: CALCITE-4833 review request.

2021-10-08 Thread stanilovsky evgeny
fixed: gc pressure part still need to additional time, revert this part, all other waiting for review. Guys i found that some kinds of nested subqueries are failed [1]. i.e. SELECT t1.empid FROM emps t1 LEFT JOIN emps t2 ON (SELECT t2.empid)<=100 Fix a little bit hack as for me, but all tes

Re: CALCITE-4833 review request.

2021-10-19 Thread stanilovsky evgeny
Hi calciters ! Look [1] introduces "Support SELECT without FROM syntax" such syntax can be used with join queries, i.e. SELECT t1.empid FROM emps t1 LEFT JOIN emps t2 ON (SELECT t2.empid)<=100 Can anyone review fix or reject it, or reject this lexical construction at all, thus i can close the

Re: calcite multi-threading problem

2022-02-11 Thread stanilovsky evgeny
for example on a current calcite branch: grep janino gradle.properties janino.version=3.1.6 yes, we use drools in the same project,  and drools uses janino too, is there a version list of janino which calcite supports? ---Original--- From: "Dmitry Sysolyatin"

Re: Broken history after force pushing to master

2022-03-09 Thread stanilovsky evgeny
Just notice - github allows to disable a force push into master branch. It's not the first time that we have had small problems with history so no worries. Thankfully with the help of commit@calcite list we can always find a way to fix things as long as we identify the problem soon enough.

[REVIEW REQUEST] CALCITE-5253 NATURAL JOIN erroneous validation.

2022-09-30 Thread stanilovsky evgeny
Hi, I would like to request a review for CALCITE-5253, pr [1], it fixes partially erroneous natural join validaton logic. Thanks ! [1] https://github.com/apache/calcite/pull/2889 [2] https://issues.apache.org/jira/browse/CALCITE-5253

Re: [ANNOUNCE] New committer: Alex Plehanov

2023-01-11 Thread stanilovsky evgeny
Congratulations, Alex! Welcome, Alex! Andrei Sereda 于2023年1月11日周三 01:16写道: Welcome, Alex! On Tue, Jan 10, 2023, 11:01 Stamatis Zampetakis wrote: > Welcome Alex! Looking forward to working with you. > > Best, > Stamatis > > On Tue, Jan 10, 2023 at 2:48 AM Chunwei Lei > wrote: > > > Wel

Insert data exceeding fixed length column.

2023-02-08 Thread stanilovsky evgeny
Hello, seems sql standard regulate situation when insertion (char, varchar) data exceeds fixed len column as : If the declared type T is fixed length string with length in characters L and the length in characters M of V is larger than L, then Case: a) If the right part M–L characters of

Re: Insert data exceeding fixed length column.

2023-02-09 Thread stanilovsky evgeny
execute time. On Feb 8, 2023, at 11:20 PM, stanilovsky evgeny wrote: Hello, seems sql standard regulate situation when insertion (char, varchar) data exceeds fixed len column as : If the declared type T is fixed length string with length in characters L and the length in characters M of V

Re: Insert data exceeding fixed length column.

2023-03-07 Thread stanilovsky evgeny
that query should throw when executed. If it doesn’t, you should log a bug. However, that test in SqlToRelConverterTest doesn’t prove that Calcite doesn’t throw at execute time. On Feb 8, 2023, at 11:20 PM, stanilovsky evgeny wrote: Hello, seems sql standard regulate situation when ins

RelDataTypeSystemImpl#deriveSumType question.

2023-04-25 Thread stanilovsky evgeny
Hello ! Probably can anyone explain why RelDataTypeSystemImpl#deriveSumType returns INTEGER for incoming INTEGER type ? I run simple: SELECT i, SUM(i) FROM integers i1 GROUP BY i ORDER BY i; and i expect that return type will be BIGINT. Did i miss something here ? Thanks !

Re: RelDataTypeSystemImpl#deriveSumType question.

2023-04-25 Thread stanilovsky evgeny
- [2] https://issues.apache.org/jira/browse/CALCITE-1945 Best, Dan Zou 2023年4月25日 19:14,stanilovsky evgeny 写道: Hello ! Probably can anyone explain why RelDataTypeSystemImpl#deriveSumType returns INTEGER for incoming INTEGER type ? I run simple: SELECT i, SUM(i) FROM integers i1 GROUP BY i

Please make a review pr 3211

2023-06-15 Thread stanilovsky evgeny
There is ones more change touching null literals in SUBSTRING func. Can someone make a review plz? https://issues.apache.org/jira/browse/CALCITE-5708 https://github.com/apache/calcite/pull/3211

Re: [DISCUSS] Towards Calcite 1.35.0

2023-07-05 Thread stanilovsky evgeny
[1] Is ready for merging, approvals are obtained. [1] https://github.com/apache/calcite/pull/3211 I finished CALCITE-5701 Add NAMED_STRUCT function (enabled in Spark library) I hope it's not too late for the release: https://github.com/apache/calcite/pull/3295 The CI passes, it just needs a

Re: Force push to calcite main

2023-07-06 Thread stanilovsky evgeny
I already told that community need to vote for prohibit force push. Hello, It appears that there was a force push to main yesterday [1] rewriting the history for a bunch of commits. I don't know if it was intentional or not but it seems that now resolved JIRAs (after CALCITE-5810 I think) are p

Re: Easier and more comprehensive testing

2023-07-28 Thread stanilovsky evgeny
Hello, your github link doesn`t open. plz check discussion here in dev list titled: Running Sql Logic Tests for Calcite This is the JIRA case: https://issues.apache.org/jira/browse/CALCITE-5615 And this is the PR: https://github.com/apache/calcite/pull/3145 Hello, I am working to test our ca

[Question] CAST possibility cases

2023-08-02 Thread stanilovsky evgeny
hello all ! According to sql standard, chapter: 6.22 We can found, for example, that casting from BOOLEAN is deprecated into Exact Numeric, but according to SqlTypeCoercionRule it`s possible for now. Probably i miss something, can someone highlight me in such a case? If no - did i need to fil

Re: [Question] CAST possibility cases

2023-08-03 Thread stanilovsky evgeny
> On Aug 2, 2023, at 5:46 AM, stanilovsky evgeny < estanilovs...@gridgain.com> wrote: > > hello all ! > According to sql standard, chapter: 6.22 > We can found, for example, that casting from BOOLEAN is deprecated into Exact Numeric, but according to SqlTypeCoercionR

Re: DECIMAL(2, 3) meaning

2023-08-04 Thread stanilovsky evgeny
Hello Mihai. A bit older standard describes Precision as : Precision of decimal floating-point values is a positive value that specifies the number of significant decimal digits in the mantissa. Thus: cast(0.012 as DECIMAL(3, 3)) - ok cast(0.012 as DECIMAL(2, 3)) - fail cast(0.012 as DECIMAL(1

Re: DECIMAL(2, 3) meaning

2023-08-06 Thread stanilovsky evgeny
uld fail, but it doesn't. Mihai -Original Message- From: stanilovsky evgeny Sent: Friday, August 04, 2023 7:00 AM To: dev@calcite.apache.org Subject: Re: DECIMAL(2, 3) meaning Hello Mihai. A bit older standard describes Precision as : Precision of decimal floating-point value

Re: DECIMAL(2, 3) meaning

2023-08-08 Thread stanilovsky evgeny
e does, intentionally. Julian > On Aug 6, 2023, at 08:35, stanilovsky evgeny wrote: > > Ok, seems like a bug. > Feel free to fill the issue. > >> I have added this test to SqlOperatorTest: >> >>f.checkScalar("cast(0.012 as DECIMAL(2, 5))", new B

[Question] Working with defaults in calcite.

2023-08-14 Thread stanilovsky evgeny
Hello community ! I just try a simple case, like : create table foo (i int not null, j int default 100); and obtain parser error: parse failed: Encountered "default" at line 1, column 41. while create table foo (i int not null, j int); insert into foo values (1, DEFAULT); throws no exceptio

Re: [Question] Working with defaults in calcite.

2023-08-22 Thread stanilovsky evgeny
://github.com/apache/calcite/blob/main/server/src/test/resources/sql/table.iq On Aug 14, 2023, at 7:40 AM, stanilovsky evgeny wrote: Hello community ! I just try a simple case, like : create table foo (i int not null, j int default 100); and obtain parser error: parse failed: Encountered

Re: [jira] [Created] (CALCITE-5950) Default column constraint is erroneously processed.

2023-08-23 Thread stanilovsky evgeny
PR is ready for review, plz explain did i need to fix all of: CI / CheckerFramework issues ? Seems some of them are false positive. thanks ! Evgeny Stanilovsky created CALCITE-5950:

Re: [jira] [Created] (CALCITE-5950) Default column constraint is erroneously processed.

2023-08-24 Thread stanilovsky evgeny
er, rather than waiting for CI. But you must use JDK 11: ./gradlew --no-parallel --no-daemon -PenableCheckerframework :linq4j:classes :core:classes Julian On Wed, Aug 23, 2023 at 8:42 AM stanilovsky evgeny wrote: > > PR is ready for review, plz explain did i need to fix all of: CI / &g

LITERAL_AGG question

2023-08-28 Thread stanilovsky evgeny
hello, please can someone explain me how LITERAL_AGG need to be correctly serialized\deserealized and how to write appropriate tests. Problem : we have LITERAL_AGG further: toJson(org.apache.calcite.rel.core.AggregateCall) { Map map = map(); map.put("agg", toJson(node.getAggrega

Re: LITERAL_AGG question

2023-08-31 Thread stanilovsky evgeny
extend or modify existing RelJson tests. On Aug 28, 2023, at 7:30 AM, stanilovsky evgeny wrote: hello, please can someone explain me how LITERAL_AGG need to be correctly serialized\deserealized and how to write appropriate tests. Problem : we have LITERAL_AGG further: toJson

Re: [jira] [Created] (CALCITE-5950) Default column constraint is erroneously processed.

2023-09-05 Thread stanilovsky evgeny
e. I find it useful to run checker-framework on my own computer, rather than waiting for CI. But you must use JDK 11: ./gradlew --no-parallel --no-daemon -PenableCheckerframework :linq4j:classes :core:classes Julian On Wed, Aug 23, 2023 at 8:42 AM stanilovsky evgeny wrote: > > PR is re

SqlValidatorImpl#deriveAlias no called any more after refactoring

2023-09-07 Thread stanilovsky evgeny
After refactoring [1] merged between 1.32 and 1.34 ver. SqlValidatorImpl#deriveAlias is not called\used any more from calcite code, thus no one can overwrite it for custom purpose. I decide this is erroneous and need to be fixed. WDYT ? Thanks ! [1] git log --grep='Refactor: Deprecate SqlVa

Re: [jira] [Created] (CALCITE-5950) Default column constraint is erroneously processed.

2023-09-27 Thread stanilovsky evgeny
not-nullable argument, you probably are. I find it useful to run checker-framework on my own computer, rather than waiting for CI. But you must use JDK 11: ./gradlew --no-parallel --no-daemon -PenableCheckerframework :linq4j:classes :core:classes Julian On Wed, Aug 23, 2023 at 8:42 AM stani

Re: CALCITE-5678/CALCITE-5957: Datetime literal validation

2023-10-01 Thread stanilovsky evgeny
Thank you, Stamatis. I vote for direct following the SQL standard, i.e.: only strict SQL standard compliant literals date like 10-1-1 is strange and contain huge field for human errors. Hey everyone, CALCITE-5678, which landed recently in Avatica, enforces strict validation of datetime litera

Re: Minimum Guava version

2023-10-16 Thread stanilovsky evgeny
+1, let`s make ! For the upcoming release 1.36, the default Guava version (and the version we compile with) will change from 19.0 to the latest, 32.1.3-jre [1]. (We were on 19.0 because Druid needed to use 19.0, and due to some API changes in Guava, code compiled on 20 or higher cannot be run on

[Question] Derived type from string expression with NULL parameter

2024-01-12 Thread stanilovsky evgeny
Plz help me to understand is it a bug ? From standard: 6.18 ...cut... ::= { UPPER | LOWER } 6)If is specified, then: a) The declared type of the result of is the declared type of the !!. thus i expect that return type from: SELECT UPPER(null) will be VARCHAR but calcite show : S

Re: [Question] Derived type from string expression with NULL parameter

2024-01-14 Thread stanilovsky evgeny
nction.create("UPPER", ReturnTypes.ARG0_NULLABLE, OperandTypes.CHARACTER, SqlFunctionCategory.STRING); Mihai ________ From: stanilovsky evgeny Sent: Friday, January 12, 2024 4:23 AM To: dev@calcite.apache.org Subject: [Question] Derived ty

Re: [Question] Derived type from string expression with NULL parameter

2024-01-16 Thread stanilovsky evgeny
RCHAR, though. But if this function is wrong, many other functions are wrong. Mihai From: stanilovsky evgeny Sent: Sunday, January 14, 2024 11:57 PM To: dev@calcite.apache.org Subject: Re: [Question] Derived type from string expression with NULL parameter T

Some tests under SqlValidatorTest are disabled with strange annotation

2024-04-26 Thread stanilovsky evgeny
Hi ! I see that some tests are muted under strange annotation: @Disabled("all collation-related tests are disabled due to dtbug 280") who know what does it mean and probably there is corresponding CALCITE issue exist ? thanks !

QUESTION: SUBSTRING implementation

2024-09-04 Thread stanilovsky evgeny
Hi all, i want to discuss current SUBSTRING func implementation. Lets take a standard and found: ::= SUBSTRING FROM [ FOR ] and further : ::= thus it not restrict for only integer types Calcite documentation says: SUBSTRING(string FROM integer FOR integer) (we see restrictions here)

Re: QUESTION: SUBSTRING implementation

2024-09-09 Thread stanilovsky evgeny
ly our usual rules for converting decimal arguments to integers. I am saying let’s define those ‘usual rules’, and apply it to all functions, whether they are in the SQL standard, in a library (such as Postgres or BigQuery) or user-defined functions. Julian On Sep 6, 2024, at 1:02 A

Re: Checked arithmetic

2024-10-03 Thread stanilovsky evgeny
Mihai, thanks for this discussion ! my opinion : select Integer.MAX_VALUE + 1 i.e select 2147483647 + 1 need to raise overflow exception and select 2147483647::bigint + 1 need to return correct result. I don't know what the SQL standard says. I suspect that most DBMS use checked arithmetic. B

Re: literal "type" issues in my database

2024-12-11 Thread stanilovsky evgeny
Just use a cast here. If I do a "create table as select 2" in my database, it creates a TINYINT column. I hope that answers your question. So I need the RelDataType to be of type TINYINT I do have a mechanism to deal with this in my current code a little bit similar to what you're suggest

Question: RelJson(Reader|Writer) purpose and test coverage

2025-01-14 Thread stanilovsky evgeny
Hi, all ! Whats the purpose for RelJson(Reader|Writer) classes, is it just an example how RelNode`s can be serialized? If so - it answers my question. But if it something more seems there is some bugs are present after [1] was implemented, In particular NaN and Inf cannot be correctly deseri

[jira] [Created] (CALCITE-4673) Correlate variables deduplication are not triggers under COLLECTION_TABLE.

2021-06-30 Thread Stanilovsky Evgeny (Jira)
Stanilovsky Evgeny created CALCITE-4673: --- Summary: Correlate variables deduplication are not triggers under COLLECTION_TABLE. Key: CALCITE-4673 URL: https://issues.apache.org/jira/browse/CALCITE-4673