Hi Julian,

   Thanks for your reply.

   Could you elaborate a bit when you say, "When that Table object is used
(e.g. when it is
   wrapped in a RelOptTableImpl), Calcite will supply the path." ?

   I am currently looking at the CSVTable schema[1] implementation & see
how that could be
   enhanced to dynamically accept csv files. Will this logic reside in the
SchemaFactory & how
   should RelOptTableImpl be used.

   If this is useful to larger audience, I am happy to provide
documentation.

~Ravi

[1] Calcite Schema:
    Schema:
https://github.com/apache/calcite/blob/master/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchema.java
    SchemaFactory:
https://github.com/apache/calcite/blob/master/example/csv/src/main/java/org/apache/calcite/adapter/csv/CsvSchemaFactory.java

On Sat, Aug 13, 2016 at 12:21 AM, Ravikumar CS <[email protected]>
wrote:

> Thanks Julian. Is there an example that I can look at ?
>
> ~Ravi
>
> On Fri, Aug 12, 2016 at 11:47 PM, Julian Hyde <[email protected]> wrote:
>
>> Yes, this is possible. Your implementation of Schema.getTable(String
>> name) should always return the same Table object. When that Table object is
>> used (e.g. when it is wrapped in a RelOptTableImpl), Calcite will supply
>> the path.
>>
>> Julian
>>
>> > On Aug 13, 2016, at 1:00 AM, Ravikumar CS <[email protected]>
>> wrote:
>> >
>> > Hi,
>> >
>> > Is it possible to query dynamic tables within a table schema in Calcite
>> ?
>> > That is the table name is coming as part of the SQL(and is changing)
>> > however they all map to the same calcite table implementation(say
>> > JSONTable) ?
>> >
>> > Any pointers on how this could be achieved.
>> >
>> > *Example:*
>> >
>> > *1.* select * from foo_schema."/data/foo.json"
>> >
>> > *2. *select * from foo_schema."/data/bar.json"
>> >
>> > *3.* select * from foo_schema."/data/baz.json"
>>
>>
>

Reply via email to