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
0
votes
1 answer

Apache calcite:parse failed: Encountered "from \""

I am currently attempting to connect mysql using calcite. However, I had problems executing SQL statements When I use this sql to excute,it works. ResultSet resultSet = statement.executeQuery( "select * from ex.depts"); But I would like…
EJTtianyu
  • 3
  • 3
0
votes
2 answers

Why does Apache Calcite estimates 100 rows for all tables a query contains?

I recently tried to execute a query in Apache Calcite using three CSV files as tables TTLA_ONE contains 59 rows TTLR_ONE contains 61390 rows EMPTY_T contains 0 rows This is the query which is executed: EXPLAIN PLAN FOR SELECT COUNT(*) as NUM…
0
votes
1 answer

Having an equivalent to HOP_START inside an aggregation primitive in Flink

I'm trying to do an exponentially decaying moving average over a hopping window in Flink SQL. I need the have access to one of the borders of the window, the HOP_START in the following: SELECT …
0
votes
1 answer

An exponentially decaying moving average over a hopping window in Flink SQL: Casting time

Now we have SQL with fancy windowing in Flink, I'm trying to have the decaying moving average referred by "what will be possible in future Flink releases for both the Table API and SQL." from their SQL roadmap/preview 2017-03 post: table …
0
votes
1 answer

Apache Calcite throws error when using COALESCE with untyped nulls only

When runnning SELECT COALESCE(NULL, NULL); on Apache Calcite I get an error which tells that ELSE clause or at least one THEN clause must be non-NULL This happens because COALESCE function is transformed to CASE expression and the latter is…
Bohdan
  • 93
  • 1
  • 5
0
votes
2 answers

Scala Error: java.sql.SQLException: No suitable driver found for jdbc:calcite:

I created a jar of a Scala application using maven-assembly-plugin. Now when I execute the jar with java -jar path\to\jar\myapp.jar it throws the following error: Exception in thread "main" Exception in thread "Timer-0" java.lang.RuntimeException:…
user5512021
0
votes
1 answer

calcite elasticsearch adapter efficient join

What is the proper way to implement JOIN rewrite to allow query to be fed with results of subquery? For example: SELECT state FROM zips_view WHERE j IN (select j from people_view) This query gets rewritten to SemiJoin which executes table scan…
0
votes
1 answer

Apache Calcite - How to Integrate CSV and MySQL

It is easy to use each adapter by command connect. for example: !connect jdbc:calcite:model=target/test-classes/model.json admin admin but I have not found in documentation how to do queries involving heterogeneous sources. I would like to do a…
Romulo Freires
  • 701
  • 5
  • 3
0
votes
1 answer

Get the relational algebra generated by Apache Calcite

I'm trying to build a translator from SQL to some format that I can parse and execute using my code. Is it possible to parse a query through Apache Calcite and get the output in some parseable format, like JSON?
Ivan
  • 19,560
  • 31
  • 97
  • 141
0
votes
1 answer

Modify select identifiers in Sql Query using calcite

I want to modify a SQL query using Calcite. For example SELECT values FROM data to SELECT values as v FROM data I could access SqlNode of select identifier using SqlVisiter implementation. public Object visit(SqlCall sqlCall) { SqlNodeList…
Shashwat Kumar
  • 5,159
  • 2
  • 30
  • 66
0
votes
2 answers

How does Calcite deal with data conversion?

I am trying to convert a date that's stored as a string to a date, e.g. YYYYMMDD (string) to YYYY-MM-DD (date) As far as I know there is no conversion function that checks input format and output format, I tried manual logic, e.g. CASE WHEN…
Agni
  • 19
  • 1
  • 4
0
votes
0 answers

Kafka Connect - NoClassDefFoundError: Could not initialize class org.apache.calcite.jdbc.Driver

When posting a new source connector using Confluent: curl -X POST -H "Content-Type: application/json" -d @db2-source-conn-incr.json http://localhost:8083/connectors I get this message:
0
votes
0 answers

Uable to use Apache calcite to connect to Gemfire 9.x using third party DB app

I am using a third party application hosted on tomcat which allows only jdbc connections for querying database. In the new datasource configuration wizard, I have inserted the below details URL:…
KCK
  • 2,015
  • 2
  • 17
  • 35
0
votes
1 answer

How to use Apache calcite LIKE_REGEX

I would like to use LIKE_REGEX in Apache calcite SQL query and can not find any documentation or examples on how to use it. Can you please share examples or documentation around it's usage.
Andy P.
  • 39
  • 9
0
votes
1 answer

Map a query as a virtual table

Is it possible within Apache Calcite to map a JDBC based query as a virtual table? I would like to expose a table to the user, but behind the scenes have it be implemented as a query via jdbc to a datasource. I am aware that I can subclass Table…
ptrepag
  • 41
  • 1