Re: Support Graph Query In Calcite

2023-06-21 Thread Julian Hyde
I’ll reiterate what Stamatis said: log Jira tickets. Most of us know only vaguely what a graph query is. A well-written Jira case (describing the problem, with a couple of good SQL examples) will educate the people who would be reviewing the PR. > On Jun 20, 2023, at 10:42 PM, pzwpzw > wrote:

Re: VARIANT and JSON data types

2023-06-21 Thread Julian Hyde
https://issues.apache.org/jira/browse/CALCITE-4918 > On Jun 21, 2023, at 6:41 PM, wrote: > > Hello, > > > > I have a question about Calcite and fancier data types. > > It looks like Calcite JSON operations are really implemented by treating > JSON as a string. I expect that this is expens

Re: [DISCUSS] Towards Calcite 1.35.0

2023-06-23 Thread Julian Hyde
se/CALCITE-5479 and >>> https://issues.apache.org/jira/browse/CALCITE-5477 to be fixed in 1.35.0. >>> There are PRs for both of these fixes. We are working on addressing review >>> comments and just need a few days of time. >>> >>> On Thu, Jun 1, 2023 at 3

Re: [ANNOUNCE] New committer: Zhe Hu

2023-06-28 Thread Julian Hyde
Thanks for your contributions, and welcome to the team! Julian > On Jun 28, 2023, at 8:52 AM, Michael Mior wrote: > > Congratulations and welcome Zhe Hu! > -- > Michael Mior > mm...@apache.org > > > On Wed, Jun 28, 2023 at 7:04 AM Stamatis Zampetakis > wrote: > >> Apache Calcite's Project

Re: [ANNOUNCE] New committer: Jacky Lau

2023-06-28 Thread Julian Hyde
Welcome, Jacky! Thanks for your excellent PRs. Julian > On Jun 28, 2023, at 8:51 AM, Michael Mior wrote: > > Congratulations and welcome Jacky! > -- > Michael Mior > mm...@apache.org > > > On Wed, Jun 28, 2023 at 6:47 AM Stamatis Zampetakis > wrote: > >> Apache Calcite's Project Management

Re: [DISCUSS] Towards Calcite 1.35.0

2023-06-28 Thread Julian Hyde
ere are some issue statuses that need to be resolved: >> >> >> 1. https://issues.apache.org/jira/browse/CALCITE-5764(The PR has >> merge.But issue is IN PROGRESS). (Assigine Julian Hyde) >> 2. https://issues.apache.org/jira/browse/CALCITE-5706(The PR has >

Re: Optimal way to organize Joins in Calcite

2023-07-03 Thread Julian Hyde
The reason that there are two strategies is because of large joins. If your query joins 10 tables, the number of possible join orders is large (bounded by 10 factorial I believe) and therefore would overwhelm the Volcano planner, which must construct each possibility. Therefore we have a heuri

Re: [DISCUSS] Towards Calcite 1.35.0

2023-07-05 Thread Julian Hyde
, I reviewed CALCITE-5708 and CALCITE-5727, which are >>> two I felt I understood well enough to review. >>> >>> On 2023/06/28 19:36:16 Julian Hyde wrote: >>> > I have taken care of 1, 2, 3, 4. >>> > >>> > Tanner, can you do 5. >>&

Re: [DISCUSS] Towards Calcite 1.35.0

2023-07-05 Thread Julian Hyde
I’ve been working on a few lint improvements in https://github.com/julianhyde/calcite/tree/-lint. I’ll merge those in (rules and fixes) before the release. > On Jul 5, 2023, at 11:26 AM, Julian Hyde wrote: > > I don’t think CALCITE-5701 (named_struct) is ready. (I had imagine

Re: Draft: board report for 2023 Q2

2023-07-05 Thread Julian Hyde
--+-+-+ >>>> | 2023| 4 | 17 | >>>> | 2023| 5 | 21 | >>>> | 2023| 6

Re: [ANNOUNCE] New committer: TJ Banghart

2023-07-05 Thread Julian Hyde
Welcome, TJ! Thank you for your work on both Calcite and Avatica. As you’re my colleague, I know what you do, but please feel free to introduce yourself to the community. Julian > On Jul 4, 2023, at 7:11 PM, Jiajun Xie wrote: > > Congratulations, TJ! > > On Wed, 5 Jul 2023 at 01:03, Tanner

Re: [ANNOUNCE] New committer: Dan Zou

