Examples of DataQuery


Examples of com.cloudera.recordbreaker.analyzer.DataQuery

      add(new TextField<String>("selectionclause").setType(String.class));
      add(new TextField<String>("projectionclause").setType(String.class));           
      add(new AjaxButton("submitjoinquery") {
          protected void onSubmit(final AjaxRequestTarget target, final Form form) {
            FishEye fe = FishEye.getInstance();
            DataQuery dq = DataQuery.getInstance();
            ValueMap vals = (ValueMap) form.getModelObject();
            FSAnalyzer fsa = fe.getAnalyzer();
            FileSummaryData fsd1 = fsa.getFileSummaryData(finalFid1);
            String path1 = fsd1.path + fsd1.fname;
            DataDescriptor dd1 = fsd1.getDataDescriptor();
View Full Code Here

Examples of com.cloudera.recordbreaker.analyzer.DataQuery

      add(new AjaxButton("submitquery") {
          protected void onSubmit(final AjaxRequestTarget target, final Form form) {
            //loginErrorMsgDisplay.setVisibilityAllowed(false);           
            //target.add(loginErrorMsgDisplay);
            FishEye fe = FishEye.getInstance();
            DataQuery dq = DataQuery.getInstance();
            ValueMap vals = (ValueMap) form.getModelObject();
            FSAnalyzer fsa = fe.getAnalyzer();
            FileSummaryData fsd = fsa.getFileSummaryData(finalFid);
            String path = fsd.path + fsd.fname;
            DataDescriptor dd = fsd.getDataDescriptor();
View Full Code Here

Examples of com.cloudera.recordbreaker.analyzer.DataQuery

        ///
        if (fidStr != null) {
          try {
            fid = Long.parseLong(fidStr);
            FileSummary fs = new FileSummary(fe.getAnalyzer(), fid);
            DataQuery dq = DataQuery.getInstance();
            FSAnalyzer fsa = fe.getAnalyzer();
            FileSummaryData fsd = fsa.getFileSummaryData(fid);
            DataDescriptor dd = fsd.getDataDescriptor();

            if (dq != null) {
              queryResults = dq.query(dd, null, projClauseStr, selClauseStr);
            }
          } catch (Exception ex) {
            ex.printStackTrace();
          }
        }
        ///
        // Multi table query!
        ///
        if (fidStr1 != null) {
          try {
            fid1 = Long.parseLong(fidStr1);
            FileSummary fs1 = new FileSummary(fe.getAnalyzer(), fid1);
            fid2 = Long.parseLong(fidStr2);
            FileSummary fs2 = new FileSummary(fe.getAnalyzer(), fid2);
            DataQuery dq = DataQuery.getInstance();
            FSAnalyzer fsa = fe.getAnalyzer();
            FileSummaryData fsd1 = fsa.getFileSummaryData(fid1);
            DataDescriptor dd1 = fsd1.getDataDescriptor();
            FileSummaryData fsd2 = fsa.getFileSummaryData(fid2);
            DataDescriptor dd2 = fsd2.getDataDescriptor();

            if (dq != null) {
              queryResults = dq.query(dd1, dd2, projClauseStr, selClauseStr);
            }
          } catch (Exception ex) {
            ex.printStackTrace();
          }
        }
View Full Code Here

Examples of com.cosmo.data.DataQuery

      xhtml.append(renderSection(group.getHeader(), ReportSection.DETAILGROUPHEADER, null));

      try
      {
         // Genera los GRUPOS DE DETALLE
         DataQuery query = this.report.getDataQuery(group.getDataQueryId());
         rs = query.execute(this.workspace);
         while (rs.next())
         {
            xhtml.append(renderSection(group.getDetail(), ReportSection.DETAILGROUPROW, rs));
         }
      }
View Full Code Here

Examples of com.cosmo.data.DataQuery

    * @return Un mapa de instancias {@link DataQuery} que contienen los datos de las consultas.
    */
   public static HashMap<String, DataQuery> readDataQueries(Document doc)
   {
      Element pluginElement;
      DataQuery dq;
      HashMap<String, DataQuery> queries = new HashMap<String, DataQuery>();
     
      NodeList pluginList = doc.getElementsByTagName(XmlUtils.XML_TAG_DATAQUERY);
      for (int pidx = 0; pidx < pluginList.getLength(); pidx++)
      {
         Node pluginNode = pluginList.item(pidx);
         if (pluginNode.getNodeType() == Node.ELEMENT_NODE)
         {
            pluginElement = (Element) pluginNode;

            dq = new DataQuery();
            dq.setId(pluginElement.getAttribute(XML_ATT_ID));
            dq.setConnectionId(pluginElement.getAttribute(XML_ATT_CONNECTION));
            dq.setSqlQuery(pluginElement.getFirstChild().getNodeValue());
            queries.put(dq.getId(), dq);
         }
      }
     
      return queries;
   }
View Full Code Here

Examples of com.google.gdata.client.analytics.DataQuery

    //------------------------------------------------------
    // Configure GA API
    //------------------------------------------------------
    AnalyticsService as = new AnalyticsService("gaExportAPI_acctSample_v1.0");
    String baseUrl = "https://www.google.com/analytics/feeds/data";
    DataQuery query;

    //------------------------------------------------------
    // Client Login Authentication
    //------------------------------------------------------
    try {
      as.setUserCredentials(CLIENT_USERNAME, CLIENT_PASS);
    } catch (AuthenticationException e) {
      System.err.println("Error : " + e.getMessage());
      return;
    }

    //------------------------------------------------------
    // GA Data Feed
    //------------------------------------------------------
    // first build the query
    try {
      query = new DataQuery(new URL(baseUrl));
    } catch (MalformedURLException e) {
      System.err.println("Malformed URL: " + baseUrl);
      return;
    }
    query.setIds("ga:" + PROFILE_ID);
    query.setDimensions("ga:source,ga:medium");
    query.setMetrics("ga:visits,ga:bounces");
    query.setSort("-ga:visits");
    query.setFilters("ga:medium==referral");
    query.setMaxResults(100);
    query.setStartDate("2008-10-01");
    query.setEndDate("2008-10-31");
    URL url = query.getUrl();
    System.out.println("URL: " + url.toString());

    // Send our request to the Analytics API and wait for the results to come back
    DataFeed feed;
    try {
View Full Code Here

Examples of com.google.gdata.client.analytics.DataQuery

      endDate = gaDate.format(lastMonth.getTime());
    }
     

    // Make a query.
    DataQuery query = new DataQuery(new URL(BASE_DATA_FEED_URL));
    query.setIds(tableId);
    query.setDimensions("ga:year,ga:month");
    query.setMetrics("ga:visits,ga:transactions,ga:itemQuantity,ga:uniquePageviews,ga:bounces,ga:entrances");
    query.setSort("ga:year,ga:month");
    query.setMaxResults(500);
    query.setStartDate(startDate);
    query.setEndDate(endDate);
    if (segment !=null) {
      query.setSegment(segment);
    }
   
    log.info(query.getUrl().toString());
    String theURL = query.getUrl().toString();
    return query.getUrl();
  }
View Full Code Here

Examples of com.google.gdata.client.analytics.DataQuery

   * @throws MalformedURLException If the URL used to request data is malformed
   */
  public static DataQuery getBasicQuery(String tableId) throws MalformedURLException {
    // Set up the request (we could alternately construct a URL manually with all query parameters
    // set)
    DataQuery query = new DataQuery(new URL(DATA_URL));
    query.setIds(tableId);
    query.setStartDate("2009-01-01");
    query.setEndDate("2009-01-31");
    query.setDimensions("ga:browser");
    query.setMetrics("ga:visits,ga:bounces");

    return query;
  }
View Full Code Here

Examples of com.google.gdata.client.analytics.DataQuery

    // Each entry in the account feed represents an individual profile
    AccountEntry profile = accountFeed.getEntries().get(0);
    String tableId = profile.getTableId().getValue();

    // Print the results of a basic request
    DataQuery basicQuery = getBasicQuery(tableId);
    DataFeed basicData = myService.getFeed(basicQuery, DataFeed.class);
    printData("BASIC RESULTS", basicData);

    // Ask Analytics to return the data sorted in descending order of visits
    DataQuery sortedQuery = getBasicQuery(tableId);
    sortedQuery.setSort("-ga:visits");
    DataFeed sortedData = myService.getFeed(sortedQuery, DataFeed.class);
    printData("SORTED RESULTS", sortedData);

    // Ask Analytics to filter out browsers that contain the word "Explorer"
    DataQuery filteredQuery = getBasicQuery(tableId);
    filteredQuery.setFilters("ga:browser!@Explorer");
    DataFeed filteredData = myService.getFeed(filteredQuery, DataFeed.class);
    printData("FILTERED RESULTS", filteredData);
  }
View Full Code Here

Examples of com.google.gdata.client.analytics.DataQuery

      String tableId,
      ColumnTypeMap columnTypeMap,
      String startDate,
      String endDate) throws IOException, ServiceException {

    DataQuery query = new DataQuery(new URL("https://www.google.com/analytics/feeds/data"));
    query.setIds(tableId);
    query.setDimensions(columnTypeMap.getColumnString(ColumnType.DIMENSION));
    query.setMetrics(columnTypeMap.getColumnString(ColumnType.METRIC));
    query.setStartDate(startDate);
    query.setEndDate(endDate);
    DataFeed feed = analyticsService.getFeed(query, DataFeed.class);
    return feed.getEntries();
  }
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.