Package org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory

Examples of org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory.WorkspaceSchema


    private final Map<String, WorkspaceSchema> schemaMap = Maps.newHashMap();

    public FileSystemSchema(String name, UserSession session) {
      super(ImmutableList.<String>of(), name);
      for(WorkspaceSchemaFactory f :  factories){
        WorkspaceSchema s = f.createSchema(getSchemaPath(), session);
        schemaMap.put(s.getName(), s);
      }

      defaultSchema = schemaMap.get(defaultSchemaName);
    }
View Full Code Here


            fromDir = fromDir + from.names.get((from.names.size() - 1));
        }
      }

      AbstractSchema tempSchema = getDrillSchema(drillSchema);
      WorkspaceSchema schema = null;
      if (tempSchema instanceof WorkspaceSchema) {
        schema = ((WorkspaceSchema)tempSchema);
      } else {
        throw new ValidationException("Unsupported schema");
      }

      // Get the file system object
      fs = schema.getFS();

      // Get the default path
      defaultLocation = schema.getDefaultLocation();
    } catch (Exception e) {
        if (from == null) {
          return DirectPlan.createDirectPlan(context, false, "Show files without FROM / IN clause can be used only after specifying a default file system schema");
        }
        return DirectPlan.createDirectPlan(context, false, String.format("Current schema '%s' is not a file system schema. " +
View Full Code Here

        View view = new View(createView.getName(), viewSql, queryRowType, workspaceSchemaPath);

        boolean replaced;
        if (drillSchema instanceof WorkspaceSchema) {
          WorkspaceSchema workspaceSchema = (WorkspaceSchema) drillSchema;
          if (!createView.getReplace() && workspaceSchema.viewExists(view.getName())) {
            return DirectPlan.createDirectPlan(context, false, "View with given name already exists in current schema");
          }
          replaced = ((WorkspaceSchema) drillSchema).createView(view);
        }else{
          return DirectPlan.createDirectPlan(context, false, "Schema provided was not a workspace schema.");
View Full Code Here

    private final Map<String, WorkspaceSchema> schemaMap = Maps.newHashMap();

    public FileSystemSchema(String name, UserSession session) {
      super(ImmutableList.<String>of(), name);
      for(WorkspaceSchemaFactory f :  factories){
        WorkspaceSchema s = f.createSchema(getSchemaPath(), session);
        schemaMap.put(s.getName(), s);
      }

      defaultSchema = schemaMap.get(defaultSchemaName);
    }
View Full Code Here

        View view = new View(createView.getName(), viewSql, queryRowType, workspaceSchemaPath);

        boolean replaced;
        if (drillSchema instanceof WorkspaceSchema) {
          WorkspaceSchema workspaceSchema = (WorkspaceSchema) drillSchema;
          if (!createView.getReplace() && workspaceSchema.viewExists(view.getName())) {
            return DirectPlan.createDirectPlan(context, false, "View with given name already exists in current schema");
          }
          replaced = ((WorkspaceSchema) drillSchema).createView(view);
        } else {
          return DirectPlan.createDirectPlan(context, false, "Schema provided was not a workspace schema.");
View Full Code Here

            fromDir = fromDir + from.names.get((from.names.size() - 1));
        }
      }

      AbstractSchema tempSchema = getDrillSchema(drillSchema);
      WorkspaceSchema schema = null;
      if (tempSchema instanceof WorkspaceSchema) {
        schema = ((WorkspaceSchema)tempSchema);
      } else {
        throw new ValidationException("Unsupported schema");
      }

      // Get the file system object
      fs = schema.getFS();

      // Get the default path
      defaultLocation = schema.getDefaultLocation();
    } catch (Exception e) {
        if (from == null) {
          return DirectPlan.createDirectPlan(context, false, "Show files without FROM / IN clause can be used only after specifying a default file system schema");
        }
        return DirectPlan.createDirectPlan(context, false, String.format("Current schema '%s' is not a file system schema. " +
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory.WorkspaceSchema

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.