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.");