[jira] [Created] (CALCITE-4117) Release Calcite 1.24.0

2020-07-09 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4117: Summary: Release Calcite 1.24.0 Key: CALCITE-4117 URL: https://issues.apache.org/jira/browse/CALCITE-4117 Project: Calcite Issue Type: Bug

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-07-08 Thread Julian Hyde
tended to match Filter, but it compiles > > > .oneInput(b1 -> b1.operand(CassandraTableScan.class) > > > .noInputs())) > > > .as(Config.class) > > > .toRule(); > > > > > &g

Re: [DISCUSS] Make RexNode serializable

2020-07-08 Thread Julian Hyde
l log a JIRA to document people's opinions. > > Currently I am leaning to add serialize()/deserialize() methods to RexNode, > and also see if we can improve RelToJson/JsonToRel to include RexNode > serialization/deserialization (which gives JSON, thus String). > > > -Rui > >

Re: [DISCUSS] Make RexNode serializable

2020-07-08 Thread Julian Hyde
Serializabilty is not very popular in Java right now. There are a bunch of concerns, including security. Serializable classes are very brittle, because it's very easy to add a non-serializable field value in a sub-class. I strongly favor externalizing over serialization. Convert RexNode to a

Re: Question about exposing additional built-in operators

2020-07-08 Thread Julian Hyde
Add something like this to SqlLibraryOperators: @LibraryOperator(libraries = {POSTGRESQL}) public static final SqlFunction LENGTH = ...; and create your JDBC connection with 'fun=postgresql'. LENGTH is not part of the SQL standard, so it should not be in SqlStdOperatorTable. Nor should you

Re: Draft board report for July 2020

2020-07-02 Thread Julian Hyde
Looks good. Thanks! I regard the report as for the quarter (April 1st - June 30th), so the Avatica-go release should rightly go into the Summer report. Julian > On Jul 2, 2020, at 4:31 AM, Stamatis Zampetakis wrote: > > Attached below is a draft of this month's board report. I plan to

Re: Test branch for .asf.yaml features

2020-07-02 Thread Julian Hyde
Can you delete the branch when you’re finished? It’s good to not have too many branches when people browse GitHub. > On Jul 2, 2020, at 12:42 PM, Michael Mior wrote: > > Sounds fine to me although many of the important settings only have > affect in the master branch. I hadn't heard about

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-07-01 Thread Julian Hyde
PS If we take that approach, let's release 1.24 soon. CALCITE-3923 is a big PR and bit-rot will set in if it lingers too long. On Wed, Jul 1, 2020 at 3:23 PM Julian Hyde wrote: > > Stamatis, > > Do you mean we should put into the next release (1.24) just a few > lin

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-07-01 Thread Julian Hyde
t; I will step aside, let you and other community members decide. > > Anyway, my comment is not blocking. > > > > Thanks, > > Haisheng > > > > On 2020/06/17 23:12:40, Julian Hyde wrote: > > > "I prefer the KISS principle" is a bit unfair. What I'm advoc

Re: Question about timestampdiff

2020-06-26 Thread Julian Hyde
Is your question about semantics or implementation? If it's semantics, it's useful if you provide an example where Calcite gives a different result than another DBMS. I find https://rextester.com/l/mysql_online_compiler useful for that. If it's implementation, you should know that YEAR and MONTH

Re: CALCITE-4088

2020-06-26 Thread Julian Hyde
I think CALCITE-471 should have been marked 'fixed' a long time ago, when we resolved https://issues.apache.org/jira/browse/CALCITE-884. I don't think we should add this functionality to the file adapter. No new functionality in the demo adapter. I've explained my reasons in

[jira] [Created] (CALCITE-4089) In Babel, allow 'CAST(integer AS DATE)' even though it is illegal in Calcite SQL

2020-06-24 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4089: Summary: In Babel, allow 'CAST(integer AS DATE)' even though it is illegal in Calcite SQL Key: CALCITE-4089 URL: https://issues.apache.org/jira/browse/CALCITE-4089

[jira] [Created] (CALCITE-4087) Hoist, a utility to replace literals in a SQL string with placeholders

2020-06-23 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4087: Summary: Hoist, a utility to replace literals in a SQL string with placeholders Key: CALCITE-4087 URL: https://issues.apache.org/jira/browse/CALCITE-4087 Project

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

