Examples of ExploreException


Examples of co.cask.cdap.explore.service.ExploreException

        throw e;
      }
    } catch (HiveSQLException e) {
      throw getSqlException(e);
    } catch (Throwable e) {
      throw new ExploreException(e);
    }
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

        throw e;
      }
    } catch (HiveSQLException e) {
      throw getSqlException(e);
    } catch (Throwable e) {
      throw new ExploreException(e);
    }
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

          } finally {
            Closeables.closeQuietly(reader);
          }
        } catch (FileNotFoundException e) {
          LOG.error("Could not retrieve preview result file {}", previewFile, e);
          throw new ExploreException(e);
        }
      }

      try {
        // Create preview results for query
        previewFile = new File(previewsDir, handle.getHandle());
        FileWriter fileWriter = new FileWriter(previewFile);
        try {
          List<QueryResult> results = nextResults(handle, PREVIEW_COUNT);
          GSON.toJson(results, fileWriter);
          operationInfo.setPreviewFile(previewFile);
          return results;
        } finally {
          Closeables.closeQuietly(fileWriter);
        }
      } catch (IOException e) {
        LOG.error("Could not write preview results into file", e);
        throw new ExploreException(e);
      }
    } finally {
      previewLock.unlock();
    }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  // null then we surface the SQL exception.
  private RuntimeException getSqlException(HiveSQLException e) throws ExploreException, SQLException {
    if (e.getSQLState() != null) {
      throw e;
    }
    throw new ExploreException(e);
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

    } else if (tColumnValue.isSetI64Val()) {
      return tColumnValue.getI64Val().getValue();
    } else if (tColumnValue.isSetStringVal()) {
      return tColumnValue.getStringVal().getValue();
    }
    throw new ExploreException("Unknown column value encountered: " + tColumnValue);
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

    public List<ColumnDesc> getResultSchema() throws ExploreException {
      try {
        return exploreClient.getResultSchema(handle);
      } catch (HandleNotFoundException e) {
        LOG.error("Caught exception when retrieving results schema", e);
        throw new ExploreException(e);
      }
    }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  protected QueryHandle doEnableExplore(String datasetInstance) throws ExploreException {
    HttpResponse response = doPost(String.format("data/explore/datasets/%s/enable", datasetInstance), null, null);
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
    }
    throw new ExploreException("Cannot enable explore on dataset " + datasetInstance + ". Reason: " +
                                 getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  protected QueryHandle doDisableExplore(String datasetInstance) throws ExploreException {
    HttpResponse response = doPost(String.format("data/explore/datasets/%s/disable", datasetInstance), null, null);
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
    }
    throw new ExploreException("Cannot disable explore on dataset " + datasetInstance + ". Reason: " +
                                 getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  public QueryHandle execute(String statement) throws ExploreException {
    HttpResponse response = doPost("data/explore/queries", GSON.toJson(ImmutableMap.of("query", statement)), null);
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
    }
    throw new ExploreException("Cannot execute query. Reason: " + getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return parseJson(response, QueryStatus.class);
    } else if (HttpResponseStatus.NOT_FOUND.getCode() == response.getResponseCode()) {
      throw new HandleNotFoundException("Handle " + handle.getHandle() + "not found.");
    }
    throw new ExploreException("Cannot get status. Reason: " + getDetails(response));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.