Hello all,
Calcite is great! However, I think that there are several areas where the
project could do better:
- testing
- documentation
- legacy code cleanup
(1) Testing: Most of my work in Calcite so far has been about testing. I have
contributed the SqlLogicTest suite, which uncovers many
This doe look like a bug in Avatica, indeed.
Maybe you can file an issue on the JIRA.
https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-5990?filter=a
llopenissues
You should provide enough instructions to reproduce this bug.
Mihai
-Original Message-
From: Egor Ryashin
Sent:
One of the main differences between SqlNode and RelNode is that RelNode can
only represent valid programs. This is ensured by the validator. Most, if
not all, optimizations rely on the program being a legal program in order to
manipulate it. The validator also adds additional information to your
This is a notorious problem in C++-like languages.
There are possible workarounds, depending on the parser generator you are using.
In the P4 compiler, which does parsing using flex and bison, we essentially
never parse ">>" as a token [1], but we reconstruct it from two adjacent ">"
when used
I will take care of https://issues.apache.org/jira/browse/CALCITE-5990
However, it is the first time I notice this issue, I wonder whether I missed
some notification.
Mihai
-Original Message-
From: Benchao Li
Sent: Sunday, October 8, 2023 12:01 AM
To: dev@calcite.apache.org
Cc:
Maybe I will write a blog post about this (I couldn't find documentation about
this with a web search), but for now this is a short summary.
Hopefully nothing I say here is wrong, this is relatively new stuff for me too.
Calcite uses a two-step code generation process to create the parser:
-
While I am not directly answering this question, I want to point out that other
databases have very flexible formats.
Here is an excerpt from Postgres:
https://www.postgresql.org/docs/current/datatype-datetime.html
Example Description
1999-01-08 ISO 8601; January 8 in any mode
Hello,
I submitted a PR https://github.com/apache/calcite/pull/3435 which passes
all tests locally, but fails the Druid tests in CI:
https://github.com/apache/calcite/actions/runs/6257240352/job/16989292034?pr
=3435
Does anyone know what I have to do to reproduce these locally?
Thank you,
I can't answer to this particular question, but I have been working on a
Calcite test fixture (a tool which helps run many tests) for RelToSqlConverter
and I found tens of bugs, which I haven't had yet time to file as issues. So
it's very possible that this is a genuine bug.
Mihai
The following issues discuss the semantics of TIMESTAMPDIFF:
https://issues.apache.org/jira/browse/CALCITE-1827,
https://issues.apache.org/jira/browse/CALCITE-3529,
https://issues.apache.org/jira/browse/CALCITE-1124.
They all mention MySQL as a reference for this function.
This would suggest that
I am looking at the TIMESTAMPDIFF function and every SQL dialect seems to
have a slightly different definition, e.g.:
Databricks:
https://docs.databricks.com/en/sql/language-manual/functions/timestampdiff.h
tml seems to round after computing the result:
One month is
Why does Calcite support arbitrary precision time-strings and yet makes it
practically impossible to extract anything but milliseconds?
Mihai
mbudiu, thanks for your patience. Yes, a[x] interpret as a[OFFSET(x)] for
BigQuery. I tried this, and it is okay too.
On Wed, Aug 9, 2023 at 02:48 wrote:
> This has nothing to do with the "Split" function. It is all about
> indexing in arrays.
>
> The list of Dialect-specifi
write a[x] and it should be interpreted as a[OFFSET
(x)] when using BigQuery?
Mihai
-Original Message-
From: P.F. ZHAN
Sent: Tuesday, August 08, 2023 11:37 AM
To: dev@calcite.apache.org
Subject: Re: [Discussion] Split function has some wrong and strange behaviors
Hi, mbudiu.
f.check
calcite.rel.rel2sql.RelToSqlConverterTest#testIndexWithoutO
> peratorBigQuery
>
>
> I also checked the BigQuery doc which only mentions these standard
> usages in our test case of *testIndexOperatorsBigQuery*, but in fact
> when we use SQL like
>
> > select split('aaa-bbb
8, 2023 at 10:31 AM P.F. ZHAN mailto:dethr...@gmail.com> > wrote:
> Thank you mbudiu, Ran Tao and Lake Shen.
>
> I have tried your suggestions and debugged the code, this kind of sql
> seems not support
>
>> select split('aaa-bbb-ccc', '-')[1]
>>
>
> I hav
c', '-')[ offset(0)]
Maybe Calcite should support this kind of usage rather than treat it as a
limitation.
On Tue, Aug 8, 2023 at 10:31 AM P.F. ZHAN wrote:
> Thank you mbudiu, Ran Tao and Lake Shen.
>
> I have tried your suggestions and debugged the code, this kind of sql
>
I notice that SqlColumnDeclaration has a non-public constructor, which makes
it impossible to extend from a different package.
Is this design intentional or is it a bug?
(There are some good reasons for extending this class. For example, a
comment on the class says "FOREIGN KEY when we
See also this thread: https://issues.apache.org/jira/browse/CALCITE-5760
You can run CalciteSqlOperatorTest instead.
If you want to quickly debug only this test in the IDE you can copy-paste this
test into the CalciteSqlOperatorTest class and run it from there, then delete
it when you are done.
Calcite gives you hooks to change these limits.
For example:
public static final RelDataTypeSystem TYPE_SYSTEM = new RelDataTypeSystemImpl()
{
@Override
public int getMaxNumericPrecision() {
return MAX_PRECISION;
}
@Override
public int
I found this documentation for Oracle DECIMAL data type:
https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/Data-Types.html#GUID-75209AF6-476D-4C44-A5DC-5FA70D701B78,
which explains what a SCALE > PRECISION should mean.
> Scale can be greater than precision, most commonly when
I have added this test to SqlOperatorTest:
f.checkScalar("cast(0.012 as DECIMAL(2, 5))", new BigDecimal("0.012"),
"DECIMAL(2, 5) NOT NULL");
and it has passed. That's why I am asking. It should fail, but it doesn't.
Mihai
-Original Message-
From: stanilovsky evgeny
Sent:
Hello,
I notice that Calcite happily accepts decimal type specifications where the
scale is greater than the precision.
There are quite a few tests with such types.
What is the meaning of such types?
The SQL 92 standard has this statement on page 109:
15)The of an shall not be
Hello all,
I have a question about user-defined functions. I see that one can extend
Calcite by adding new functions to various libraries.
My question is whether there exists a mechanism to add such functions
*dynamically*, without changing the Calcite code.
This would allow users to write
ambiguity
in the grammar.
Not having literals for empty arrays is like having numbers without a zero
literal.
Mihai
-Original Message-
From: Ran Tao
Sent: Tuesday, August 01, 2023 5:04 AM
To: dev@calcite.apache.org
Subject: Re: Empty array literal
Hi, mbudiu.
thanks for creating
Hello,
It looks to me like the Calcite grammar does not accept empty array literals
"ARRAY[]".
This sounds like a serious omission.
Is there a fundamental reason why this isn't in the grammar?
If there isn't, I can file an issue for it.
I can see a workaround using the Spark "ARRAY()"
Mihai
-Original Message-
From: LakeShen
Sent: Friday, July 28, 2023 7:04 PM
To: dev@calcite.apache.org
Subject: Re: Easier and more comprehensive testing
Hi mbudiu,thank you for bringing SqlLogicTest to calcite.
Now we're working on an optimizer based on Calcite that supports Postgresql
se
The correct link is
https://github.com/feldera/dbsp/tree/main/sql-to-dbsp-compiler, but it's not
particularly important, I apologize for the broken one.
I appreciate you pointing out the Sql Logic Test project, I wrote that code
too. But these two projects are almost entirely disjoint. SLT
Hello,
I am working to test our calcite-based compiler
(https://github.com/feldera/dbsp/sql-to-dbsp-compiler), and since I am lazy
I am borrowing tests from other open-source test suites, like Postgres.
I am finding bugs in Calcite with a relatively high frequency, as you may
have noticed if
Hello,
I have a question about the type inference for case expressions. Consider
this query from the Postgres tests:
https://github.com/postgres/postgres/blob/137b131d6fbd29b4acf740aba3f74220fa
ef2678/src/test/regress/expected/case.out#L136
SELECT i AS "Value",
CASE WHEN (i < 0) THEN
Which parser are you using, the server (DDL) or Babel?
I think DATEADD exists only in Babel.
To solve this problem in our project we have combined both parsers into one,
so now we can parse Babel + DDL.
https://github.com/feldera/dbsp/pull/276
Mihai
-Original Message-
From: Nathaniel
Calcite is extremely flexible, you can assemble an optimizer manually, to do
exactly what you want.
Here is our example:
Actually Postgres documents this behavior:
https://www.postgresql.org/docs/15/functions-string.html
text || anynonarray → text
anynonarray || text → text
Converts the non-string input to text, then concatenates the two strings.
(The non-string input cannot be of an array type, because that
Hello,
What happens when you concatenate a CHAR(N) and a VARCHAR value?
Calcite seems to insert no casts before concatenation, so the trailing
spaces for the CHAR(N) value are preserved.
However, Postgres has the following test:
>From my experience the Babel parser does NOT include DDL - at least not in the
>released versions.
Mihai
-Original Message-
From: Askar Bozcan
Sent: Friday, June 23, 2023 1:14 AM
To: dev@calcite.apache.org
Subject: Re: Calcite for Lineage
Hey Nathaniel,
To parse DDL statements, you
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 expensive, since the string needs to
be parsed and serialized back for every operation.
Snowflake uses VARIANT
This seems to be the same as UNNEST WITH ORDINALITY, in Calcite since 2016.
https://issues.apache.org/jira/browse/CALCITE-854
Mihai
-Original Message-
From: Soumyadeep Mukhopadhyay
Sent: Saturday, June 03, 2023 10:42 AM
To: dev@calcite.apache.org
Subject: Re: Implementing EXPLODE
at the simplification code to see whether it handles such
cases.
Thank you,
Mihai
-Original Message-
From: Jiajun Xie
Sent: Friday, June 02, 2023 7:08 PM
To: dev@calcite.apache.org
Subject: Re: Algebraic optimizations rule
Hello, mbudiu:
Based on my experience, constant folding can occur in two
Hello,
I was looking for rules that apply algebraic optimizations to RexNode
expressions, such as 0 + x = x, but I couldn't find any.
Is there such a rule?
Mihai
39 matches
Mail list logo