2020-06-19 Thread Julian Hyde
ated during the gradle build, leading it to drift from the one >> committed in git. Vladimir, can you advise what's the best way to >> resolve this? >> >> For 3, I'll update the release history if/when the releases passes the >> vote and becomes final. >> &g

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

2020-06-18 Thread Julian Hyde
+1 Checked signatures, L, compiled and ran tests on Ubuntu (JDK 14, Guava 29.0-jre) and (JDK 8, Guava 14.0), ran RAT. 1. I compared the git repo with the contents of the source distro. The LICENSE file was different. Not a blocker for release, but after release, please update the LICENSE

[jira] [Created] (CALCITE-4072) Avatica build fails with various license errors with Guava 22.0 or higher

2020-06-18 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4072: Summary: Avatica build fails with various license errors with Guava 22.0 or higher Key: CALCITE-4072 URL: https://issues.apache.org/jira/browse/CALCITE-4072 Project

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-06-17 Thread Julian Hyde
instance: > > > > > > private static final CassandraFilterRule INSTANCE2 = > > > Config.EMPTY > > > .withOperandSupplier(b0 -> > > > b0.operand(LogicalProject.class) // Even the is intended > > > to ma

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-06-12 Thread Julian Hyde
FilterJoinRule.FILTER_ON_JOIN.get(). Julian On Thu, Apr 16, 2020 at 12:08 PM Julian Hyde wrote: > > I have now pushed a dev branch with a prototype. Please see > https://issues.apache.org/jira/browse/CALCITE-3923 for details. > > Having built the prototype, I believe that this chang

[jira] [Created] (CALCITE-4061) Build should fail if Calcite code uses deprecated APIs

2020-06-11 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4061: Summary: Build should fail if Calcite code uses deprecated APIs Key: CALCITE-4061 URL: https://issues.apache.org/jira/browse/CALCITE-4061 Project: Calcite

Re: NULL in IN clause

2020-06-08 Thread Julian Hyde
Did you try setting InSubQueryThreshold [1]? It's not particularly easy to set[2], but AFAIK it works if you set it. Julian [1] http://calcite.hydromatic.net/apidocs/org/apache/calcite/sql2rel/SqlToRelConverter.Config.html#getInSubQueryThreshold() [2]

Re: Calcite geode adapter query

2020-06-04 Thread Julian Hyde
Sure, log a JIRA case. Describe the use case as well as you can. Maybe give a SQL example. Julian > On Jun 4, 2020, at 8:57 AM, aashish choudhary > wrote: > > Can we accept a feature request for querying partitioned region with > calcite geode adapter. I don't think it is fully supported.

Re: Avatica results mapping

2020-06-03 Thread Julian Hyde
This problem keeps on coming up. Avatica doesn't handle extended data types very well. I think we hard-code support for everything in java.sql.Types but then we hit the wall when things are "OTHER". There are also types that are widely used that are not in java.sql.Types - e.g. GEOMETRY. They may

[jira] [Created] (CALCITE-4038) Refactor RexVisitor, RexBiVisitor, RelOptUtil.InputFinder

2020-06-02 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-4038: Summary: Refactor RexVisitor, RexBiVisitor, RelOptUtil.InputFinder Key: CALCITE-4038 URL: https://issues.apache.org/jira/browse/CALCITE-4038 Project: Calcite

Re: Using indexes rather than table scans with Calcite

2020-06-02 Thread Julian Hyde
Vladimir, I feel the same way. MVs are more powerful and general, and with some effort they could be just as efficient as other approaches. One problem that needs to be solved is the “registration problem”. If you have a lot of MVs they all have to be registered in the planner’s search space,

Re: Using indexes rather than table scans with Calcite

2020-06-01 Thread Julian Hyde
cost estimation. > >>>>>> > >>>>>> As for your example with disjunctive predicate: > >>>>>> > >>>>>>> SELECT * FROM foo WHERE a > 100 or b < 1000; > >>>>>> > >

Re: [DISCUSS] DDL parsing, and relationship between "server" and "babel" modules

2020-06-01 Thread Julian Hyde
the logic from all of the DDL sub-classes of SqlNode into it. It was a lot more work than I expected. Julian On Fri, May 29, 2020 at 12:26 PM Julian Hyde wrote: > > Thanks for the feedback, everyone. Based on the feedback I will move > the DDL classes to Core. I reserve the right t

Re: [DISCUSS] DDL parsing, and relationship between "server" and "babel" modules

2020-05-29 Thread Julian Hyde
e only classes > that we have there at the moment are those for handling DDL statements it > doesn't bother me a lot. > > If people prefer to go with the "copy-paste" approach I am also fine with > that but it is my least favorite. > > Best, > Stamatis > >

Re: Using indexes rather than table scans with Calcite

2020-05-29 Thread Julian Hyde
Materialized views are not a hack, as Vladimir claims. Materialized views are a fundamental concept in relational algebra, and they are an elegant way - in my opinion the correct way - to model indexes (and many other structures). In Calcite materialized views are a feature in the planner that

Re: A question about subquery output format

2020-05-29 Thread Julian Hyde
That seems to be an improvement. If it can be done without major changes to RelWriter etc. I think you should log a jira, and attach a PR when you have one. Julian > On May 28, 2020, at 3:58 PM, Juhwan Kim wrote: > > Hello, > > When there is a subquery in a plan, it looks like RelWriter

Re: [DISCUSS] What should ProjectFilterTransposeRule do?

2020-05-28 Thread Julian Hyde
m, sal + comm AS remuneration, sal * 0.45 As incometax, > sal * 0.03 AS surchargetax, deptno > FROM Emp) > WHERE deptno = 10 > > Best, > Stamatis > > PS. I will go now and check what the rule does :) > > > On Wed, May 27, 2020 at 8:45 PM Julian Hyde wrote: > &

