Search in sources :

Example 51 with FunctionImplementationRegistry

use of org.apache.drill.exec.expr.fn.FunctionImplementationRegistry in project drill by apache.

the class TestOptiqPlans method doPhysicalTest.

private SimpleRootExec doPhysicalTest(final DrillbitContext bitContext, UserClientConnection connection, String file) throws Exception {
    mockDrillbitContext(bitContext);
    final StoragePluginRegistry reg = new StoragePluginRegistryImpl(bitContext);
    final PhysicalPlanReader reader = PhysicalPlanReaderTestFactory.defaultPhysicalPlanReader(config, reg);
    final PhysicalPlan plan = reader.readPhysicalPlan(Files.toString(FileUtils.getResourceAsFile(file), Charsets.UTF_8));
    final FunctionImplementationRegistry registry = new FunctionImplementationRegistry(config);
    final FragmentContext context = new FragmentContext(bitContext, PlanFragment.getDefaultInstance(), connection, registry);
    final SimpleRootExec exec = new SimpleRootExec(ImplCreator.getExec(context, (FragmentRoot) plan.getSortedOperators(false).iterator().next()));
    return exec;
}
Also used : StoragePluginRegistry(org.apache.drill.exec.store.StoragePluginRegistry) PhysicalPlan(org.apache.drill.exec.physical.PhysicalPlan) FragmentContext(org.apache.drill.exec.ops.FragmentContext) PhysicalPlanReader(org.apache.drill.exec.planner.PhysicalPlanReader) StoragePluginRegistryImpl(org.apache.drill.exec.store.StoragePluginRegistryImpl) FragmentRoot(org.apache.drill.exec.physical.base.FragmentRoot) FunctionImplementationRegistry(org.apache.drill.exec.expr.fn.FunctionImplementationRegistry)

Aggregations

FunctionImplementationRegistry (org.apache.drill.exec.expr.fn.FunctionImplementationRegistry)51 PhysicalPlan (org.apache.drill.exec.physical.PhysicalPlan)43 FragmentContext (org.apache.drill.exec.ops.FragmentContext)42 FragmentRoot (org.apache.drill.exec.physical.base.FragmentRoot)39 PhysicalPlanReader (org.apache.drill.exec.planner.PhysicalPlanReader)38 Test (org.junit.Test)36 SimpleRootExec (org.apache.drill.exec.physical.impl.SimpleRootExec)24 SchemaPath (org.apache.drill.common.expression.SchemaPath)17 ExecTest (org.apache.drill.exec.ExecTest)15 ValueVector (org.apache.drill.exec.vector.ValueVector)8 StoragePluginRegistryImpl (org.apache.drill.exec.store.StoragePluginRegistryImpl)6 BigIntVector (org.apache.drill.exec.vector.BigIntVector)6 IntVector (org.apache.drill.exec.vector.IntVector)6 Ignore (org.junit.Ignore)6 DrillbitContext (org.apache.drill.exec.server.DrillbitContext)5 DrillConfig (org.apache.drill.common.config.DrillConfig)3 BigIntHolder (org.apache.drill.exec.expr.holders.BigIntHolder)3 OpProfileDef (org.apache.drill.exec.ops.OpProfileDef)3 OperatorStats (org.apache.drill.exec.ops.OperatorStats)3 PhysicalOperator (org.apache.drill.exec.physical.base.PhysicalOperator)3