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 Drill Filter Pushdown Case

I have a requirement to query the federated data resides in different vendors DB's in different servers, let's take an example, SQL: SELECT t1.NAME,t2.AMOUNT FROM server1.mysql.USERS AS t1 INNER JOIN server2.oracle.PURCHASES AS t2 ON t1.ID…
Ajay
  • 47
  • 4
0
votes
1 answer

How to parse multiple sql statements with Calcite

I want to know how to parse multiple statements in one string. sqlparser.parseStmt() can only parse one statement. For example, I have one string: Create Table tbl1(id bigint); Select * from tbl1; How to split the string to two SQL statements. I…
0
votes
1 answer

Apache calcite: cast integer to datetime

I am using Beam SQL and trying to cast integer to datetime field. Schema resultSchema = Schema.builder() .addInt64Field("detectedCount") .addStringField("sensor") .addInt64Field("timestamp") .build(); …
Akshata
  • 1,005
  • 2
  • 12
  • 22
0
votes
1 answer

preparedStatement.getString() method not working for nested sql query

I am trying to query my HBase using the below method, the SQL query has a nested query, the issue is when using setString() method to add inline parameters, it is not replacing the ? in the query. I am getting an exception as Parameter value…
0
votes
1 answer

Executing query from Apache Calcite to secured ElasticSearch Server (https)

How to express the scheme(https) in the model.json file, this is for connection to Elasticsearch? The following is the model.js file: { "version": "1.0", "defaultSchema": "elasticsearch", "schemas": [ { "type": "custom", …
0
votes
1 answer

How do I enable logging/tracing in Apache Calcite using Sqlline?

Following https://calcite.apache.org/docs/tutorial.html, I ran Apache Calcite using SqlLine. I tried activating tracing as instructed in https://calcite.apache.org/docs/howto.html#tracing. However, I don't get any logging. Here is the content of my…
Holger
  • 1,648
  • 1
  • 16
  • 26
0
votes
0 answers

APACHE CALCITE | perform search operation on elasticSearch using RelNode

I want to perform a search operation on Elasticsearch using RelNode objects and not the traditional SQL query method. I tried building RelNode objects by providing projections and filters but it didn't work saying no input fields found. …
Shlok
  • 1
  • 1
0
votes
1 answer

Extending Calcite parser to Adding Custom relational operators

I want to support FOO_GREATER_THAN clause instead of > in my sql parser. For ex: select * from people where age FOO_GREATER_THAN 10 I followed https://calcite.apache.org/docs/adapter.html#extending-the-parser and I have added custom fmpp and ftl…
Nischal Kumar
  • 492
  • 7
  • 15
0
votes
1 answer

What's the difference between Calcite's ConverterRule and RelOptRule?

I'm learning about Calcite, but got confused by the ConverterRule and RelOptRule. I've already got that RelOptRule is the rule to transform an expression to another, and RelOptRule is used by RelOptPlanner. But I've seen that in ConverterRule's java…
lulijun
  • 415
  • 3
  • 22
0
votes
1 answer

How to chain planners from JDBC Adapter SchemaFactory?

I extended JDBC adapter and used a model.json configuration custom schema factory with 1 original schema and 2 derived schemas to add rules and that worked, rules got executed on original schema during planning, but their end-result didn't get…
igrgurina
  • 50
  • 7
0
votes
1 answer

how to evaluate sql query using RelNode object

I am trying to convert sql query to Tinkerpop Gremlin. sql2Gremlin library does it but it looks on join as relation while I am relying on no join approach where you can refer relations with dot as delimiter between two entity. I have parsed and…
Nischal Kumar
  • 492
  • 7
  • 15
0
votes
1 answer

Calcite is unable to map cassandra column of type map having frozen set

I want to query Cassandra table using calcite. I am able to query other tables but I want to query table: cyclist_teams1(id uuid PRIMARY KEY, firstname text, lastname text, teams map>>) When I query: select * from…
kiran
  • 1
  • 1
0
votes
2 answers

Converting SQL Query with Aggregate Function to Relational Algebra Expression in Apache Calcite - No match found for function signature

I'm trying to convert a SQL query to a relational algebra expression using the Apache Calcite SqlToRelConverter. It works fine for this query (quotes are for ensuring lowercase): queryToRelationalAlgebraRoot("SELECT \"country\" FROM…
tuzhucheng
  • 158
  • 3
  • 9
0
votes
1 answer

Apache NiFi QueryRecord SELECT Static Alias Column

I want to import a file that has the following Avro schema assigned using Apache NiFi: { "type" : "record", "namespace" : "SomeSpaceName", "name" : "SampleFile", "fields" : [ { "name" : "PersonName" , "type" : "string" }, {…
Adam
  • 4,590
  • 10
  • 51
  • 84
0
votes
1 answer

Rename all tables in SELECT query

Can anyone tell me how to replace the name of all the table names in a the SELECT/FROM statements?. I'm looking of a way that works well across vanilla queries as well as more complex ones with sub-queries and joins. I.e. New table name: …
Jorge Del Conde
  • 265
  • 1
  • 4