I'm planning to create a storage plugin for a custom datasource that accepts queries in the form of XML messages, but it's metadata can be discovered using the JDBC metadata API. I can work on discovering the metadata differently but that's not my priority for now.
So I copied the JDBC storage plugin, Ignored all JDBC rules, and edited wrote the following JDBC storage rules: I renamed *JdbcDrelConverterRule* to *GelbanaRelConverterRule* and edited it's *constructor* and *convert* methods to be: public GelbanaRelConverterRule(IncortaLayoutConvention out) { > super(Aggregate.class, Convention.NONE, out, > "Incorta_Rel_Converter"); > } > @Override > public RelNode convert(RelNode rel) { > RelTraitSet newTraits = rel.getTraitSet().replace(getOutTrait()); > return new GelbanaRel(rel.getCluster(), newTraits, convert(rel, > newTraits)); > } 17:57:19.931 [269c5c27-2f94-14ff-1f3e-0035b17b5965:foreman] DEBUG o.a.d.e.p.s.h.DefaultSqlHandler - HEP:Window Function rewrites (152ms): LogicalProject(EXPR$0=[$1], PROD_CATEGORY=[$0]): rowcount = 150.0, cumulative cost = {3518.75 rows, 3502.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 21 LogicalAggregate(group=[{0}], EXPR$0=[COUNT($1)]): rowcount = 150.0, cumulative cost = {3368.75 rows, 3202.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 19 LogicalProject(PROD_CATEGORY=[$13], Revenue=[$3]): rowcount = 1500.0, cumulative cost = {3200.0 rows, 3202.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 17 LogicalJoin(condition=[=($0, $13)], joinType=[inner]): rowcount = 1500.0, cumulative cost = {1700.0 rows, 202.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 15 JdbcTableScan(table=[[incorta, SALES, Target]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 7 JdbcTableScan(table=[[incorta, SALES, PRODUCTS]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 8 17:57:20.094 [269c5c27-2f94-14ff-1f3e-0035b17b5965:foreman] DEBUG o.a.d.e.p.s.h.DefaultSqlHandler - HEP_BOTTOM_UP:Directory Prune Planning (150ms): LogicalProject(EXPR$0=[$1], PROD_CATEGORY=[$0]): rowcount = 150.0, cumulative cost = {150.0 rows, 300.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 37 IncortaRel: rowcount = 150.0, cumulative cost = {0.0 rows, 0.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 45 - Gelbana