Re: SqlNode.toSqlString() not parseable by calcite?

2020-05-28 Thread Julian Hyde
Are you aware of SqlUnParserTest? It runs each query in SqlParserTest, converts the AST to SQL, and makes sure that that SQL can be parsed. On Thu, May 28, 2020 at 2:14 AM Bozo Dragojevic wrote: > > Hi! > > > In trying to fix https://issues.apache.org/jira/browse/DRILL-7722 > > I think the path

Re: Master is open

2020-05-27 Thread Julian Hyde
:03:00, Haisheng Yuan wrote: > > OK, let's keep master closed for now. I can confirm that those PRs tagged > > with LGTM are ready to merge. I can go ahead and merge them, but for others > > we need other reviewers to help confirm. > > > > On 2020/05

Re: [VOTE] Release apache-calcite-1.23.0 (release candidate 1)

2020-05-27 Thread Julian Hyde
Haisheng, Thanks for the release announcement yesterday: https://lists.apache.org/thread.html/r555d7f90568ef199c65dfddcf58b14076ac803c0dca64d945d75ba69%40%3Cannounce.apache.org%3E. Can you also send it to dev@? Thank you for getting those 6 PRs into master (3985, 3988, 3910, 3999, 3478, 3950).

[DISCUSS] What should ProjectFilterTransposeRule do?

2020-05-27 Thread Julian Hyde
As part of https://issues.apache.org/jira/browse/CALCITE-3975, I've been looking into what ProjectFilterTransposeRule does with expressions. It's one of our oldest rules, and I thought I knew what it did. But the rule does not do what I expect. I've like to conduct a straw poll to see what other

Re: Link4j AST Node | ExpressionWriter Runtime Exception

2020-05-27 Thread Julian Hyde
Do you really need to create a new kind of Linq4j node? On Wed, May 27, 2020 at 11:03 AM Ravi Kapoor wrote: > > Hi Team, > > The Java AST Node interface in the calcite - linq4j project has below API > for converting expressions to java code > > *void accept(ExpressionWriter expressionWriter)* >

Re: Timestamp/Date offset added to already localized date returned from DB

2020-05-26 Thread Julian Hyde
The trick is to think of TIMESTAMP values in the DB as zoneless. There is no timezone. UTC is not the implicit timezone. There is no timezone. Because the timezone is not stored in the database, the application needs to provide one. When you call getTimestamp(Calendar) you are saying "give me a

Re: Master is open

2020-05-24 Thread Julian Hyde
What about the plan to keep it closed until we handled those deferred PRs? Julian > On May 24, 2020, at 08:19, Haisheng Yuan wrote: > > Hi all, > > Calcite master branch is open for commit now. > > Cheers, > Haisheng

Re: [VOTE] Release apache-calcite-1.23.0 (release candidate 1)

2020-05-21 Thread Julian Hyde
OK, I imported Haisheng's key from KEYS and now it checks out. The message "no public key" was confusing - I thought it meant that the file was not signed, whereas gpg meant that it did not recognize the key. Changing my vote to +1. Haisheng, can you please get one or two people to sign your

Re: [VOTE] Release apache-calcite-1.23.0 (release candidate 1)