2023-07-05 Thread Julian Hyde
Welcome, Dan! And thank you for your contributions so far. > On Jul 4, 2023, at 7:12 PM, Jiajun Xie wrote: > > Congratulations, Dan! > > On Tue, 4 Jul 2023 at 19:48, Runkang He wrote: > >> Congratulations, Dan! >> >> Best, >> Runkang He >> >> Jacky Lau 于2023年7月4日周二 18:56写道: >> >>> Congrat

Re: Java Doc about RexProgramBuilderBase

2023-07-07 Thread Julian Hyde
People refactoring code should remember that their IDE can move and rename fields but is not so good at changing documentation. (Maybe in a couple of years, with advances in generative AI?!) And when documentation and code don’t line up, people don’t trust either. (I’m as guilty of this as anyo

Re: Force push to calcite main

2023-07-07 Thread Julian Hyde
> I prefer keeping force push in place +1. I use force push about a dozen times a year and hopefully no one notices. It helps the commit history clean. I know that force pushes can confuse CI systems and make things confusing to other users, so I try to be judicious. I trust other committers to

Re: Force push to calcite main

2023-07-07 Thread Julian Hyde
ted to force push, I would rebase to incorporate their changes > if possible, and make sure I notify whoever pushed. > > -- > Michael Mior > mm...@apache.org > > > On Fri, Jul 7, 2023 at 2:19 PM Julian Hyde wrote: > >>> I prefer keeping force push in pl

Fwd: Data Engineering track for Community Over Code NA is calling for presentations

2023-07-07 Thread Julian Hyde
Calcite community members, As the message below says, the CFP for Community Over Code North America closes in a few days. It would be great if there were talks about Calcite. Consider submitting to the Data Engineering track (see below), the Big Data track and the Geospatial track. Also consider

Re: Developing a new SqlDialect

2023-07-11 Thread Julian Hyde
I see those problems too. A major problem is that when you start a new dialect, there are no tests. And that’s because our dialect test does not execute queries, only compares generated SQL (and those SQL fragments need to be entered by hand). There’s a good reason that our dialect test does no

Re: [VOTE] Release Apache Calcite 1.35.0 (release candidate 0)

2023-07-16 Thread Julian Hyde
I don’t think the short links are an improvement to the vote email. The release notes could be improved. I think CONVERT counts as a new feature. Puffin and PairList do not (they’re utility classes). There are so many new functions this time, how about adding a new section, and sorting them a

Re: Window functions frame_exclusion

2023-07-16 Thread Julian Hyde
It would be good to have this as a feature. Are you proposing to fully implement the feature (I.e. add to parser, validator, and Enumerable convention, so that we can execute such queries) or just add it to the parser? I think our users might be confused or frustrated if the parser supports the

Re: [VOTE] Release Apache Calcite 1.35.0 (release candidate 3)

2023-07-23 Thread Julian Hyde
+1 Downloaded; checked signatures; checked LICENSE, NOTICE; built and ran tests on Linux using Gradle 7.4.2 and OpenJDK 18.0.2; ran rat. Notes: * Please add your signature to KEYS. I had to import from xiong.asc manually. * The parser generator reports a choice conflict on the "TRUNCATE" keywor

Re: [Help Needed] Dissecting CTE out of Calcite LogicPlan

2023-07-26 Thread Julian Hyde
Your images did not come through (ASF mail server strips them from all emails) but I’ll try my best to answer. As you note, we added the Spool operator to model the case where the RelNode tree is a DAG (one node has more than one consumer). But other than that, relational algebra doesn’t have a

Re: Community over Code (ApacheCon) East Asia

2023-07-31 Thread Julian Hyde
Calcite and Flink). > > Hope to see you guys there! > > [1] https://apachecon.com/acasia2023/sessions/keynote-1234.html > > Julian Hyde 于2023年6月12日周一 05:15写道: > >> Community over Code (ApacheCon) East Asia is happening in August, and >> the call for papers close

Re: Empty array literal

2023-08-01 Thread Julian Hyde
I don’t know - maybe it’s not in the sql standard? Can’t deduce a type? Any existing issues logged? Julian > On Jul 31, 2023, at 6:35 PM, mbu...@gmail.com wrote: > > Hello, > > > > It looks to me like the Calcite grammar does not accept empty array literals > "ARRAY[]". > > This sounds lik

Re: PR CALCITE-5681 Review Request

2023-08-01 Thread Julian Hyde
I took a very quick look. This looks very well structured (with nice abstractions Principal, Grant and Revoke commands, and I like how you have made the parser extensible). This is definitely worth reviewing and getting to complation. * Terminology. You have made Grant and Revoke sub-classes of

Re: Creating user-defined functions dynamically

