Package org.apache.drill.exec.exception

Examples of org.apache.drill.exec.exception.OptimizerException


   

    @Override
    public PhysicalOperator visitSegment(Segment segment, Object value) throws OptimizerException {
      throw new OptimizerException("Segment operators aren't currently supported besides next to a collapsing aggregate operator.");
    }
View Full Code Here


    @Override
    public PhysicalOperator visitCollapsingAggregate(CollapsingAggregate agg, Object value)
        throws OptimizerException {

      if( !(agg.getInput() instanceof Segment) ){
        throw new OptimizerException(String.format("Currently, Drill only supports CollapsingAggregate immediately preceded by a Segment.  The input of this operator is %s.", agg.getInput()));
      }
      Segment segment = (Segment) agg.getInput();

      if(!agg.getWithin().equals(segment.getName())){
        throw new OptimizerException(String.format("Currently, Drill only supports CollapsingAggregate immediately preceded by a Segment where the CollapsingAggregate works on the defined segments.  In this case, the segment has been defined based on the name %s but the collapsing aggregate is working within the field %s.", segment.getName(), agg.getWithin()));
      }
     
      // a collapsing aggregate is a currently implemented as a sort followed by a streaming aggregate.
      List<OrderDef> orderDefs = Lists.newArrayList();
     
      List<NamedExpression> keys = Lists.newArrayList();
      for(LogicalExpression e : segment.getExprs()){
        if( !(e instanceof SchemaPath)) throw new OptimizerException("The basic optimizer doesn't currently support collapsing aggregate where the segment value is something other than a SchemaPath.");
        keys.add(new NamedExpression(e, new FieldReference((SchemaPath) e)));
        orderDefs.add(new OrderDef(Direction.ASC, e));
      }
      Sort sort = new Sort(segment.getInput().accept(this, value), orderDefs, false);
     
View Full Code Here


    @Override
    public PhysicalOperator visitScan(Scan scan, Object obj) throws OptimizerException {
      StorageEngineConfig config = logicalPlan.getStorageEngineConfig(scan.getStorageEngine());
      if(config == null) throw new OptimizerException(String.format("Logical plan referenced the storage engine config %s but the logical plan didn't have that available as a config.", scan.getStorageEngine()));
      StorageEngine engine;
      try {
        engine = context.getStorageEngine(config);
        return engine.getPhysicalScan(scan);
      } catch (IOException | ExecutionSetupException e) {
        throw new OptimizerException("Failure while attempting to retrieve storage engine.", e);
      }
    }
View Full Code Here

    }

    @Override
    public PhysicalOperator visitStore(Store store, Object obj) throws OptimizerException {
      if (!store.iterator().hasNext()) {
        throw new OptimizerException("Store node in logical plan does not have a child.");
      }
      return new Screen(store.iterator().next().accept(this, obj), context.getCurrentEndpoint());
    }
View Full Code Here


    @Override
    public PhysicalOperator visitScan(Scan scan, Object obj) throws OptimizerException {
      StoragePluginConfig config = logicalPlan.getStorageEngineConfig(scan.getStorageEngine());
      if(config == null) throw new OptimizerException(String.format("Logical plan referenced the storage engine config %s but the logical plan didn't have that available as a config.", scan.getStorageEngine()));
      StoragePlugin storagePlugin;
      try {
        storagePlugin = context.getStorage().getPlugin(config);
        return storagePlugin.getPhysicalScan(scan.getSelection());
      } catch (IOException | ExecutionSetupException e) {
        throw new OptimizerException("Failure while attempting to retrieve storage engine.", e);
      }
    }
View Full Code Here

    }

    @Override
    public PhysicalOperator visitStore(Store store, Object obj) throws OptimizerException {
      if (!store.iterator().hasNext()) {
        throw new OptimizerException("Store node in logical plan does not have a child.");
      }
      return new Screen(store.iterator().next().accept(this, obj), context.getCurrentEndpoint());
    }
View Full Code Here

    @Override
    public PhysicalOperator visitScan(Scan scan, Object obj) throws OptimizerException {
      StoragePluginConfig config = logicalPlan.getStorageEngineConfig(scan.getStorageEngine());
      if(config == null) {
        throw new OptimizerException(String.format("Logical plan referenced the storage engine config %s but the logical plan didn't have that available as a config.", scan.getStorageEngine()));
      }
      StoragePlugin storagePlugin;
      try {
        storagePlugin = context.getStorage().getPlugin(config);
        return storagePlugin.getPhysicalScan(scan.getSelection());
      } catch (IOException | ExecutionSetupException e) {
        throw new OptimizerException("Failure while attempting to retrieve storage engine.", e);
      }
    }
View Full Code Here

    }

    @Override
    public PhysicalOperator visitStore(Store store, Object obj) throws OptimizerException {
      if (!store.iterator().hasNext()) {
        throw new OptimizerException("Store node in logical plan does not have a child.");
      }
      return new Screen(store.iterator().next().accept(this, obj), context.getCurrentEndpoint());
    }
View Full Code Here


    @Override
    public PhysicalOperator visitScan(Scan scan, Object obj) throws OptimizerException {
      StoragePluginConfig config = logicalPlan.getStorageEngineConfig(scan.getStorageEngine());
      if(config == null) throw new OptimizerException(String.format("Logical plan referenced the storage engine config %s but the logical plan didn't have that available as a config.", scan.getStorageEngine()));
      StoragePlugin storagePlugin;
      try {
        storagePlugin = context.getStorage().getPlugin(config);
        return storagePlugin.getPhysicalScan(scan.getSelection());
      } catch (IOException | ExecutionSetupException e) {
        throw new OptimizerException("Failure while attempting to retrieve storage engine.", e);
      }
    }
View Full Code Here

    }

    @Override
    public PhysicalOperator visitStore(Store store, Object obj) throws OptimizerException {
      if (!store.iterator().hasNext()) {
        throw new OptimizerException("Store node in logical plan does not have a child.");
      }
      return new Screen(store.iterator().next().accept(this, obj), context.getCurrentEndpoint());
    }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.exception.OptimizerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.