We have built our own way configuration scheme for specifying interaction on data. We plan to use calcite to convert the specification into Relation Algebra and then create SQL Queries (for now) to be executed in Hive.
The specification we use looks similar to :
{
"objects": [ "a", "b", "c"],
"fields" : ["a.f1", "a.f2", "b.f1", "b.f2"]
.
.
.
}
This translates to a query:
select f1, f2
from (
select f1, f2 from a
union
select f1, f2 from b
) s;
As of now, I have created a Schema Factory which has the schemas of (a and b) and have created tables also. On the other hand, I read through the example of RelBuilder which lets me create Rel expression trees which later can be used to convert to SQL using Rel2Sql.
The link that I am missing here is :
How do I refer to the tables in Relbuilder while building the Rel expression tree? I checked, it seems to the scan method takes in strings only
How do I create SQL table creation queries from Tables?
Any help will be appreciated.