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

Adding a User-Defined Function to Calcite

I need to add a user-defined function to Calcite that takes an integer as a parameter and returns an integer. public class SquareFunction { public int eval(int a) { return a*a; } } and the relevant code that…
9
votes
2 answers

How to push down project, filter, aggregation to TableScan in Calcite

I am using Apache Calcite to implement a distributed OLAP system, which datasource is RDBMS. So I want to push down the project/filter/aggregation in RelNode tree to MyTableScan extends TableScan. In MyTableScan, a RelBuilder to get the pushed…
inferno
  • 684
  • 6
  • 21
6
votes
1 answer

Calcite: table not found when using Postgres

I am trying to query a Postgres DB using Apache Calcite. I can peruse metadata about the database via the Calcite JDBC driver so I am definitely able to connect to it but whenever I query a table, Calcite always responds with 'table x not found'. If…
danpayne17
  • 101
  • 1
  • 7
6
votes
2 answers

apache calcite, querying without using the jdbc api

I would like to use the apache calcite api raw without using jdbc connections. I can use the jdbc api just fine but I am getting null ptr exceptions when trying to use the api. What I did so far is: package calcite.examples import…
kostas.kougios
  • 945
  • 10
  • 21
5
votes
3 answers

Hive 0.14 UDF Maven Project Missing Dependencies

I was trying to set up a Maven project that will contain user defined functions (UDFs) that I'd like to use in my Hive queries. I started with a Maven project containing no source files, and the following POM:
Steven Magana-Zook
  • 2,751
  • 27
  • 41
4
votes
0 answers

Apache Calcite SqlParser is failing with certain Postgres Keywords

I am using Calcite's SqlParser, but I am running into a few issues with Postgres queries, namely that PRIMARY, TIME, and ZONE are not being properly parsed. The following code is what I am working with: import…
Eric Meadows
  • 887
  • 1
  • 11
  • 19
4
votes
2 answers

Is there any way to view the physical SQLs executed by Calcite JDBC?

Recently I am studying Apache Calcite, by now I can use explain plan for via JDBC to view the logical plan, and I am wondering how can I view the physical sql in the plan execution? Since there may be bugs in the physical sql generation so I need to…
jerryleooo
  • 843
  • 10
  • 16
4
votes
0 answers

Does Apache calcite support connection pool?

I'm a beginner in Apache Calcite and I need to create multiple SQL statements in minimum time so I need to make connection pool to calcite connection to execute my statements. so I need to know if Apache calcite supports connection pool, or if I…
4
votes
1 answer

How to change Calcite's default sql grammar?"

How to change Calcite's default sql grammar, to support such sql statement "select func(id) as (a, b, c) from xx;"
zsh_comeon
  • 77
  • 6
4
votes
1 answer

Apache Calcite - Access RESTFul Service with SQL

I have went through documentation and its a bit hard for me to grasp how one should go about writing adapter for anything. I want to ease the access of RESTful web services with SQL like interface for business folks. Coarse requirements look…
D3V
  • 1,543
  • 11
  • 21
4
votes
3 answers

apache calcite distinguish column names from table name

I'm implementing a simple app that changes column names (and leaves table names alone) in SQL statements. The statement is passed as a String, and modified one is also returned as a String, there's no database connection involved. To achieve this,…
Piotr Śmietana
  • 393
  • 2
  • 19
4
votes
1 answer

Embed Apache Calcite as a library in my application

Apache Calcite seems to have an interesting functionality of parsing SQL and connecting to multiple data sources including non-relational using adapters. I see enough documentation on development of calcite itself but not for using it as a library…
3
votes
1 answer

Is INTERVAL '1' DAY always equal to INTERVAL '24' HOURS?

Intuitively these two intervals represent the same amount of time. But the difference shows around daylight-saving time changes, in which case "1 day" can mean either "23 hours" in the spring or "25 hours" in the autumn. I tested with PostgreSQL and…
Oliv
  • 10,221
  • 3
  • 55
  • 76
3
votes
0 answers

Transaction Support With Calcite

I am trying to find if there are any guidelines published for what needs to be extended in order to support say something as basic as transactions with Calcite? Unable to find anything meaningful in the documentation so far. This is the only…
3
votes
1 answer

How to add keywords like “lateral view explode” in Babel parser

I want to parse a SQL statements (ANSI SQL or HiveQL) into equivalent AST. When I try to parse statements with “lateral view explode” keywords in it, which is a valid HiveQL syntax, Babel fails with ParseException. Adding these as keywords to the…
devj
  • 1,123
  • 2
  • 11
  • 24
1
2 3
16 17