Re: Exception parsing "SELECT @@character_set_server"

2022-03-28 Thread Julian Hyde
ies#2> > On Mar 28, 2022, at 12:02 PM, Julian Hyde wrote: > > We’d be open to adding support, but it must not be the default behavior, so > there will be need to be some kind of flag. > > Can you log a JIRA case with the subject ’Support variables with “@" and

Re: JDBC join order question

2022-03-28 Thread Julian Hyde
Xiaoying, I know why you didn’t receive the email. Your reply went through moderation, which indicates that you are not subscribed to dev@calcite. Please subscribe. > On Mar 28, 2022, at 11:10 AM, Xiaoying Wang > wrote: > > Hi Benchao, > > Thank you so much for the reply! I don't know why I

Re: [DISCUSS] Best practice for synchronizing master and site branches

2022-03-25 Thread Julian Hyde
Does anyone know (or could find out) the SHA of the master and site branches at the time that Fan attempted to move the site changes over? If so, we could recreate the same environment, and figure out a set of git commands that would have worked then and will work for the next release manager.

Re: [VOTE] Release apache-calcite-avatica-go-5.1.0 (release candidate 0)

2022-03-24 Thread Julian Hyde
+1 Checked signatures and checksums, LICENSE, NOTICE, README.md. Checked that tar.gz contains same files as git. Note #1. I ran go get github.com/apache/calcite-avatica-go and got the error go get github.com/apache/calcite-avatica-go: no

Re: Contributing a custom SQL dialect of Firebolt to Calcite

