Hi,

We have a use case in which we want to construct queries programmatically
which Drill would then execute.

So far I've been able to configure a Jdbc StorageEngine, and initialize a
LogicalPlan (using the builder) with that. I am having difficulty trying to
configure scan, project, and filters. I know I need to construct a
LogicalOperator, and these are implemented in
org.apache.drill.common.logical.data

However to construct an operator instance I need one or more of:
JSONOptions, NamedExpression, LogicalExpression, FieldReference.

So right now I have something like this, but don't know how to fill in the
missing pieces...

// scan
JSONOptions opts = new JSONOptions(...);
builder.addLogicalOperator(Scan.builder().storageEngine("pg").selection(opts).build());

// project
NamedExpression nex = new NamedExpression(...);
builder.addLogicalOperator(Project.builder().addExpr(nex));

LogicalPlan plan = builder.build();

Is there any documentation yet, similar to what calcite has for the
RelBuilder (https://calcite.apache.org/docs/algebra.html)?

I suppose I could also construct a RelNode and then try to convert that to
a LogicalPlan, would I be missing out on any drill features this way?

Thanks in advance

Reply via email to