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
2
votes
2 answers

How to extract the field from JSON object with QueryRecord

I have been struggling with this problem for a long time. I need to create a new JSON flowfile using QueryRecord by taking an array (field ref) from input JSON field refs and skip the object field as shown in example below: Input JSON flowfile { …
emilkhay
  • 23
  • 4
2
votes
1 answer

Is there any way to remove specific rule when building the RelNode using RelBuilder?

I am building a RelNode using RelBuilder. FrameworkConfig frameworkConfig = config().build(); final RelBuilder builder = RelBuilder.create(frameworkConfig); RelNode root = builder.scan("ITEM", "TEST") .filter( …
2
votes
1 answer

Calcite SQL parser -- SELECT statement root node type not always SqlSelect

I have a simple application that does text substitution on literals in the WHERE clause of a SELECT statement. I run SqlParser.parseQuery() and apply .getWhere() to the result. However, for the following query the root node is not an SqlSelect, but…
Guy Middleton
  • 314
  • 1
  • 9
2
votes
0 answers

Cannot find org.codehaus.commons.compiler.properties resource

I created a Maven project that includes a dependency to the Calcite JDBC driver, as well as source code for a Calcite CSV adapter. org.apache.calcite calcite-core
RedTailedHawk
  • 189
  • 13
2
votes
1 answer

Creating tables with dynamic columns in apache calcite

There are two tables in graph database. User { id, name} Group { id, name} User is connected to Group via an edge. No i want to query this via apache calcite with where clause as select * from User where User.Group.id="Foo" Since apache calcite…
Nischal Kumar
  • 492
  • 7
  • 15
2
votes
0 answers

How to add a UDF with variable number parameter in calcite?

I'm using Apache Calcite to validate SQL. I add tables and UDFs dynamically. The problem is when I add a UDF with variable number parameter, the validator can not find this function. Version of Calcite is 1.18.0 And this is my…
Grady Yang
  • 21
  • 2
2
votes
1 answer

Using ROW() for nested data structure

I've been successfully using JsonRowSerializationSchema from the flink-json artifact to create a TableSink and output json from SQL using ROW. It works great for emitting flat data: INSERT INTO outputTable SELECT ROW(col1, col1) FROM…
BenoitParis
  • 3,166
  • 4
  • 29
  • 56
2
votes
1 answer

Why does Flink SQL use a cardinality estimate of 100 rows for all tables?

I wasn't sure why the logical plan wasn't correctly evaluated in this example. I looked more deeply in the Flink base code and I checked that when calcite evaluate/estimate the number of rows for the query in object. For some reason it returns…
2
votes
1 answer

SQL query in apache calcite and teradata

Need advise on apache calcite. We have some SQL queries running on Teradata. Now we want to run these sql queries (as it is) on Hadoop/Spark perhaps using Apache calcite. We tried these SQL queries (as it is) in Spark SQL (2.6.3) and also in Apache…
sunillp
  • 983
  • 3
  • 13
  • 31
2
votes
1 answer

Expose Calcite based db through Avatica by custom servlet

I have built my custom schema with calcite help. Now I would like to expose it through servlet and connect to it with Avatica. I am using servlet because my container is JIRA. Here is some relevant code from servlet public class JDBCServlet extends…
2
votes
2 answers

Apache Calcite to Find Selected Columns in an SQL String

I have a use case where I want to know the columns which have been selected in an SQL string.For instance, if the SQL is like this: SELECT name, age*5 as intelligence FROM bla WHERE bla=bla Then, after parsing the above String, I just want the…
Saurabh
  • 139
  • 2
  • 9
2
votes
1 answer

Apache Calcite: Convert a SQL parse tree into a tree of relational expressions WITHOUT validation

I'm currently working on a project in which I want to parse an SQL-Query and create the tree of relational expressions for it. The main goal is to identify the join partners in the Queries. So I'd like to push the join-expressions down to the leafs…
hjk
  • 21
  • 3
2
votes
1 answer

Calcite function with default argument value

I am using Apache Calcite to add some built-in functions. Now, I want to implement the GROUP_CONCAT function like MySQL to concat one column with one separator. SELECT GROUP_CONCAT(n_name, '|') FROM nation GROUP BY n_lang; The function class as…
inferno
  • 684
  • 6
  • 21
2
votes
0 answers

MongoDB analysis with Saiku Community Edition

I am unable to connect Saiku with MongoDB using optiq even.I already copied Jars into saiku lib and web-inf lib. As saiku add data Source console doesn't have any Catalog field and also the url part too.
1
vote
0 answers

Getting Assertion [X has wrong best cost {9.59 rows, 9.59 cpu, 0.0 io}. Correct cost is {10.6 rows, 10.6 cpu, 0.0 io}, after upgrade from 1.21 to 1.32

I have case where there is a node(A) with infinite cost which is suppose to be substituted with a relevant finite node(B) at the end of optimization. There's another node (C). The tree looks like: Project2 C(Kind of Filter) A (Infinite…
1 2
3
16 17