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
3
votes
0 answers

Calcite JDBC-Spark Integration

I have a requirement to query the multiple data sources in single SQL query. I saw Calcite provides this with a JDBC adapter. While running this, I encountered the following challenges: Execution was happening in memory which causes OOM on big…
Ajay
  • 47
  • 4
3
votes
1 answer

Druid query to get "latest" value from third column

I have a table in Druid, something like Timestamp || UserId || Action And I need to get the latest Action for each UserId. In MySQL I would do something like Select * from users u1 inner join ( select UserId, max(Timestamp) as maxt from users…
Matt
  • 3,303
  • 5
  • 31
  • 53
3
votes
1 answer

Apache Calcite - Can't seem to parse DDL statements

Following is the configuration that I'm using to parse MySQL statements. I am able to parse and process DML statements fine but I can't seem to parse any DDL statements (CREATE TABLE, ALTER TABLE, DROP TABLE, etc.). public static SqlNode…
Dilip Raj Baral
  • 3,060
  • 6
  • 34
  • 62
3
votes
1 answer

How do conversion DateTime in Query Record Processor

I'm new to apache NiFi, I have converted the Date type data into timestamp in Query Record Processor by using following query select ${fn Convert(,) as ColumnName from flowfile} But I am facing issue when tried…
Kumar
  • 177
  • 1
  • 9
3
votes
1 answer

Does Apache Calcite provide a way to add custom clauses or statements?

I am currently working on a project to extend the functionalities of SQL to support more stream computing features based on Apache Flink. After doing extensive search, I found that Calcite is a great tool to help me parse, validate and optimize…
3
votes
2 answers

Apache Calcite | Querying data from MongoDB by using Relational algebra

I am able to get a MongoDB connection and able to get a node (LogicalTableScan(table=[[enlivenDev, collection1]])) But when I execute the node, I am getting null pointer exception. Complete code: private void executeMongoDB(){ final…
3
votes
1 answer

How to use calcite cassandra adapters in application

Are there some examples about calcite cassandra adapters in java code? there are only a sqlline example on the calcite site. thanks very much
leoluan
  • 33
  • 6
3
votes
1 answer

how to avoid calcite doing aggregations in memory

When I run a query like "select count(x),y group by y", calcite does all the calculations in memory. So having enough data it can run out-of-mem. Is there a way to do aggregations using some other storage? There is a spark option but when I enable…
kostas.kougios
  • 945
  • 10
  • 21
3
votes
1 answer

table not found with apache calcite

I am trying to do some basic things with calcite to understand the framework. I have setup a simple example that is supposed to read from 2 json files. My model looks like { version: '1.0', defaultSchema: 'PEOPLE', schemas: [ { …
adeelmahmood
  • 2,371
  • 8
  • 36
  • 59
2
votes
1 answer

How to add alternative HSQLDB jar as a gradle dependency?

Context: I am working on Apache Calcite (repo: github.com/apache/calcite) and am trying to update the HSQLDB version to 2.7.1 to address https://nvd.nist.gov/vuln/detail/CVE-2022-41853 (the issue is being tracked here:…
2
votes
1 answer

Custom state-full rule not working with Volcano Planner after calcite upgrade from 1.21.0 to 1.32.0/1.34.0

public class StateFullRule extends RelOptRule { // *** some state //private boolean isProccessed = false; //private Map ancestorsMap; public StateFullRule() { super(operand(LogicalUnion.class,…
2
votes
0 answers

how to optimizer sql join query over heterogeneous datasource in calcite

I am new to calcite.What i want to do is to provide a simple tool to analyse data from different datasource,such as mysql,rest service , mongo and so on. I think calcite is just what i need. But after some trying, I found some problem using…
2
votes
1 answer

How to modify a RelNode tree?

I am using Apache Calcite to validate and rewrite SQL based on policies that put certain restrictions on these SQL queries. I am trying to modify a RelNode tree in order to rewrite the query to enforce these restrictions. I want to be able to remove…
user15681986
  • 53
  • 1
  • 6
2
votes
1 answer

JDBC exception when trying to use a prepared statement placeholder as an argument to an aggregation function

I'm attempting to use a PreparedStatement placeholder for an argument to a sql aggregation function. The query works fine if I replace the ? placeholder with a numeric value and get rid of the setDouble call. public static String QUERY = """ …
marathon
  • 7,881
  • 17
  • 74
  • 137
2
votes
1 answer

Packaging Apache Calcite CSV example into a JDBC driver

The CSV example at https://calcite.apache.org/docs/tutorial.html shows how to access the CSV data using sqlline. Does anyone know of any tutorial that show how to create a standalone JDBC driver from scratch for CSV example, so that it can be…
weejim
  • 23
  • 1
  • 4
1
2
3
16 17