2022-03-24 Thread Julian Hyde
Raghav, Thanks for considering making a contribution. We should be able to resolve most questions on this list (if you haven’t already, please subscribe, so that your emails don’t need to go through moderation). Yes, we require a JIRA case for contributions except for cosmetic changes (e.g.

Re: Calcite SQL parser error

2022-03-23 Thread Julian Hyde
Already logged as https://issues.apache.org/jira/browse/CALCITE-4401 . Contributions welcome. > On Mar 22, 2022, at 4:47 PM, Nikhil Goyal wrote: > > Hi folks, > I am running into this error: > > Exception in thread "main"

Re: Exception parsing "SELECT language"

2022-03-23 Thread Julian Hyde
both in syntax and semantics. > -- > Michael Mior > mm...@apache.org > > > Le mer. 23 mars 2022 à 14:12, Julian Hyde a écrit : > >> If there’s nowhere for LANGUAGE to come from that would make it >> semantically invalid but wouldn’t affect the syntactic val

Re: Towards Avatica-Go 5.1.0

2022-03-23 Thread Julian Hyde
Thank you, Francis! > On Mar 22, 2022, at 10:10 PM, Francis Chuang wrote: > > Hey everyone, > > It's been quite a while since the last Avatica-Go release, more than 2 years! > > I have been doing some housekeeping and upgrading dependencies, etc. I think > it's probably a good time to

Re: Exception parsing "SELECT language"

2022-03-23 Thread Julian Hyde
If there’s nowhere for LANGUAGE to come from that would make it semantically invalid but wouldn’t affect the syntactic validity. (In other words, you’d get an error from SqlValidator but not from SqlParser.) In this case, the problem is that LANGUAGE is a reserved keyword in both standard SQL

Re: Exception parsing "SELECT @@character_set_server"

2022-03-22 Thread Julian Hyde
The ‘@@‘ prefix is not standard SQL, and Calcite does not support it. Can you do some research to find out how MySQL handles it. Is it considered to be part of the variable name? Or is it a prefix (like $ in bash) that means ‘what comes next is a variable’? In other words, does the parser say

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

2022-03-18 Thread Julian Hyde
+1 Checked checksums and signatures, compared with git repo at same sha, checked LICENSE, NOTICE, README, howto.md, release notes, compiled and ran tests on Ubuntu 20.04.4 LTS Linux 5.4.0-104-generic x86_64 using JDK 11 and Gradle 7.2 (noting that the recommended Gradle version is 7.3), ran

Re: Context-aware/stateful SQL operator functions? (IE adding a stack for number of times an operator has been called in query)

2022-03-18 Thread Julian Hyde
I think you’re proposing making the JSON_ functions smarter at runtime. My general philosophy is to have the smarts at prepare time and make the runtime operators dumb. I think that philosophy can be applied here. Some extra logic would kick in when preparing a query that has JSON_ functions,

Re: Setting the "defaultSchema" of a live CalciteConnection?

2022-03-15 Thread Julian Hyde
An ancestor project of Calcite, Eigenbase (aka Farrago) used to have a SET SCHEMA command. It would be nice if we added that back. (Maybe only in the “server” module, since in “core” the connections are stateless.) I’m a bit surprised that "CalciteConnection.setSchema(String)" doesn’t work.

Re: [RESULT] [VOTE] Release apache-calcite-1.30.0 (release candidate 2)

2022-03-15 Thread Julian Hyde
feedback and your PR. > > Best, > Liya Fan > > Julian Hyde 于2022年3月15日周二 12:42写道: > > > I have a PR for [CALCITE-5040]. Please review > > https://github.com/apache/calcite/pull/2744 < > > https://github.com/apache/calcite/pull/2744>. > > > >

Re: [RESULT] [VOTE] Release apache-calcite-1.30.0 (release candidate 2)

2022-03-14 Thread Julian Hyde
I have a PR for [CALCITE-5040]. Please review https://github.com/apache/calcite/pull/2744 . Liya, Sorry I didn’t find time to vote on this RC. I reviewed the release notes and they look good. > On Mar 14, 2022, at 8:24 PM, Fan Liya wrote: > >

Re: applying the wrong rule for calculated columns

2022-03-14 Thread Julian Hyde
I thought for a minute this case was talking about computed columns. So let me clarify terminology. These aren’t "calculated columns" in the sense of ColumnStrategy [1], which has values STORED (column’s value is computed using an expression and stored) and VIRTUAL (column's value is not

Re: Broken history after force pushing to master

2022-03-09 Thread Julian Hyde
ster branch, I think I can help > verify the operation, because I have a local backup. > > When things are done, I think I will start another thread to discuss the > problem, to avoid such things happening again in the future. > > Thanks again for your kind help.

Re: [VOTE] Release Apache Calcite 1.30.0 (release candidate 1)

2022-03-09 Thread Julian Hyde
Liya, I made much the same comments as Ruben regarding the release notes. Though we don’t usually use PRs for releases, I think it would be useful if we had a PR in which to review the release notes. It seems better than bike-shedding them during the actual release vote. If you agree, can you

Re: Broken history after force pushing to master

2022-03-09 Thread Julian Hyde
That sounds good. I concur that "[CALCITE-5019] Avoid multiple scans when table is ProjectableFilterableTable and projections and filters act on different columns” is the last good commit and that its hash should be dcbc493bf699d961427952c5efc047b76d859096. Go ahead when you’re ready.

[jira] [Created] (CALCITE-5037) Upgrade HSQLDB to 2.5.1

2022-03-09 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-5037: Summary: Upgrade HSQLDB to 2.5.1 Key: CALCITE-5037 URL: https://issues.apache.org/jira/browse/CALCITE-5037 Project: Calcite Issue Type: Bug

Re: Bugs dropped on the floor

2022-03-07 Thread Julian Hyde
Especially https://issues.apache.org/jira/browse/CALCITE-4976 <https://issues.apache.org/jira/browse/CALCITE-4976> whose title is literally “Release Calcite 1.30.0”, no longer has fix-version 1.30. Good grief. > On Mar 7, 2022, at 2:22 PM, Julian Hyde wrote: > > There

Bugs dropped on the floor

2022-03-07 Thread Julian Hyde
There were a few bugs that had fix-version = 1.30 because they had PRs that looked like they were going to make it. Liya has removed the fix version. https://issues.apache.org/jira/browse/CALCITE-4908

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

2022-03-07 Thread Julian Hyde
Liya, in the next iteration can you go back to the usual sections e.g “Bug-fixes, API changes and minor enhancements”. Also remove the “Fix” prefix from messages. Quite a few cases, e.g “ Fix the problem that JDBC adapter incorrectly adds ORDER BY columns to the SELECT list of generated SQL

Re: Could calcite support SortProjectPullUpConstantsRule?

2022-03-07 Thread Julian Hyde
Sounds reasonable. Please log a jira. Consider implementing this rule by inspecting predicates or unique keys, rather than by matching a Project or Filter. If you can ascertain that a sort column has only one value (counting NULL as a value for these purposes) then you can remove it from the

Re: [Discuss] The RexSimplify about "a <> 1 and a = 2"

2022-03-03 Thread Julian Hyde
Note that https://issues.apache.org/jira/browse/CALCITE-1794 deals with very similar expressions (albeit with CAST, and optimized using SARGs rather than RexSimplify) and was just fixed today. > On Mar 2, 2022, at 4:52 PM, Benchao Li wrote:

Re: calcite multi-threading problem

2022-02-26 Thread Julian Hyde
tCompilerFactory method with a classloader > parameter was removed intentionally? > but it seems calcite still needs it . > > > > What we mean here is that we think calcite has a bug with janino 3.1.6 , are > we right? > > > > > > > > > &g

Re: calcite multi-threading problem

2022-02-25 Thread Julian Hyde
Should a jira case be logged for this issue? Or is there an existing case? If the latter, should we add a stack trace to help people tie it to this problem? A jira URL in this thread will help other people who run into this problem in future. Right now it is just a rambling email thread with an

Re: [Discuss] Converting SELECT Fields to STAR may cause duplicate column exception when executing ctas

2022-02-24 Thread Julian Hyde
Which code is generating this "SELECT *" query? It seems wrong to generate "SELECT *". It should generate a list of columns with unique names instead. On Thu, Feb 24, 2022 at 3:41 AM Yanjing Wang wrote: > > Hi community, > > I'm trying to convert a plan to a sql of SPARK dialect, but sometimes

Re: [DISCUSS] Release Managers

2022-02-24 Thread Julian Hyde
years or so we had the following people helping out with > > releasing Calcite. > > > > 1.22.0 Danny Chan > > 1.23.0 Haisheng Yuan > > 1.24.0 Chunwei Lei > > 1.25.0 Andrei Sereda > > 1.26.0 Ruben Quesada Lopez > > 1.27.0 Stamatis Zampetakis > > 1.

Re: dynamic reflective schema

2022-02-24 Thread Julian Hyde
Yes. As I said, DOUBLE is basically a synonym for FLOAT in SQL. Julian > On Feb 24, 2022, at 06:13, Stamatis Zampetakis wrote: > > The JDBC specification [1] defines the mapping between JDBC/SQL types to > Java types (check TABLE B-1 JDBC Types Mapped to Java Types). > > Best, > Stamatis >

Re: dynamic reflective schema

2022-02-23 Thread Julian Hyde
SQL’s FLOAT type (aka DOUBLE) corresponds to Java’s double. SQL’s REAL type corresponds to Java’s float. JDBC method names (e.g. getFloat, getDouble) refer to the Java types. Julian > On Feb 23, 2022, at 10:33 PM, xiaobo wrote: > > When trying to map Java Float Objects to SQL Float, we

Re: Why are nested aggregations illegal? Best alternatives?

2022-02-23 Thread Julian Hyde
r, I put a self-contained single class reproduction on > Github: > https://github.com/GavinRay97/calcite-nested-json-subquery-bug/blob/main/src/test/java/com/example/AppTest.java > > Is it worth filing a JIRA ticket over you think? > > >> On Wed, Feb 23, 2022 at 3:45 A

Re: Why are nested aggregations illegal? Best alternatives?

2022-02-23 Thread Julian Hyde
y favorite show}, { | >>>> >>>> >>> >> ++-++------+ >>>> >>>> On Sat, Feb 12, 2022 at 4:13 PM Gavin Ray >> wrote: >

Re: DDL support issues in Calcite

2022-02-22 Thread Julian Hyde
Looks like you need to be using ServerDdlExecutor rather than DdlExecutor.USELESS. Therefore try using org.apache.calcite.server.ServerDdlExecutor#PARSER_FACTORY rather than org.apache.calcite.sql.parser.ddl.SqlDdlParserImpl#FACTORY in your connect string. > On Feb 21, 2022, at 12:17 AM,

Re: dynamic reflective schema

2022-02-22 Thread Julian Hyde
Every time I see "at Baz.bind” I am reminded that I should have chosen a better name for that class than ‘Baz’. :) I figured ‘it’s generated, no one is ever going to know its name’. How wrong I was. The stack traces are all over the internet. Julian > On Feb 22, 2022, at 3:32 PM, Scott

Re: CyclicMetadataException

2022-02-17 Thread Julian Hyde
Planning is not thread-safe. For a given RelOptCluster, only one thread should be planning. If there are multiple queries (each with their own RelOptCluster) then they can safely be planned on separate threads. It’s possible that there are issues if queries are sharing materialized views. The

Re: Pushing filters with unsafe operations (CAST/DIVISION) below inner joins

2022-02-17 Thread Julian Hyde
You should definitely log a bug, even if there are no plans to fix it. It is a violation of the standard, and therefore it is a bug, and therefore we should document that it exists. Can you do some research on the right terminology. You use the term ‘unsafe’. I think the PL community uses the

Re: Identifier starting with number parse fail

2022-02-16 Thread Julian Hyde
+1 Babel is an appropriate place to support this. (It would not be practical to implement in parser config, because tokenization needs to be efficient. It is better done in a separate parser, which is what Babel has.) XuRenhe, Please log a feature request in Jira to support MySQL-style

Re: Allow Cascades driver invoking "derive" on the nodes produced by "passThrough"

2022-02-15 Thread Julian Hyde
> So the idea of keeping even internal components of Calcite "more public" is > rather a good thing than the bad one from my point of view. This can go two ways. There is the type of change that I call “drill a hole” where someone requests that an implementation detail be made public so that

Re: [DISCUSS] Towards Calcite 1.30.0

2022-02-15 Thread Julian Hyde
+1 to release 1.30 soon, to keep up the tempo. Feb 28th sounds good to me. Thanks for pushing on this, Ruben. Andrei, Are you available to be RM for 1.30? When is a good date for you? Julian On Mon, Feb 14, 2022 at 9:16 AM Ruben Q L wrote: > > Hello, > > It has been almost two months since our

Re: Failed to import gradle

2022-02-15 Thread Julian Hyde
can reproduce again, I > will create a ticket for it. > > Thanks > Aitozi > > > Gavin Ray 于2022年2月9日周三 23:53写道: > >> Submitted a PR and Jira issue for this =) >> >> On Thu, Jan 27, 2022 at 6:44 PM Julian Hyde >> wrote: >> >>>

Re: Why are nested aggregations illegal? Best alternatives?

2022-02-12 Thread Julian Hyde
e way I am doing this seems like it's probably very inefficient. > Because I do a series of nested loops to add the key to each object in the > parent ResultSet row: > > https://github.com/GavinRay97/GraphQLCalcite/blob/648e0ac4f6810a3c360d13a03e6597c33406de4b/src/main/kotlin/TableDataF

Re: calcite multi-threading problem

2022-02-11 Thread Julian Hyde
xiaobo, Your emails are coming through with a lot of HTML escape characters [1]. To make them more readable for everyone else, could you perhaps try sending in “Plain text” mode? Julian [1] https://lists.apache.org/thread/ttrlw4c441br27lppxl77osbgxrv58wn > On Feb 11, 2022, at 5:36 PM, xiaobo

Re: [DISCUSS] Assigning reviewers

2022-02-10 Thread Julian Hyde
bers are familiar. (For >> example, when it comes to modifying the parser grammar, someone may want to >> hear from Julian, and when it comes to hints, someone may want to hear from >> Danny.) Maybe it's just my bias. But if this is the real situation, is it >> possible to deve

Re: Invalid IntervalSQLType

2022-02-10 Thread Julian Hyde
There are two kinds of intervals (in Calcite and in standard SQL). Days-hours-minutes-seconds-millseconds intervals, and year-month intervals. The former are represented internally in milliseconds. The latter are represented in months. This is one area where Postgres does things differently

Re: Why are nested aggregations illegal? Best alternatives?

2022-02-10 Thread Julian Hyde
avg(avg(sal)) FROM emp GROUP BY deptno; >>> becomes >>> select avg(the_avg) >>> from (select avg(sal) from emp group b deptno) an_alias; >>> >>> or >>> >>> with the_cte as (select avg(sal) x from emp group by deptno) >>

Re: ARRAY_CONCAT does not work

2022-02-10 Thread Julian Hyde
Let’s continue conversation in https://issues.apache.org/jira/browse/CALCITE-4999 . I already pushed back there on the idea that ARRAY_CONCAT’s type derivation was wrong, and Dmitry conceded. > On Feb 10, 2022, at 5:08 AM, Michael Mior

Re: Why are nested aggregations illegal? Best alternatives?

2022-02-10 Thread Julian Hyde
Some databases, e.g. Oracle, allow TWO levels of nesting: SELECT avg(sal) FROM emp GROUP BY deptno; AVG(SAL) 1,566.67 2,175.00 2,916.65 SELECT avg(avg(sal)) FROM emp GROUP BY deptno; AVG(SUM(SAL)) = 9,675 The first level aggregates by department (returning 3

Re: Prevent RexSimplify from simplifying operators to SEARCH

2022-02-08 Thread Julian Hyde
It is not possible today, but it is a reasonable feature request. One caveat. If conversion to SEARCH is disabled then many simplifications will not occur. Julian > On Feb 8, 2022, at 12:38 AM, Chathura wrote: > > Hello all, > > Can we configure RexSimplify to exclude certain operators

Re: Using TIMESTAMPDIFF() with RelBuilder

2022-02-04 Thread Julian Hyde
We don’t really want TIMESTAMPDIFF to work because it’s not standard (although it is exists in various dialects). Datetime minus is preferred. It’s more powerful because it accepts an interval value. I haven’t tried that either, but I imagine you would create an interval literal and then pass

[DISCUSS] Assigning reviewers

2022-02-03 Thread Julian Hyde
I make many contributions to this project, in the form of code, answering questions, leading design discussions, and clarifying bugs and feature requests. I review more changes than any other project member. My reward is that I am pestered, daily, with people pleading for me to review their

Re: MaterializedViewRule is not applied for queries on aggregate views that truncate timestamp

2022-02-03 Thread Julian Hyde
These kinds of roll ups are very common. They have simple mathematical properties. There is a simplifying abstraction to be found here. Please find it and use it. Julian > On Feb 2, 2022, at 7:47 PM, Thomas D'Silva wrote: > > Hi Stamatis, > > Thanks for your response. Your suggestion of

Re: Simplification of "x != x"

2022-02-03 Thread Julian Hyde
Using SQL syntax (which is less confusing, since we are talking about shortcut evaluation) UNKNOWN AND (x IS NULL) is equivalent to (x IS NULL) AND UNKNOWN Just write out the truth table. If you get different results, are you perhaps incorrectly using some kind of shortcut evaluation?

Re: Understanding UDF annotations

2022-02-02 Thread Julian Hyde
Yes, the UDF annotations are intended to allow better optimizations. I’m sure there are bugs. If a query with a UDF is not being optimized, log a bug. The fix is probably at the level of a particular RelOptRule, and therefore the test case would be in RelOptRulesTest. But I don’t think that

Re: Getting child Expressions on latest version of Calcite.

2022-02-02 Thread Julian Hyde
You don’t need to override RexShuttle.apply(List) (and in fact I don’t know whether it will be called). Create your own shuttle and override the methods for the sub-classes of RexNode that are of interest, e.g. the following prints all input refs RelNode r; r.accept( new RexShuttle()

Re: Question about creating a SqlBasicCall

2022-01-29 Thread Julian Hyde
Logically, your operator simply has three arguments. How the call with those arguments is converted back into SQL - whether it generates a comma or a space between arguments 1 and 2 - is a matter of syntax. It looks like your operator is unparsing calls using the default operator syntax, which

Re: Calcite can't generate code for one of the query

2022-01-28 Thread Julian Hyde
I guess you’re using ReflectiveSchema. I don’t think we support columns of (Java) type Character or char. You should convert relkind to a String and I think things will be better. > On Jan 28, 2022, at 4:44 AM, Dmitry Sysolyatin > wrote: > > I found a way how to make the query work. But I

Re: Failed to import gradle

2022-01-27 Thread Julian Hyde
Can someone log a bug for this? I don’t run into it personally. (I just click open on the directory. I never invoke ‘import gradle’.) But people shouldn’t have to edit their Gradle files. > On Jan 27, 2022, at 6:55 AM, Gavin Ray wrote: > > It didn't work for me either. > > I had to remove

Re: How to handle the fact that different databases have different ideas of what a "db"/"schema" are?

2022-01-27 Thread Julian Hyde
Let’s not worry about the names, and say that some DBs have two namespace levels and others have just one. Calcite’s word for a namespace is ’schema’. Calcite schemas are arranged in a hierarchy, like a filesystem, so there is no preferred depth. Any schema can contain both tables and

Re: [DISCUSS] Refactoring tests

2022-01-25 Thread Julian Hyde
east all the same test cases are running? (That's a really hard giant > file diff to compare given all the refactoring.) > > > > On Sat, Jan 22, 2022 at 9:41 PM Julian Hyde wrote: > >> Gavin, Thanks for the kind words. >> >> All, I have now squashed and rebased onto la

Re: Apache Calcite - Usage of Querable table/Querable/RawQueryable/etc interfaces

2022-01-25 Thread Julian Hyde
This reminds me that there’s an opportunity to make it easier to write adapters. There is a continuum of backends for adapters, from simple (such as CSV, which supports project and maybe filter) to powerful (such as Elasticsearch, which supports full relational algebra and then some). I am

Re: Question on how to integrate Apache IoTDB into Calcite

2022-01-25 Thread Julian Hyde
+1 what Stamatis said. Queryable is for compatibility with LINQ. If you want to build an adapter that supports push-down, you will likely use FilterableTable for simple adapters, TranslatableTable for more complex adapters. In neither case will you need to deal with Queryable. Stamatis laid

Re: [DISCUSS] Refactoring tests

2022-01-24 Thread Julian Hyde
essage, browse the un-squashed commits in https://github.com/julianhyde/calcite/tree/4885-test-fixtures.0 <https://github.com/julianhyde/calcite/tree/4885-test-fixtures.0>, or ask for my help on this thread. Julian > On Jan 22, 2022, at 9:41 PM, Julian Hyde wrote: > > Gavin, Than

Re: [DISCUSS] New community section for articles/blogs/papers

2022-01-24 Thread Julian Hyde
I love the idea of community content. Some of these projects will be the next generation of Calcite, and the authors our next PMC members. I share people’s concerns about the list items going obsolete, or the getting too long. How about moving older items to the

Re: [DISCUSS] Refactoring tests

2022-01-22 Thread Julian Hyde
w these changes seem > like they will make a number of things easier related to testing. > Super useful too when you're trying to start building something with > Calcite but don't know it well enough to figure out how to put all the > pieces together yourself. > > On Fri, Ja

Re: [DISCUSS] Refactoring tests

2022-01-21 Thread Julian Hyde
If it helps you review, I have created a ’summary’ document with a description of the changes. It will become the commit message when I squash, rebase, and merge to master. https://github.com/julianhyde/calcite/blob/4885-test-fixtures/summary-of-calcite-4885.md

Re: Parsing multiple SQL statements using Calcite

2022-01-21 Thread Julian Hyde
You are right. We support parsing multiple statements [1] but we don’t support multi-statement validation, multi-statement planning or multi-statement execution. Julian [1] https://issues.apache.org/jira/browse/CALCITE-2453 . > On Jan 20,

Re: How to write code if the intent is to land it in Calcite eventually?

2022-01-20 Thread Julian Hyde
There is one other front-end language (besides SQL) in Calcite: the ‘piglet' module implements Pig Latin (which is the language spoken by Apache Pig). I think the other languages, such as GraphQL, should each be their own module. Calcite has many adapters (i.e. back-ends), and

Re: Help with SqlAdvisor and autocomplete please!

2022-01-20 Thread Julian Hyde
There’s an existing test for this, and it passes. And I added some more in https://github.com/julianhyde/calcite/commit/831318278e0ecccf814b82eb8a944544874275a6 . How is your case (or environment) different

Re: New rule for Converting UNION ALL with same inputs but different filters to single input with OR FILTER

2022-01-20 Thread Julian Hyde
ion, not just 2-way Union. >> > Yes, I will add tests for this. > > And I think you should make it work whether or not a Project is present. > > Ok, It seems I need construct several different operand match trees for > plan. > > Hi Julian, what do you think of

Re: [ANNOUNCE] New Calcite PMC chair: Ruben Q L

2022-01-19 Thread Julian Hyde
Congratulations, Ruben, and good luck! Haisheng, Thank you for serving as Chair. Julian On Wed, Jan 19, 2022 at 6:29 PM Haisheng Yuan wrote: > > Calcite community members, > > I am pleased to announce that we have a new PMC chair and VP as per our > tradition of rotating the chair once a year.

Re: New rule for Converting UNION ALL with same inputs but different filters to single input with OR FILTER

2022-01-19 Thread Julian Hyde
from the > rule. > > On Wed, Jan 19, 2022 at 4:32 PM Julian Hyde <mailto:jhyde.apa...@gmail.com>> wrote: > >> Can you log a Jira case for this? >> >> I think you should make your rule work for N-way Union, not just 2-way >> Union. And I think you shoul

Re: New rule for Converting UNION ALL with same inputs but different filters to single input with OR FILTER

2022-01-19 Thread Julian Hyde
Can you log a Jira case for this? I think you should make your rule work for N-way Union, not just 2-way Union. And I think you should make it work whether or not a Project is present. > On Jan 19, 2022, at 1:25 PM, Julian Hyde wrote: > > It sounds useful. > > What do you

Re: New rule for Converting UNION ALL with same inputs but different filters to single input with OR FILTER

2022-01-19 Thread Julian Hyde
It sounds useful. What do you think the rule should be called? UnionFilterTransposeRule, perhaps? A challenge when writing the rule will be to ensure that all of the inputs to the Union are the same. The Volcano framework is not very good at that. You should be careful of the case that the

Re: [DISCUSS] Apache Calcite Online Meetup January 2022

2022-01-19 Thread Julian Hyde
For what it’s worth, I had trouble logging into Meetup.com (from both an iPhone and a macOS laptop) and so missed the meetup. > On Jan 19, 2022, at 9:08 AM, Jacques Nadeau wrote: > > Shoot, totally missed that this was using meetup.com. Figured the date/time > would be discussed here. In the

Re: Projection for SELECT COUNT(*)

2022-01-18 Thread Julian Hyde
As Stamatis said, we don’t have a consistent policy on zero-length records. But in that thread I logged https://issues.apache.org/jira/browse/CALCITE-4597 to clarify the situation. It would be great if someone worked on it. I see Viliam’s

Re: [DISCUSS] Refactoring tests

2022-01-18 Thread Julian Hyde
885 <https://issues.apache.org/jira/browse/CALCITE-4885> "Fluent test fixtures” tomorrow. They’re both significant changes, review welcome. Julian > On Jan 12, 2022, at 10:11 AM, Julian Hyde wrote: > > After a month or so of work I have a PR for review. See > http

Re: [DISCUSS] RepeatUnion improvements

2022-01-17 Thread Julian Hyde
Thanks for the heads up. There was a good reason that we marked RepeatUnion experimental: so that we can make these improvements without anyone complaining. I welcome these changes evolving RepeatUnion into a more useful feature. By the way, in Morel I am having some deep discussions about the

Re: [DISCUSS] Writing good summaries for Jira cases

2022-01-14 Thread Julian Hyde
it is a >>> matter >>>>> of personal habits and previous experience, not something that I >>>>> expect others to follow. >>>>> >>>>> In the past, I worked on the Apache Ignite project. We had a number >> of >>>>> contributi

[jira] [Created] (CALCITE-4986) Make HepProgram thread-safe

2022-01-12 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4986: Summary: Make HepProgram thread-safe Key: CALCITE-4986 URL: https://issues.apache.org/jira/browse/CALCITE-4986 Project: Calcite Issue Type: Bug

[DISCUSS] Writing good summaries for Jira cases

2022-01-12 Thread Julian Hyde
Hi all, Can we discuss how we write summaries for Jira cases? In my opinion it’s really important, because summaries become commit messages, and commit messages become release notes, which is how most people figure out what is in Calcite. I spend a lot of my time working with people to write

Re: [DISCUSS] Refactoring tests

2022-01-12 Thread Julian Hyde
After a month or so of work I have a PR for review. See https://github.com/apache/calcite/pull/2685/ . The PR is huge (80 commits, 127 files changed, 20k lines added/removed) so may be hard to digest. I recommend that you read the commit log to

Re: [DISCUSS] Apache Calcite Online Meetup January 2022

2022-01-12 Thread Julian Hyde
I’d love to hear about your GraphQL implementation. (If the organizers think there is enough time in the meetup.) I don’t think of GraphQL as “niche” at all. It’s a key tool for many, many app developers. It’s just that, despite the “QL” in the name, it’s not a conventional “query language”.

Re: Different behavior bewteen '>' and '='

2022-01-10 Thread Julian Hyde
Yes, this is by design.I believe that the SQL standard set the rules. It’s not that surprising that ‘=‘ has different behavior than ordering-based comparisons such as ‘>’. Consider: given a DATE value d, and a TIMESTAMP value t, it is reasonable to ask ‘is t > d?’ but less reasonable to ask

Re: Sort getting removed during optimization

2022-01-10 Thread Julian Hyde
Is it possible that the Sort is being removed because some component knows that the input is already sorted? In particular, if a relation has at most one row, it is always sorted. Maybe the planner is deducing this via a some row-count metadata or uniqueness constraint. > On Jan 10, 2022, at

Re: Extend parser.jj in calcite, to support the operator '<=>'

2022-01-07 Thread Julian Hyde
It seems analogous to the Postgres-style ‘::’ cast operator. We’d want to support it in Babel but not the core parser. Can you log a JIRA case analogous to https://issues.apache.org/jira/browse/CALCITE-2843 . > On Jan 7, 2022, at 3:06 AM, 徐仁和

Re: [SITE-IMPROVEMENT] Issue need to confirm about the API web

2022-01-07 Thread Julian Hyde
You’re right, those 3 examples don’t look great. They all seem to be caused by Jekyll’s code block (back-ticks), e.g. https://github.com/apache/calcite/blame/cbda134d8e75a8a5c63a1aa9bcddab6fc6756021/site/_docs/howto.md#L73

Re: Apache Calcite - Generated code

2022-01-07 Thread Julian Hyde
+1 everything Scott said But also, if you can use a JDBC PreparedStatement, do so. Calcite will only generate the code once, even if you execute multiple times. All of the caches in Calcite are unnecessary if you use PreparedStatement in your application. > On Jan 7, 2022, at 9:31 AM, Scott

Re: [DISCUSS] Draft board report for Jan 2022

2022-01-07 Thread Julian Hyde
+-+ > | 2021| 10 | 7 | > | 2021| 11 | 2 | > | 2021| 12 | 5 | > +-----+-+-+ > > Top reviewers in the las

Re: [DISCUSS] SBOM (Software Bill of Materials)

2022-01-04 Thread Julian Hyde
Uhr schrieb Julian Hyde < > jhyde.apa...@gmail.com>: > >> No, I don’t think it matters in this case. But consistent use of ROOT is >> useful, because someone in future might be tracking down a bug, and if they >> see ENGLISH it’s one more hypothesis they’d have to dis

Re: [DISCUSS] SBOM (Software Bill of Materials)

2022-01-04 Thread Julian Hyde
4. Jan. 2022 um 20:51 Uhr schrieb Julian Hyde < > jhyde.apa...@gmail.com>: > >> If a method needs a locale, always pass Locale.ROOT. >> > > Ok, I've changed it accordingly. Do you think it actually matters for the > case at hand? > >> On Jan 4, 2022, at

Re: Adding a custom SQL type?

2022-01-04 Thread Julian Hyde
In Eigenbase, the system from which Calcite evolved, there was support for SQL standard ‘CREATE TYPE’. (See Eigenbase documentation, [1]). I think this is what you want. That code has atrophied over the years, but some of it still remains in Calcite. If someone wants to put in the effort, it

Re: [DISCUSS] SBOM (Software Bill of Materials)

2022-01-04 Thread Julian Hyde
If a method needs a locale, always pass Locale.ROOT. > On Jan 4, 2022, at 9:13 AM, Gunnar Morling > wrote: > > Am Di., 4. Jan. 2022 um 09:39 Uhr schrieb Julian Hyde < > jhyde.apa...@gmail.com>: > >> Please log a jira case for the commons-lang3 change. > >

Re: [DISCUSS] SBOM (Software Bill of Materials)

2022-01-04 Thread Julian Hyde
beneficial dependency-wise, > but it may improve the performance of this generation step (I still lack > insight why this is done in the first place). > > Thanks, > > --Gunnar > >> Am Fr., 31. Dez. 2021 um 00:56 Uhr schrieb Julian Hyde < >> jhyde.apa...@g

Re: Trying to call "PreparedStatement.run()" throws "Cannot invoke "calcite.schema.Schema.getTable(String)" because the return value of "calcite.schema.SchemaPlus.getSubSchema(String)" is null"

2022-01-03 Thread Julian Hyde
ng to disk, you just can pass in a String representing the > JSON model. Here's an example: > > > https://github.com/moditect/jfr-analytics/blob/main/src/test/java/org/moditect/jfranalytics/JfrSchemaFactoryTest.java#L381-L388 > > <https://github.com/moditect/jfr-analytics/b

Re: Trying to call "PreparedStatement.run()" throws "Cannot invoke "calcite.schema.Schema.getTable(String)" because the return value of "calcite.schema.SchemaPlus.getSubSchema(String)" is null"

2022-01-03 Thread Julian Hyde
> Will try to figure out how to manually perform the process of creating a > proper "Connection" object and adding the schemas to it. Generally the best way is to write a JSON model, and then create a connection using ‘jdbc:calcite:…model=...'. For that to work, your component needs to

Re: Trying to call "PreparedStatement.run()" throws "Cannot invoke "calcite.schema.Schema.getTable(String)" because the return value of "calcite.schema.SchemaPlus.getSubSchema(String)" is null"

2022-01-01 Thread Julian Hyde
Gavin, The reason is that you need two “ingredients” to execute a query. You need the expression, and you need a connection. The expression is written in terms of relations, which have a fully-qualified path, “schema.subSchema.tableName”. But only the connection (to be precise, its root

Re: [DISCUSS] SBOM (Software Bill of Materials)

2021-12-30 Thread Julian Hyde
ded log4j1.x from this dependency ( > https://github.com/twilio/calcite-kudu/pull/48/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R142-R156). > > > This is an example of dependency we could replace with our own > implementation? > > On Thu, Dec 3

Re: [DISCUSS] SBOM (Software Bill of Materials)

2021-12-30 Thread Julian Hyde
t; case of the Guava version currently used by Calcite; I suppose it does not >> impact the usage in Calcite, but these things tend to be tricky to reason >> about, and typical CVE reporting tooling will now create a warning for a >> project using Calcite, no matter whether t

Re: I have some questions about the offset of the RexRangeRef

2021-12-30 Thread Julian Hyde
Column ordinals are as follows: 0 EMP.EMPNO 1 EMP.ENAME 2 EMP.DEPTNO 3 DEPT.DEPTNO2 4 DEPT.DNAME So I would expect Calcite to return RexInputRef(4, Integer) for DNAME. If you’re seeing RexInputRef(5) there is something strange going on in your environment (e.g. EMP has more columns than you

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