2020-05-21 Thread Julian Hyde
-case and in back-ticks; ** I don't like the long lines - can we go back to breaking at 80? ** In 'it's worth mentioning the following', remove JIRA case numbers so that the paragraph reads like prose rather than a list. On Thu, May 21, 2020 at 10:57 AM Julian Hyde wrote: > > Maybe I'm mi

Re: [VOTE] Release apache-calcite-1.23.0 (release candidate 1)

2020-05-21 Thread Julian Hyde
Maybe I'm mistaken, but the source tarball doesn't seem to be signed: $ gpg --verify apache-calcite-1.23.0-src.tar.gz.asc apache-calcite-1.23.0-src.tar.gz gpg: Signature made Fri 15 May 2020 08:52:43 PM PDT gpg:using RSA key ECA9CF33AF2CEC28F3B66A5C3CD22ABAC50DDCEF gpg: Can't

[DISCUSS] DDL parsing, and relationship between "server" and "babel" modules

2020-05-15 Thread Julian Hyde
Currently, there is no DDL in Calcite's "core" module (or its SQL parser) and the SQL parser in the "server" module adds DDL extensions for Calcite's object types. There is a PR [1][2] to add support for "CREATE TABLE" to Babel, and it makes "babel" extend the "server" module. In particular, it

Re: Apache calcite / jdbc Oracle

