2

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 accepts Schema with predefined Table with predefined columns, above query fails in validation step. One way to achieve this way is to Define user with Four columns as {id, name, Group.id, Group.name}. Now the problem is in my case, A table can be connected to more than one other tables and the depth can go up to 6 depth. Creating a table with all the columns of their child classes with lead to a table with lot of dynamic columns.

Is there a way to define columns of a table as the way they appear in query.

Nischal Kumar
  • 492
  • 7
  • 15
  • You may want to have a look at [Apache Drill](https://drill.apache.org/) which uses Calcite under the hood. – Michael Mior Apr 23 '19 at 15:22
  • I looked into apache drill. Apache Drill deals with dynamic schema but the table definition is static. In my case no of column in my table is variable. – Nischal Kumar Apr 26 '19 at 15:47

1 Answers1

1

Look at resolved issue https://issues.apache.org/jira/browse/CALCITE-1150.

It introduces DynamicRecordType to Apache Calcite. Here is propossed specification https://docs.google.com/document/d/1vCWlqRyJQCtYbtVAjGOKP-8BD4_hrhoM9-4qbdoJs6k/edit.

I think it's used by Apache Drill project, see https://github.com/apache/drill/search?q=DynamicRecordType.

jzajic
  • 11
  • 2