2023-08-01 Thread Julian Hyde
When you prepare a statement you can provide an instance of SqlOperatorTable that contains any functions you desire. (The ‘fun’ JDBC connect string parameter is just one means to construct such a table. It happens to be particularly convenient for people who wish to create a connection by writin

Re: [Question] CAST possibility cases

2023-08-02 Thread Julian Hyde
I think there’s at least one jira case discussing Boolean cast. Can you locate it? > On Aug 2, 2023, at 5:46 AM, stanilovsky evgeny > wrote: > > hello all ! > According to sql standard, chapter: 6.22 > We can found, for example, that casting from BOOLEAN is deprecated into Exact > Numeric,

Re: AggregateProjectPullUpConstantsRule not working with the Volcano Planner

2023-08-03 Thread Julian Hyde
The constraints on a RelSubset should be the union of the constraints of all of the RelNodes in that subset. (I haven’t tested it, or read the code. But if it doesn’t do that, you’re probably seeing a bug, or you haven’r configured your metadata providers correctly.) > On Aug 3, 2023, at 9:33 A

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

2023-08-04 Thread Julian Hyde
I agree that it should be solved ‘by config’ but not by global config. The mere fact that you are talking to Spark (i.e. using the JDBC adapter with the Spark dialect) should be sufficient right? Put another way. Calcite’s internal representation for expressions is what it is. The fact that SEA

Re: DECIMAL(2, 3) meaning

2023-08-06 Thread Julian Hyde
As I commented in https://issues.apache.org/jira/browse/CALCITE-5901, I don’t think it’s a bug to support behavior beyond what the standard requires. Which Calcite does, intentionally. Julian > On Aug 6, 2023, at 08:35, stanilovsky evgeny > wrote: > > Ok, seems like a bug. > Feel free to f

Re: [DISCUSS] Increase the default maximum precision and scale of the number type

2023-08-07 Thread Julian Hyde
Calcite works best when it is able to execute the SQL that it accepts. If we were to allow say DECIMAL(200, 5) we would need to be able to generate Java code that can handle values of that type. The current maximum, DECIMAL(19), can be handled by 64-bit signed integers (Java long). > On Aug 7,

Re: Extending SqlColumnDeclaration

2023-08-07 Thread Julian Hyde
Intentional. See https://github.com/apache/calcite/blob/98f3048fb1407e2878162ffc80388d4f9dd094b2/core/src/main/java/org/apache/calcite/sql/ddl/package-info.java#L25: * If you are writing a project that requires DDL it is likely that your * DDL syntax is different than ours. We recommend that yo

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

2023-08-08 Thread Julian Hyde
> implement an equivalent transformation within Kylin, or even exploring the > possibility of creating a similar implementation in other execution engines > like Spark. > > On Sat, Aug 5, 2023 at 2:57 AM Julian Hyde wrote: > >> I agree that it should be solved ‘by config’ bu

Re: [Question] What is meaning of tablesample substitute('medium')?

2023-08-08 Thread Julian Hyde
It substitutes a named data set for a table. We added it to support SQLstream, a streaming SQL system. When developing streaming queries, it was sometimes convenient to substitute a table for a stream, because the table had predictable results and didn’t need another process inserting the rows.

Re: Why is Filter's condition required to be flat?

2023-08-09 Thread Julian Hyde
Flattened expressions - so that AND never contains a child that is AND, and OR never contains a child that is OR - is a canonized form that seems to have more advantages than disadvantages. It's never larger than the original (unlike CNF and DNF), frequently smaller than the original, doesn't take

Re: TimeString

2023-08-11 Thread Julian Hyde
In compilers it is a best practice to represent literals using exact, unbounded precision values. In Calcite we use BigDecimal for numbers and TimeString (TimestampString, DateString) for date and time literals. At runtime there are different considerations. We need a representation that is space

Re: TimeString

2023-08-11 Thread Julian Hyde
ince it > precludes using high precision time values. > > Mihai > > On Fri, Aug 11, 2023 at 2:50 PM Julian Hyde wrote: > >> In compilers it is a best practice to represent literals using exact, >> unbounded precision values. In Calcite we use BigDecimal for numbers

Re: Understanding the RelMdColumnUniqueness private constructor

2023-08-14 Thread Julian Hyde
I checked a few other RelMdXxx classes, and. they have private constructors too. Which makes sense, because you don’t extend metadata providers by subclassing. You just define your own provider and add it to the chain. RelMdColumnUniqueness has public static final RelMetadataProvider SOURCE =

Re: [Question] Working with defaults in calcite.

2023-08-14 Thread Julian Hyde
If you way there are no execution tests, I wouldn’t be surprised. DDL was historically deemed out of scope, and what we didn’t implement, we couldn’t test. But now we have the ’server’ component, and there are tests such as table.iq [1]. Can you add some tests? Julian [1] https://github.com

Re: [Discussion] Make SubTreeHintPropagateShuttle hint that match the search layer can be configured

2023-08-14 Thread Julian Hyde
I haven’t had time to review your code, but I want to point out that when you want things to propagate up the tree, the metadata system is often the best fit. Hints are tricky. They originate as comments in SQL. Those comments are then applied to one RelNode when the SQL is translated. Now we ar

Re: [Discussion] How to get the table alias in RelNode tree or TableScan?

2023-08-16 Thread Julian Hyde
You can’t get the alias. In RelNode-land there is no such concept. Just the inputs to the current RelNode, identified by ordinal. Maybe at the time of SQL-to-RelNode conversion you can convert the aliases in the hint into ordinals. That’s the last moment that aliases are available. Julian >

Re: A link in the code has expired

2023-08-22 Thread Julian Hyde
Yes, when eigenbase.org shut down I copied the contents of the wiki onto my server, http://www.hydromatic.net/wiki. http://www.hydromatic.net/wiki/Eigenbase_Introduction is a good place to start reading. Maybe there’s a better place to store those files for posterity. I

Re: Implementing HASH(*)

2023-08-22 Thread Julian Hyde
Fwiw, the “*” in the syntax of "COUNT(*)” was a mistake. By analogy with “SELECT *” and with how Unix treats commands like “ls -l *”, people expect “*” to be expanded to all columns. But suppose I have T (x, y) with values (0, null), (1, 0), (null, 0). Do I expect “select count(*) from t” to re

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

2023-08-23 Thread Julian Hyde
There aren't many false positives or flaky tests in CI, checker-framework, error-prone. If it says that (say) you are passing a nullable object to a method that requires a not-nullable argument, you probably are. I find it useful to run checker-framework on my own computer, rather than waiting for

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

2023-08-23 Thread Julian Hyde
I just took a look at https://github.com/apache/calcite/pull/3393/checks. I see an autostyle violation, and it looks valid. That error is there so that you can fix it and not waste reviewers' time. On Wed, Aug 23, 2023 at 2:15 PM Julian Hyde wrote: > > There aren't many false po

Functions that cache state, e.g. compiled regular expressions

2023-08-23 Thread Julian Hyde
Can I get one or two reviews of https://github.com/apache/calcite/pull/3394 / https://issues.apache.org/jira/browse/CALCITE-5914 ? I'm trying to introduce an architecture so that Java functions that need to retain state for performance reasons (e.g. a cached compiled regular expression) are straig

Re: JDBC 4.2 or 4.3 support

2023-08-25 Thread Julian Hyde
We’re an open source project, so there is no formal roadmap. Did you search jira? If there is no jira case, log one which describes your problem. I’m not familiar with what changed between JDBC 4.1, 4.2 and 4.3. Julian > On Aug 24, 2023, at 5:25 AM, Tony Falabella > wrote: > > Calcite Team,

Re: LITERAL_AGG question

2023-08-28 Thread Julian Hyde
First off, can you create a jira case? This is clearly a bug. I think AggregateCall.rexList is new and will need to be explicitly handled in serialization and deserialization. Testing shouldn’t be difficult if you extend or modify existing RelJson tests. > On Aug 28, 2023, at 7:30 AM, stanilo

Re: [Question] How to test the correctness of an optimization rule in quidem?

2023-08-28 Thread Julian Hyde
The meta-answer: I would use ‘git log’ and identify commit that modify both RelOptRulesTest.java and also at least one .iq file. I don’t think there’s a way to selectively enable a planner rule in a .iq file. I don’t know if there is a way to add such a mechanism which is reasonably simple for

Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Julian Hyde
I wanted to figure out whether the transformation that you want is valid. Let’s convert your query select T1.id, T2.id from T1 left join T2 on T1.id = T2.C201 where test(T1.id) into one of the same shape: select d.deptno, e.empno from dept as d left join emp as e on d.deptno = e.deptn

Re: [Question] How to test the correctness of an optimization rule in quidem?

2023-08-30 Thread Julian Hyde
this is a good way,could we add a standard process to > test the correctness of the results for the optimization rules in calcite? > > Best, > LakeShen > > 在 2023年8月29日 03:26:03 上,Julian Hyde 写道: > >> The meta-answer: I would use ‘git log’ and identify commit that mo

Re: PR CI Failures Question

2023-08-31 Thread Julian Hyde
I searched for the error message and it’s maybe a corrupted Gradle cache. That sounds plausible, because the message doesn’t look specific to Windows or your change. Just one container gone bad. I’d force-push and see whether I get a healthier container next run. Julian [1] https://stackoverf

Re: PR CI Failures Question

2023-08-31 Thread Julian Hyde
Actually, no need to force-push, just restart the job. > On Aug 31, 2023, at 2:41 PM, Julian Hyde wrote: > > I searched for the error message and it’s maybe a corrupted Gradle cache. > That sounds plausible, because the message doesn’t look specific to Windows > or your c

Re: [question] how to do not include columns in select *

2023-09-01 Thread Julian Hyde
I’d write a jira case, specifying the feature in such a way that everyone who uses Calcite can benefit from it, then I’d write some unit tests (including some negative tests), and then the coding part would be relatively straightforward. Probably not the answer you were hoping for, but that’s h

Re: Make the github PR commits and File changed clean

2023-09-06 Thread Julian Hyde
Personally, I don’t have a problem reviewing PRs that have many commits. The GitHub web UI and command-like tools like *git diff main” make it easy to see the whole change. Conversely, if I have reviewed a PR and requested changes, I would much rather that the author makes those changes in an

Re: Make the github PR commits and File changed clean

2023-09-06 Thread Julian Hyde
I should have said that the current policy isn’t absolute. I agree that a squash/rebase can be beneficial if there are many commits. It’s a trade off, and the reviewer should make the call, not the author of the PR. Julian > On Sep 6, 2023, at 8:45 AM, Julian Hyde wrote: > > Pers

Re: Question about execute 'insert into A select * from B'

2023-09-06 Thread Julian Hyde
It’s fair to say that if Calcite throws a NullPointerException then it’s a bug. (Except if it’s Calcite calling your code, or if you called an API with a null value for a not-null parameter.) In this case, you are calling the CSV adapter and asking it to modify a table, something it is not desi

Re: TIMESTAMPDIFF semantics

2023-09-06 Thread Julian Hyde
Did you find any relevant Jira cases? They are often useful for understanding the background and intended semantics. > On Sep 6, 2023, at 5:38 PM, wrote: > > I am looking at the TIMESTAMPDIFF function and every SQL dialect seems to > have a slightly different definition, e.g.: > > > > Datab

Re: Make the github PR commits and File changed clean

2023-09-06 Thread Julian Hyde
x27;s better than >> just going file by file and marking them as "reviewed" in the GitHub UI. >> >> As Julian says, there are different styles and it's always a trade-off >> between multiple factors. >> >> Best regards, >> Alessandro >

Re: SqlValidatorImpl#deriveAlias no called any more after refactoring

2023-09-07 Thread Julian Hyde
n overwrite it for custom purpose. I decide this is erroneous > and need to be fixed. > WDYT ? > Thanks ! > > > [1] > git log --grep='Refactor: Deprecate SqlValidatorUtil.getAlias' > commit 5d671ec976f748869481d440c168bea45356216e > Author: Julian Hyde &g

Re: Possible bug found in SqlToRelConverter

2023-09-20 Thread Julian Hyde
That sounds like a bug. Can you please log a jira case? The fix might be in SqlValidatorImpl’s identifier expansion, even though the problem shows up in SqlToRelConverter. > On Sep 20, 2023, at 12:39 PM, Jordan Hannel wrote: > > Hello all, > I believe I have found a bug in SqlToRelConverter. T

Re: PR CALCITE-6022 Review Request

2023-09-27 Thread Julian Hyde
Looks good to me. Nice work. > On Sep 26, 2023, at 8:16 PM, Hongyu Guo wrote: > > Hi devs, > > I have submitted PR[1] to support a new DDL syntax: "CREATE TABLE LIKE". > > "CREATE TABLE LIKE" will define a new table using definition of an existing > table, > and it is optional to preserve th

Re: Existing rules for duplication of filter conditions above joins which should not be pushed down by FilterIntoJoinRule ?

2023-09-27 Thread Julian Hyde
I like the idea of redundant filters. We should probably add a new kind of metadata so that one node can see that a filter is redundant. I’m not sure how that metadata would look. A well chosen use case will help us design it. Does anyone have one? > On Sep 27, 2023, at 1:40 AM, Stamatis Zampet

Re: Access to Calcite plan execution

2023-09-27 Thread Julian Hyde
Michael’s suggestion of a custom EnumerableFilter is a good one. Another way is to use the logical relational algebra as a data structure. You can get it in JSON from the EXPLAIN PLAN command, and it is available in many other formats (XML, Java objects). Julian $ ./sqlline Building Apache C

Re: Existing rules for duplication of filter conditions above joins which should not be pushed down by FilterIntoJoinRule ?

2023-09-30 Thread Julian Hyde
Thanks, Ian. That’s useful. My concern with duplication of filter conditions is that we give the lower relational expression permission to ignore them. Suppose we have a query (Q1): select * from emp left join dept using (deptno) where myPredicate(dept.dname) We could duplicate th

Re: SQL Parsing

2023-10-02 Thread Julian Hyde
The parser will accept literally anything if you put it in backticks (or whatever are the identifier quote symbol in the current parser config). It just thinks it is the name of a user-defined type. Not what you want. > On Oct 2, 2023, at 11:54 AM, Thomas Wang wrote: > > Thanks Jiajun. It look

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

2023-10-03 Thread Julian Hyde
We seem to have reached consensus, and I accept that. But I can’t let Evgeny’s statements about the SQL standard go unchallenged. When the standard says things like “a date literal in a statement shall be in ISO format”[1] it is saying that, to comply with the standard, a DBMS only needs to ma

Re: Draft: board report for 2023 Q3

2023-10-03 Thread Julian Hyde
t; increase >>>>> in traffic of the dev list. >>>>> >>>>> The number of non-committer (contributor) commits per month: >>>>> +-----+-----+-+ >>>&

Re: fields injected after validation

2023-10-03 Thread Julian Hyde
Are you worried that $3 in the first plan has become $4 in the second plan? That’s easily explained because the intermediate table has an extra column, LOWER($1). That pushes up the offset of all columns coming from the right-hand table. > On Oct 3, 2023, at 3:14 PM, Guillaume Masse > wrote:

Re: fields injected after validation

2023-10-03 Thread Julian Hyde
oject(column2=[$0], column1=[$1], $f2=[LOWER($1)]) > LogicalTableScan(table=[[t1]]) >LogicalTableScan(table=[[t2]]) > > My problem is the added field column2=[$0] in the LogicalProject. Since > it's not contributing to the query, it should not be there. > > On T

Re: fields injected after validation

2023-10-03 Thread Julian Hyde
s there a specific rule TransformationRule > you have in mind? > https://github.com/apache/calcite/tree/main/core/src/main/java/org/apache/calcite/rel/rules > > > On Tue, Oct 3, 2023 at 3:59 PM Julian Hyde wrote: > >> Well, it’s not really “there”. It is removed by the fin

Re: Question about a possible bug in RelBuilder.aggregate_()

2023-10-05 Thread Julian Hyde
Use of “copy” methods has been worrying for a while. The methods are rarely used, and therefore inconsistently implemented. They may make assumptions that the new RelNode is fairly similar to the first (e.g. has the same number of expressions, and therefore has the same row type or field names)

Re: [DISCUSS] Towards Calcite 1.36.0

2023-10-11 Thread Julian Hyde
to release 1.36.0, this will give us about >> 20 days to clean up pending PRs for next version. What do you think? >> >> According to [4], the following release managers would be: >> - 1.36.0 Benchao Li >> - 1.37.0 Sergey Nuyanzin >> - 1.38.0 Julian Hyde >> >> So

Re: Question about bitwise right operator

2023-10-12 Thread Julian Hyde
The problem is that you are making the language ambiguous. To get your desired behavior you probably need the lexical analyzer less eager. That’s a hard thing to do, because you probably need to adjust its behavior based on the syntactic context - whether the parser thinks that it is parsing the

Re: Question about bitwise right operator

2023-10-12 Thread Julian Hyde
t; [1] > https://github.com/p4lang/p4c/blob/d79e2e8bfa07c7797891d44b7d084910947bf0a7/frontends/parsers/p4/p4parser.ypp#L212 > [2] > https://github.com/p4lang/p4c/blob/d79e2e8bfa07c7797891d44b7d084910947bf0a7/frontends/parsers/p4/p4lexer.ll#L300 > [3] > https://github.com/p4lang/p4c/commit/4

Re: RelNode => Spark Logical Plan converter

2023-10-12 Thread Julian Hyde
There aren’t any plans, but I like the idea of transforming between the intermediate languages (Calcite algebra, Spark algebra, SQL of any dialect, Substrate). In particular I was thinking of translating Calcite algebra —> Substrate, and Substrate —> any supported SQL dialect. The former would

Re: Donation of "calcite-cli" Repository for Calcite SQL Prompt

2023-10-15 Thread Julian Hyde
This project seems to do a similar job to SQLLine, except that it is written in Go rather than Java, and speaks the Avatica protocol rather than JDBC. A few observations: 1. The best fit for it would be in the avatica-go project. But SQLLine has been successful as an independent project (not tied

Re: Minimum Guava version

2023-10-17 Thread Julian Hyde
I've updated the PR to require Guava 21 or higher. See https://github.com/apache/calcite/pull/3470. If anyone can't handle Guava 21 please speak up. On Mon, Oct 16, 2023 at 10:40 PM stanilovsky evgeny wrote: > > +1, let`s make ! > > > For the upcoming release 1.36, the default Guava version (and

Re: How can Apache Calcite keep aliases in groupby/having/orderby after validation and optimization?

2023-10-21 Thread Julian Hyde
RelRoot is how Calcite does it. See https://issues.apache.org/jira/browse/CALCITE-819. On Fri, Oct 20, 2023 at 10:27 PM Akilis Zhang wrote: > > I use Calcite (v1.30.0) to optimize sql. I found the aliases (see `g`, > `cnt`) in group by/order by clauses were expanded as expressions like > below, >

Re: Missing column alia after RelFieldTrimmer

2023-10-23 Thread Julian Hyde
Benchao is correct that we cannot guarantee column names. So, this is a feature request rather than a bug. I still think you should log it. RelFieldTrimmer works top-down, deducing a bit-set of the columns that each relational operator needs from its input(s). To solve this problem, it would ne

Re: Reviewing blog post

2023-10-23 Thread Julian Hyde
I have reviewed for both branding and technical content, and it looks great. Thank you for writing. When it’s final, let me know, and I’ll promote it using the ApacheCalcite Twitter account. If I were writing the post, I’d qualify the statement "The modern way to implement compilers … is to us

Re: Runtime error with source position

2023-10-24 Thread Julian Hyde
I don’t think any such code exists in Calcite. When I spoke recently I may have mistakenly said that Calcite had such code, but I was thinking of Morel. If you look at commit https://github.com/hydromatic/morel/commit/21c6fef0bfd2c0aa7f8ff83e83a025ab5b675876 you will see that I added a ‘pos’ ar

Re: Rest API implementation

2023-10-25 Thread Julian Hyde
The “file” adapter has some support for REST. Naturally the file adapter can read files of various formats (.csv, .json, compressed .csv, etc.) from the file system. But it can also read those same kinds of files over HTTP, and read data sets in HTML tables [1]. The logical next step is to allo

Re: Question on PulledUpPredicates

2023-10-25 Thread Julian Hyde
I agree with your observation that if (x, y) is a unique key for R, and x is constant, then y is also a unique key. When someone calls areColumnsUnique(R, {y}, false), the implementation should (and probably already does) look to see whether {y} is a known unique key (or a superset of one). Bu

Re: How to handle a dynamic param as a set of values?

2023-10-25 Thread Julian Hyde
I have wanted this feature in SQL APIs for thirty years. I call it the ‘join to array’ problem. If you have a collection of employee ids, the best you can do is the following: void getEmployees(int[] empIds, Consumer nameConsumer) { PreparedStatement stmt = connection.prepareStatemen

Re: [ANNOUNCE] New committer: Mihai Budiu

2023-10-26 Thread Julian Hyde
Welcome, Mihai. Thank you for the excellent work that you have already done, and discussions you have started about how we can become better. > On Oct 26, 2023, at 8:33 AM, Tanner Clary > wrote: > > Congrats, Mihai! You've definitely helped me along the way. > > Best, > Tanner > > On Thu,

Re: Removing FLOAT

2023-10-26 Thread Julian Hyde
Removing a type that is in the SQL standard is not practical. The best way to deal with the confusion is to state the rules again. If there are a few inconsistencies in the code, fix the inconsistencies. REAL is a 32 bit float (similar to Java float); DOUBLE is a 64 bit float (similar to Java do

Re: Removing FLOAT

2023-10-26 Thread Julian Hyde
it's the > same as REAL as far as I can tell), they will now find out that their > assumption is wrong, and can take corrective actions. > > Both solution would entail a non-trivial amount of work, so I am trying to > avoid working on the wrong one. > > Mihai > > _

Re: Can we enable '-ea' in csv sqlline by default

2023-10-27 Thread Julian Hyde
I get how frustrating it must be for bugs to happen in tests but not from sqlline. Regarding example/csv/sqlline. I had forgotten that we have two copies of sqlline (and sqlline.bat). They arrived when we imported a different project, optiq-csv. Do the extra copies serve any useful purpose? If

Re: System fields

2023-10-27 Thread Julian Hyde
You’re thinking about this the same way that I do — first agree what is the desired behavior of a so-called ’system field’. I have questions like: * Does a system field appear in all tables (relations, including tables derived via a query) or only base tables? * If there are many system fields

Re: [DISCUSS] Towards Calcite 1.36.0

2023-10-30 Thread Julian Hyde
MAP >>> SubQuery >>>>> doesn't work, >>>>> considering this is a feature regression or bug, maybe we can fix it >> in >>>>> 1.36. >>>>> The PR is ready. If someone has time, pls help to review it. many >>> t

Re: [ANNOUNCE] New committer: Ran Tao

2023-10-30 Thread Julian Hyde
Welcome! Thank you for your contributions to date — I see many, many contributions that improve the quality of the code and make Calcite more delightful to use. Julian > On Oct 29, 2023, at 7:17 PM, Dan Zou wrote: > > Congrats Ran! > > Best, > Dan Zou > > > > > >> 2023年10月27日 23:38,

Re: System fields

2023-10-30 Thread Julian Hyde
aps a small handful in the foreseeable future. Not > sure if this is a real answer though :) > >> * Do system fields belong to the whole query (as CURRENT_DATE does), or just >> a record (table alias)? > > For the use case I have in mind, they'd need to belong to the

Re: Removing FLOAT

2023-10-31 Thread Julian Hyde
ant to make sure I am fixing it in the right way. > > Mihai > > From: Julian Hyde > Sent: Thursday, October 26, 2023 3:30 PM > To: dev@calcite.apache.org > Subject: Re: Removing FLOAT > > Treating FLOAT as sugar for REAL would work. I don

Re: How about enable dependabot?

2023-11-05 Thread Julian Hyde
I agree that we should be trying to stay on the most recent version of our dependencies (with a few exceptions, such as JavaCC). Most of our dependencies are mature libraries, and the latest version is more likely to fix security problems than to introduce bugs. However, I'm not sure that Dependab

Re: How to visit SELECT node before ORDER_BY?

2023-11-06 Thread Julian Hyde
In the case of queries with set operations (UNION, INTERSECT, EXCEPT) the ORDER BY must happen later (i.e. nearer to the root of the AST). E.g. SELECT deptno FROM emp UNION ALL SELECT deptno FROM dept ORDER BY deptno is parsed as OrderBy(Union(Select(From emp), Select(From dept))) Whe

Re: JOIN and "Type mismatch: rowtype of new rel: RecordType ... NOT NULL rowtype of set"

2023-11-06 Thread Julian Hyde
Did you find an existing Jira case? If not, could you log one? You should create a minimal test case and figure out what are the essential features that are necessary to reproduce this problem. Ideally convert it to run on a built-in schema such as Scott (emp and dept tables). This will help som

Re: [VOTE] Release Apache Calcite 1.36.0 (release candidate 0)

2023-11-07 Thread Julian Hyde
+1 (binding) Downloaded; checked signatures & hashes; checked LICENSE, NOTICE, README, README.md, howto.md, history.md; ran RAT; compared to git tag. Built and ran tests using Gradle 7.4.2, OpenJDK 19.0.2, Ubuntu 24.10. Thanks Benchao! Julian On Tue, Nov 7, 2023 at 7:41 AM LakeShen wrote: > >

Re: [VOTE] Release Apache Calcite 1.36.0 (release candidate 0)

2023-11-07 Thread Julian Hyde
Oops, Ubuntu 23.10. Obviously. On Tue, Nov 7, 2023 at 12:02 PM Julian Hyde wrote: > > +1 (binding) > > Downloaded; checked signatures & hashes; checked LICENSE, NOTICE, > README, README.md, howto.md, history.md; ran RAT; compared to git tag. > Built and ran tests using

Re: JOIN and "Type mismatch: rowtype of new rel: RecordType ... NOT NULL rowtype of set"

2023-11-09 Thread Julian Hyde
he commit/code history which commit, which version >> introduced the problem or it has never worked correctly. >> >> Best Regards, >> Ran Tao >> >> >> Egor Ryashin 于2023年11月9日周四 18:10写道: >> >>> FYI, it’s not reproduced with Calcite 1.35 >>

Re: all zeros in the result set for float/double, Avatica-Go

2023-11-10 Thread Julian Hyde
Please log a bug. > On Nov 10, 2023, at 7:54 AM, Egor Ryashin wrote: > > Hi all, > > FYI, having all zeros in Go client result set with Calcite 1.35 update in > Apache Druid. It worked with the older version. From what I see in the > debugger TypedValue.NumberValue = 0 but DoubleValue = 1. No

<    3   4   5   6   7   8   9   10   11   12   >