2020-05-14 Thread Julian Hyde
That sounds like a bug in Avatica. I was not aware that in 'isWrapperFor(Class iface)', 'iface' had to be an interface, and had assumed the driver would just return 'false'. Can you please log it? A solution would be to create an interface in Avatica for AvaticaPreparedStatement. (It seems that

Re: [DISCUSS] Towards Cascades Optimizer

2020-05-14 Thread Julian Hyde
t; >> > > >>> Hi all, > > >>> > > >>> As planned in my proposal, I opened the pull request [1] for > > CALCITE-3896 > > >>> to achieve: > > >>> 1. Top-down trait request > > >>> 2. Bottom

Re: [DISCUSS] Keep 'master' branch closed after 1.23 release until we address the PR backlog

2020-05-13 Thread Julian Hyde
don't figure out why we should keep the master branch closed. To > avoid conflict? > > > Best, > Chunwei > > > On Wed, May 13, 2020 at 2:22 AM Julian Hyde wrote: > > > I noticed that yesterday Haisheng removed the ‘fix in 1.23’ labels from > > several JIRA c

[DISCUSS] Keep 'master' branch closed after 1.23 release until we address the PR backlog

2020-05-12 Thread Julian Hyde
I noticed that yesterday Haisheng removed the ‘fix in 1.23’ labels from several JIRA cases. I support this - we need to get a release out - but I don’t want to lose the fact that many of these cases had PRs and were ready to merge to master. We all know that we have a backlog of PRs. There are

Re: [CANCEL] [VOTE] Release apache-calcite-1.23.0 (release candidate 0)

2020-05-12 Thread Julian Hyde
Even though the vote is canceled, everyone please continue to test on RC0 (until an RC1 is available). The earlier you find and report issues, the sooner we get to a good release. > On May 12, 2020, at 6:11 AM, Haisheng Yuan wrote: > > The vote for Apache Calcite 1.23.0 release candidate 0

Re: [DISCUSS] Towards Cascades Optimizer

2020-05-11 Thread Julian Hyde
trait request, now all tests passed. >>> >>> In our system, 99 tpcds queries' test results show almost no plan diff, >>> but the number of relnodes created during optimization is reduced by 10~15% >>> average (even without space pruning). I believe for other sy

Calcite in research - The ReProVide Query-Sequence Optimization in a Hardware-Accelerated DBMS

2020-05-09 Thread Julian Hyde
Calcite is being used in a research project that accelerates queries using FPGAs (The ReProVide Query-Sequence Optimization in a Hardware-Accelerated DBMS, by Lekshmi B. G., Andreas Becher, Klaus Meyer-Wegener, https://arxiv.org/pdf/2005.01511.pdf .)

Re: [DISCUSS] Towards Calcite 1.23.0

2020-05-05 Thread Julian Hyde
Thanks for volunteering, Haisheng. Before everyone piles in with wish-lists, can we set a timescale for the release? I would suggest an aggressive timescale, for example an RC a week from today. Hold the RC only for mandatory cases. Other stuff gets in if it’s ready. Julian > On May 5,

Re: Advise on ClassCastException in Linq4j$EnumeratorIterator

2020-05-05 Thread Julian Hyde
To repeat. In Enumerable convention, a SQL TIMESTAMP value must be represented as a Java Long value. Julian PS Please subscribe to the dev list, to avoid moderation delays. And do not email issues@; it is only for automatically generated emails. > On May 5, 2020, at 7:22 AM, Ayelet Morris

Re: "calcite" and "calcite-examples" missing from release 1.22?

2020-05-01 Thread Julian Hyde
I disagree. They have a purpose. We used to publish them, and we should continue to publish them. If you had a good reason to publishing them when you migrated us to Gradle, you should have let us know. One negative side-effect is that if you search for "apache calcite" on Maven Central [1] it

[jira] [Created] (CALCITE-3967) Publish components "calcite" and "calcite-examples"

2020-05-01 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-3967: Summary: Publish components "calcite" and "calcite-examples" Key: CALCITE-3967 URL: https://issues.apache.org/jira/browse/CALCITE-3967

Re: Re: [ANNOUNCE] New committer: Wang Yanlin

2020-05-01 Thread Julian Hyde
lian, having an entry on the powered by page for Ant Financial would > be nice. > > > > [1] is the official homepage of the company I'm serving. > > > Yanlin > > > > > [1] https://www.antfin.com/ <https://www.antfin.com/> > > > > > > >

Re: "calcite" and "calcite-examples" missing from release 1.22?

2020-04-30 Thread Julian Hyde
Rather than opening up a new debate, can we just carry on doing what we always did? > On Apr 28, 2020, at 12:03 PM, Vladimir Sitnikov > wrote: > >> If you search for Calcite on Maven Central [1] you will see that the > latest version of the “calcite” and “calcite-examples” artifacts is 1.21,

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-30 Thread Julian Hyde
t; On Tue, Apr 28, 2020 at 11:22 AM Xiening Dai >> wrote: >>> >>>> For #1, aside from that we need to be able to build physical nodes based >>>> on a convention. For example, if we merge two EnumerableProject, we >> would >>>> want to create

Re: [ANNOUNCE] New committer: Forward Xu

2020-04-30 Thread Julian Hyde
Congratulations and welcome, Forward! Thank you for your contributions. It would be great to add TBDS (and its logo) to the “powered by” page[1]. What do you think? Julian [1] https://calcite.apache.org/docs/powered_by.html > On Apr 29, 2020,

Re: [ANNOUNCE] New committer: Wang Yanlin

2020-04-30 Thread Julian Hyde
Welcome, Yanlin! Thanks for your contributions so far, and thanks for introducing yourself. I often learn so much from committers’ self-introductions about how Calcite is being used. I know we have other Alibaba-related projects on the “powered by” page [1] (Flink/Ververica, MaxCompute) but

Re: [ANNOUNCE] New committer: Jin Xing

2020-04-30 Thread Julian Hyde
Welcome Jin! Thanks for your contributions so far, looking forward to more! Are you on the MaxCompute project? It’s already on our “powered by” page[1], so I think people are familiar with it. Julian [1] https://calcite.apache.org/docs/powered_by.html#alibaba-maxcompute

Re: [DISCUSS] Deprecate grouped window functions

2020-04-30 Thread Julian Hyde
e > helpful otherwise we need to maintain our own fork which we could mostly > prevent so far. > > Regards, > Timo > > On 29.04.20 00:49, Rui Wang wrote: >> Agreed. I would like to get more feedback to have a >> reasonable accommodation for users. >> -Rui &g

Re: [DISCUSS] Deprecate grouped window functions

2020-04-30 Thread Julian Hyde
> On Apr 30, 2020, at 8:16 AM, Viliam Durina wrote: > > What is the status of polymorphic table functions? We'd like to use them. Off topic. Can you start this discussion in a new thread? Julian

Re: How to give type in case of type mismatch while doing union

2020-04-29 Thread Julian Hyde
> On Apr 29, 2020, at 21:31, Danny Chan wrote: > > Or try SQL, it has the implicit type coercion ~ That’s true. SQL is a great way to build relational algebra expressions. Highly recommended. Julian

"calcite" and "calcite-examples" missing from release 1.22?

2020-04-28 Thread Julian Hyde
If you search for Calcite on Maven Central [1] you will see that the latest version of the “calcite” and “calcite-examples” artifacts is 1.21, whereas the latest version of everything else is 1.22. Is this intended behavior, or a mistake introduced by the move to Gradle? Julian [1]

Re: How to build and publish non-SNAPSHOT version?

2020-04-28 Thread Julian Hyde
PS Oops. You'll obviously want to change val baseUrl = "https://nexusrepo.looker.com; to reference your repo, not Looker's. :) On Tue, Apr 28, 2020 at 9:36 AM Julian Hyde wrote: > > I got some some advice from Vladimir, but ran into problems with > releases, as you

Re: How to build and publish non-SNAPSHOT version?

2020-04-28 Thread Julian Hyde
I got some some advice from Vladimir, but ran into problems with releases, as you did. I came up with this. Put the following in your ~/.gradle/init.gradle.kts file, and change the username and password: allprojects { plugins.withId("maven-publish") { configure {

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-27 Thread Julian Hyde
. Julian > On Apr 27, 2020, at 4:59 PM, Julian Hyde wrote: > > Re 1. By all means have multiple instances of a rule (e.g. one instance that > matches LogicalFilter and another that matches FooFilter) and enable > different instances during different phases. (We have been slo

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-27 Thread Julian Hyde
n and propagation, > etc) during transformation phase, if it was clearly defined and enforced by > framework. > > >> On Apr 27, 2020, at 11:59 AM, Julian Hyde wrote: >> >> This thread has almost gotten too long to respond to. I confess I’ve not >> read m

Re: How to give type in case of type mismatch while doing union

2020-04-27 Thread Julian Hyde
Anjali, If you’re using RelBuilder to create the union, or creating the union manually, it is your responsibility to make sure that the input RelNodes have compatible types. RelDataTypeFactory.leastRestrictive(List) may be useful. Julian > On Apr 27, 2020, at 1:32 PM, Rui Wang wrote: > >

Re: [DISCUSS] Towards Cascades Optimizer

2020-04-27 Thread Julian Hyde
This thread has almost gotten too long to respond to. I confess I’ve not read much of it. I’m going to reply anyway. Sorry. I support making Calcite’s optimizer support “Cascades”. We should keep the existing VolcanoPlanner working during the transition, and perhaps longer. (I acknowledge that

Re: [DISCUSS] Deprecate grouped window functions

2020-04-27 Thread Julian Hyde
concepts such as SqlGroupedWindowFunction and auxiliary group functions? >> Or are you intending to just remove entries from Calcite's default >> operator table? >> >> Regards, >> Timo >> >> >> On 24.04.20 10:30, Julian Hyde wrote: &g

Re: [ANNOUNCE] New committer: Vineet Garg

2020-04-27 Thread Julian Hyde
Welcome Vineet! Thanks for your contributions so far. > On Apr 26, 2020, at 2:38 PM, Vineet G wrote: > > Thanks a lot guys! > > Just to briefly introduce myself - I work with Cloudera (Hortonworks before) > on Hive and I am a Hive PMC member. As Stamatis noted I have been involved in >

Re: Advise on ClassCastException in Linq4j$EnumeratorIterator

2020-04-27 Thread Julian Hyde
In the Enumerable convention, values of SQL datatype TIMESTAMP are represented using Java values of type java.lang.Long. Not sure exactly what you’re doing wrong, but your query (or other code) that gets the values into Java should be getting them as Long, not as java.sql.Timestamp values.

Re: [DISCUSS] Deprecate grouped window functions

2020-04-24 Thread Julian Hyde
+1 Let’s remove TUMBLE etc from the GROUP BY clause. Since this is a SQL change, not an API change, I don’t we need to give notice. Let’s just do it. Julian > On Apr 22, 2020, at 4:05 PM, Rui Wang wrote: > > Made a mistake on the example above, and update it as follows: > > // Table

Re: Stored Proc to Relational Expression

2020-04-23 Thread Julian Hyde
xperimental. > > > > > > Moreover, if your end goal is to push the computation in a DBMS, I have > > to > > > warn you that the code to translate these expressions back to SQL is not > > > there yet. > > > > > > Best, > > > Stama

Re: Understanding annotations of SqlGroupingFunction

2020-04-23 Thread Julian Hyde
nder are being >> grouped >> >> should really mean that the row which represents the grand total i.e >> without group by expression. will return 3. >> >> FYI Hive had its behavior fixed with >> https://issues.apache.org/jira/browse/HIVE-16102 &

Re: Understanding annotations of SqlGroupingFunction

2020-04-21 Thread Julian Hyde
Suppose we have one row that represents the total for department 10, and another that represents the grand total of all departments. Which row would we say that department is “grouped” (in Calcite’s parlance) or “aggregated” in (Hive’s parlance)? I find the terms confusing. It’s possible that

Re: Stored Proc to Relational Expression

2020-04-20 Thread Julian Hyde
Calcite relational expressions can represent SELECT, INSERT etc. but not procedural code. It’s a direction we could consider going. RexProgram is the closest thing we currently have to procedural code in the algebra - single assignment of variables, use of variables in expressions assigning to

Re: [discuss] Add the default mode to the path in the Json functions.

2020-04-20 Thread Julian Hyde
Speaking of JSON functions, JOOQ creator Lukas Eder has been giving JSON functions in MySQL/MariaDB a good workout over the last few days. It’s amusing to read what he has discovered: https://twitter.com/lukaseder Julian > On Apr 20, 2020, at 8:27 AM,

Generating SQL with non-ASCII characters in string literals

2020-04-16 Thread Julian Hyde
Someone just logged https://issues.apache.org/jira/browse/CALCITE-3933 "Incorrect SQL Emitted for Unicode for Several Dialects”. Consider the literal ‘schön’ (German for ‘beautiful’). It seems that we generate SQL standard syntax,

Re: How to get the used columns (categorized by tables) from a SQL

2020-04-16 Thread Julian Hyde
At the RelNode level, you can use RelMetadataQuery.getColumnOrigins. But I’m sure that there’s something available at the SqlNode level, after validation. PreparedExplain.getFieldOrigins() is what the JDBC driver uses to provide ResultSetMetadata.getColumnName(int) etc. Julian > On Apr 16,

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-04-16 Thread Julian Hyde
. Julian On Tue, Apr 14, 2020 at 2:06 PM Julian Hyde wrote: > > Haisheng, > > I hear you. I agree that major changes to rules will require new rule > classes (not merely sub-classes). People should copy-paste, refactor, > and all that good stuff. But I think there are a lot of cas

Re: Re: [DISCUSS] Refactor how planner rules are parameterized

2020-04-14 Thread Julian Hyde
0 at 9:20 PM Michael Mior wrote: > > > This sounds reasonable to me. It also sounds like we could make this > > backwards compatible by retaining (but deprecating) the existing > > constructors and factory methods that will no longer be needed. > > -- > > Michael Mior

[jira] [Created] (CALCITE-3923) Refactor how planner rules are parameterized

2020-04-14 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-3923: Summary: Refactor how planner rules are parameterized Key: CALCITE-3923 URL: https://issues.apache.org/jira/browse/CALCITE-3923 Project: Calcite Issue Type

Re: Calcite translates in-subqueries to inner joins

2020-04-14 Thread Julian Hyde
Stamatis, When you say "generate semi/anti joins directly” do you mean generate RexSubQuery expressions? I hope so. In the past SqlToRelConverter tried to convert sub-queries to RelNodes but things got too complex. RexSubQuery expressions (dealt with by SubQueryRemoveRule during planning) is

Re: [DICUSS] Support building physical RelNode in Calcite

2020-04-08 Thread Julian Hyde
It's challenging to support all physical operators, but we can and should support many of them in RelBuilder. As Haisheng points out, some physical operators have extra operands. Maybe some of those operands can be added to the factory interfaces, or shoe-horned in in some clever way. (Note how

Re: JMH dependency vs licensing

2020-04-08 Thread Julian Hyde
We must not publish the jar. GPL is a category X license. On Wed, Apr 8, 2020 at 2:56 PM Stamatis Zampetakis wrote: > > I'm fine with the decision of not publishing the jar. > > I never used the jar itself but I noticed while working with another > project using jmh. > > Indeed having

Re: Rel as a service

2020-04-07 Thread Julian Hyde
Andrii, You mentioned that "optimizations that happen during SQL-to-Rel conversion": > One thing to consider is there are some optimizations that happen during > SQL-to-Rel conversion, so you won't get those if you use RelBuilder > directly. I'd like to minimize these.

[jira] [Created] (CALCITE-3897) Windowed aggregate with bracket (ROWS or RANGE) without ORDER BY is invalid

2020-04-05 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-3897: Summary: Windowed aggregate with bracket (ROWS or RANGE) without ORDER BY is invalid Key: CALCITE-3897 URL: https://issues.apache.org/jira/browse/CALCITE-3897

Re: [DISCUSS] Remove Guava from public API surface in Calcite

2020-04-03 Thread Julian Hyde
Previous discussion: https://lists.apache.org/thread.html/5988348d9451255da3b45cb67e92a375d337859711fd0b66c9f42407%40%3Cdev.calcite.apache.org%3E On Fri, Apr 3, 2020 at 4:04 PM Rui Wang wrote: > > Hi community, > > Calcite exposes Guava on some public surface. Do you think it is worth > removing

Re: Draft board report for April 2020

2020-04-02 Thread Julian Hyde
“A talk was given ...”. You’re too modest, Stamatis. And as my copy editor said, passive voice should rarely be used. “Stamatis gave a talk ...” is better; fewer words, more information, more interesting to read. Julian > On Apr 1, 2020, at 3:08 PM, Stamatis Zampetakis wrote: > >

Re: Asking help for parsing MySql Alter Table statements

2020-04-02 Thread Julian Hyde
Calcite server supports a minimal set of DDL commands so that you can create a Calcite server with state. However I don’t see us adding a lot of other commands, or supporting other engines’ syntax (which would probably reference concepts that do not exist in Calcite). So the Babel module is

Re: TIMESTAMPDIFF and datetime subtraction can not work well with JDBC adapter

2020-04-02 Thread Julian Hyde
I think you have identified the issues correctly. I prefer SqlDatetimeSubtractionOperator to SqlTimestampDiffFunction because it is standard and more powerful. But some work is needed to make SQL generation run smoothly. Especially with data types, as you point out. I would approach this by

[jira] [Created] (CALCITE-3892) Make junit test classes and methods non-public

2020-04-01 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-3892: Summary: Make junit test classes and methods non-public Key: CALCITE-3892 URL: https://issues.apache.org/jira/browse/CALCITE-3892 Project: Calcite Issue

Re: Split Join condition with CAST which only widening nullability

2020-03-31 Thread Julian Hyde
think that > would just cause > trouble; are there some other way which I've not considered? > > cheers, > Zoltan > > On 3/30/20 7:19 PM, Julian Hyde wrote: > > If we're going down the path, we should consider that 'b IS TRUE' and > > 'b IS NOT FALS

Re: Join Pruning/Rewrites

2020-03-27 Thread Julian Hyde
Can you give an example using real-ish tables eg customers, products, orders. And show the 2 sql statements that you allege to be equivalent. I have a feeling that it’s important which join keys you use. Julian Ps also please join the list so that you get replies. > On Mar 27, 2020, at

Re: Parsing Teradata SQL with Apache Calcite

2020-03-26 Thread Julian Hyde
There are a few related concepts that make up the general idea of "dialect": * *dialect* determines how the JDBC adapter convert SqlNodes to SQL (e.g. generate "LIMIT 5" or "FETCH 5 ROWS") * *conformance* determines what features the validator will allow (e.g. does "GROUP BY 1" mean group by the

Re: Join the community

2020-03-26 Thread Julian Hyde
venient when I wanted to refer > to everybody and not only to committers and PMC members:) > > Anyways, having an extra pair of hands is good news, looking forward > working with you Roman! > > Best, > Stamatis > > [1] https://www.apache.org/foundation/how-it-works.htm

Re: Join the community

2020-03-24 Thread Julian Hyde
Sorry, I need to be pedantic. In Apache, there is no such thing as a “contributor”. There are committers and PMC members, and there is the community - which consists of anyone in the world who takes an interest. Unfortunately Jira requires people to be given a particular permission in order

Re: set SqlToRelConverter.ConfigBuilder#expand default to false

2020-03-24 Thread Julian Hyde
I agree that expand should default to false in ConfigBuilder. Rationale: expand = false is the preferred modern behavior. We want SqlToRelConverter to leave sub-queries as sub-queries (wrapping in RexSubQuery) and then deal with them later with SubQueryRemoveRule. It is difficult for

Re: STREAM keyword

2020-03-24 Thread Julian Hyde
You’re right that this is a problem. We’d need some way to say that you don’t care which version of the product table you are joining against. One implication would be that if you replay the query, and the product table has changed in the mean time, you are happy to get different results. We

Re: Split Join condition with CAST which only widening nullability

2020-03-24 Thread Julian Hyde
applying >> > hash-join/sort-merge-join rule, such that equiv predicate can be split >> > out. I'm not sure whether it's properly for Calcite to do the 'convert >> > back' job, for example, simplify the join condition when create a >> Join; Or >> >

<    8   9   10   11   12   13   14   15   16   17   >