You can create your own implementation of RelFactories.TableScanFactory to create whatever sub-class of TableScan you desire, and configure RelBuilder to use that factory.
However, I wouldn't recommend it. SQL is not relational algebra. If your query has two scans of the same table, they will be different table uses (with different aliases) in SQL, but Calcite will try very hard to canonize them into the same table scan relational expression. On Mon, Jun 19, 2017 at 6:01 AM, Abbas Gadhia <[email protected]> wrote: > Hi,I'm trying to build a Hive query adapter using Calcite.My source system > can be anything SQL, NoSQL etc. Since the source systems typically have > business names/alias given to their tables in the queries, I would like to > preserve them in the Hive Adapter layer, so that the translated query > contains the same business names. > I was thinking of storing the alias in a custom "HiveTableScan extends > TableScan" class. However, RelBuilder.scan() and the accompanying > RelFactories dont allow me to do so (atleast thats what i think). > I know that Apache Hive doesnt go via the RelBuilder API/RelFactories and > instead chooses to manually create a "new HiveTableScan" object with its > accompanying "RelOptHiveTable" class. > Is this the way i should be going? Or is there a more elegant way. > Sorry if this question might be too basic. > Best RegardsAbbas >
