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
1
vote
0 answers

Apache Calcite SQL parser not able to parse the SQL query with column or column alias having a number

Example query: SELECT empid as 3_e FROM EMP; Error: Exception: org.apache.calcite.sql.parser.SqlParseException: Encountered "3" at line 1, column 17. Was expecting one of: ... ... …
Amit B
  • 11
  • 2
1
vote
0 answers

How to handle SQL parameters with Apache Calcite Planner (Facade Interface)?

I need some help with processing queries using Apache Calcite, I am currently using Planner to process my queries. My code looks like this: // custom config FrameworkConfig frameworkConfig = Frameworks.newConfigBuilder() …
lilin
  • 11
  • 1
1
vote
1 answer

Apache Calcite - Parse a query with @@ variables

Not sure where else to go so thought I would ask the group. I have Apache Calcite working as a SQL parser for my application - I am trying to parse MySQL. However it is unable to handle certain SQL statements. The issue seems to be with any SQL…
Spanners
  • 366
  • 2
  • 20
1
vote
0 answers

How to return unquoted unicode characters whe parsing SQL using Apache Calcite

I'm using Apache Calcite to parse and validate some arbitrary SQL. It works for most cases but I've tried to use Unicode characters and hit some bumps. eg; String sql = "SELECT '®'"; SqlParser.Config config =…
jwfischer
  • 13
  • 4
1
vote
1 answer

How To Troubleshot This Exception :No match found for function signature IF(, , )

I have a table defined 2 filed:integer id,varchar name I can execute common query like this right: ResultSet resultSet = statement.executeQuery("select \"id\",\"name\" from test.test01 where \"id\" in (1,2)"); Now,I want use "if" condition in…
yanling
  • 13
  • 4
1
vote
0 answers

When I use join query with calcite, how to use small table data as query filter condition of large table?

When I use join query with calcite, how can I optimize the query plan so that it can query the small table first, and then use the result of the small table as the filter condition of the large table?
Yiyun Yin
  • 11
  • 1
1
vote
0 answers

calcite connection can't execute sql in another thread

we open a calcite connection in one thread, and execute sqls in other threads against the connection, and failed with this error: com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError:…
Xiaobo Gu
  • 199
  • 1
  • 10
1
vote
0 answers

How to use parquet files as a source for can in Apache Calcite?

I want to read from a parquet file as from a table using Apache Calcite. There are bunch of adapters listed in the docs, but no explicit one for parquet. From the other hand there is adapter for Spark, which can deal with Parquet perfectly. But for…
kalmar
  • 45
  • 5
1
vote
1 answer

How to set the default schema for calcite ReflectiveSchema?

It seems the defaultSchema property does not work. public void main(String[] args){ public final String sql4 = "select count(e.empid) from emps as e"; Class.forName("org.apache.calcite.jdbc.Driver"); Properties info = new…
Xiaobo Gu
  • 199
  • 1
  • 10
1
vote
1 answer

Does the ReflectiveSchema support collections as tables?

the test code is : public class HrSchema2{ public List emps = new ArrayList(); public HrSchema2() { } } public final String sql = "select count(e.empid) from hr.emps as…
Xiaobo Gu
  • 199
  • 1
  • 10
1
vote
0 answers

calcite add schema Cannot evaluate org.apache.calcite.sql.SqlJoin.toString()

I use cacite JDBC to connect hive and add schema dynamically. I want to get SQL column metadata information directly without executing SQL. SQL can verify and execute to get results, but I can't get sqljoin node …
1
vote
2 answers

Calcite SQL does not recognize CONVERT_TIMEZONE in Apache Beam

I'm running a simple Sql transform in my Beam pipeline: SELECT CONVERT_TIMEZONE('America/New York', 'UTC',(TIMESTAMP '1970-01-01 00:00:00' + OriginalTZ * INTERVAL '1' SECOND)) as MyUTC FROM PCOLLECTION But i get the error: No match found for…
artofdoe
  • 167
  • 2
  • 14
1
vote
0 answers

What's different between in LogicalCorrelate and LogicalJoin?

When I was reading the Calcite Code, I found the 'join' has different types, the LogicalCorrelate and LogicalJoin. What is the difference between these types?
nobigo
  • 11
  • 2
1
vote
0 answers

How to use RelBuilder.pivot() method for a query without an alias passed for Pivot expression values?

https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/tools/RelBuilder.java Here in RelBuilder class documentation for pivot() method provided example is below. for SQL :: SELECT * FROM (SELECT mgr, deptno, job, sal…
Ashutosh
  • 75
  • 1
  • 10
1
vote
0 answers

How to register JdbcToXXXConverter in Calcite?

I have a Calcite convention, named: XxxConvention, and a ConverterRule named: JdbcToXxxConverterRule, which needs a JdbcConventio as parameter.(there are multi JdbcSchema, thus multi JdbcConvention in application context ) i was thinking to register…
weichao
  • 41
  • 3