Questions tagged [apache-calcite]

Apache Calcite is a data management framework. Not to be confused with Apache (HTTP Server).

Apache Calcite is a data management framework. It has an implementation of relational algebra, an extensible cost-based optimizer, and an optional SQL parser and JDBC driver.

Calcite is used by Apache Hive and Apache Drill as their query optimizers, and you can use it as a framework to build your own data engine.

Calcite was previously known as Optiq.

255 questions
1
vote
0 answers

Customizing Calcite's Sql parser

I am trying to use Apache Calcite's SqlParser to get entity level lineage for my views written in Hive and Impala. However, the parser throws an exception for the following cases. SELECT emp.1ab FROM emp -- Column name begins with…
Anand Kannan
  • 141
  • 3
  • 8
1
vote
0 answers

Calcite Optimize cause duplicated column name error

We use calcite to execute a mysql query, the SQL is: select a.title, c.score from phx_ep.phx_gql_product a left join phx_ep.phx_gql_product_tag c on a.product_id = c.product_id limit 3 It's simple and clear, but calcite optimized it to: SELECT…
Linyy
  • 23
  • 6
1
vote
0 answers

QueryRecord - Get maximum timestamp

I'm developing a simple data ingestion pipeline, and at some point, I'm processing a group of flow files whose content looks something like this: [ { "ID" : 1, "CREATEDON" : "2019-10-26T18:40:16.000Z", "UPDATEDON" :…
André Machado
  • 726
  • 6
  • 21
1
vote
1 answer

Create RelNode for SELECT 1

Which API should I use in org.apache.calcite.tools.RelBuilder to produce RelNode representing query SELECT 1 in BigQuery?
justAbit
  • 4,226
  • 2
  • 19
  • 34
1
vote
1 answer

Is quote REQUIRED in calcite sql parser?

From the config there is a few options, of \", [ etc. However is it possible for calcite to parse identifiers without quotes? like select * from a.b? Now I must write select * from \"a\".\"b\" and it's kind of annoying.
PeiSong
  • 871
  • 1
  • 7
  • 12
1
vote
1 answer

log4j settings in Apache Calcite project

I have downloaded the Apache Calcite project and opened its Gradle project in IntelliJ IDEA 2019.3.2. I had a problem that it could not load the slf4j classes correctly (I was getting the SLF4J: Failed to load class…
Radim Bača
  • 10,646
  • 1
  • 19
  • 33
1
vote
1 answer

How to use CalciteAssert when test my own adapter?

I wrote a calcite adapter and now I want to write some tests to verify my physical plan. I want to use CalciteAssert to do that like in Cassandra Adapter, but outside the Calcite Project how can I do that? @Test public void testFilter() { …
1
vote
1 answer

Problems with planner and ddl statements in Apache Calcite

When I try to validate a sql statement that contains "CREATE TABLE" it throws a error: java.lang.AssertionError: Was not expecting value 'CREATE_TABLE' for enumeration 'org.apache.calcite.sql.SqlKind' in this context at…
anthonylouis
  • 45
  • 1
  • 2
  • 6
1
vote
1 answer

How to convert Calcite Logical plan to another data engine's physical plan?

I am trying to design the relational table structure and standard SQL query for Apache - IoTDB (a time series database) with Calcite. Now I want to know how i can convert Calcite's logical plan to IoTDB own physical plan easily. For example, I…
1
vote
1 answer

Calcite: Optimize & Rewrite a Query

I am new to Apache Calcite and currently trying to understand if it can optimize and rewrite a given SQL query string. So far I am unable to find any resources on this. Is it possible to do this? Any ideas on where to start?
Cemre Mengü
  • 18,062
  • 27
  • 111
  • 169
1
vote
1 answer

Apache Calcite - registering UDFs for use in RelBuilder

The OOTB sample udf junits (UdfTest.java) make use of a dummy jdbc schema and do not show the usage of RelBuilder api. I am working on registering a simple UDF that returns the length of the input string. I have created the SqlFunction and…
HitchHiker
  • 825
  • 2
  • 11
  • 31
1
vote
0 answers

How do I create a very simple rule using Apache Calcite and use it on Apache Flink?

I have this application in Flink which use Table API to print data from a source. THe official documentation of Flink says that the Table API uses Calcite on its core to translate and optimize query plans. They don't describe it very in deep, so I…
Felipe
  • 7,013
  • 8
  • 44
  • 102
1
vote
2 answers

How can I change calcite's default encode character set?

I use driver manager (eg. jdbc:calcite:inline) to get a calcite connection and run sql with it, but calcite's default encode character set(ISO) don't support Chinese characters, I want to find a method to change the encode character set. I tried the…
Long.zhao
  • 1,085
  • 2
  • 11
  • 16
1
vote
1 answer

Calcite parse sql into parts for mult data source

In my case I'm querying data from multi data source(like csv+mysql) via a single sql. How can I distinguish the data source for tables and detect what columns are queried on tables by using Calcite? (Meta data of data source available) Result that I…
iterrole
  • 13
  • 3
1
vote
1 answer

Creating materialized views in postgres through calcite

I want to setup postgres as a datasource for calcite and make use of calcite's abilities to rewrite queries using materialized views. However, when I try to create a materialized view through calcite I get a postgres error about an insert into…
Mark
  • 11
  • 1