Github user kumarvishal09 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/91#discussion_r76751950
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/QueryStatisticsRecorder.java
 ---
    @@ -61,14 +67,275 @@ public QueryStatisticsRecorder(String queryId) {
        */
       public synchronized void recordStatistics(QueryStatistic statistic) {
         queryStatistics.add(statistic);
    +    // refresh query Statistics Map
    +    String key = statistic.getQueryId();
    +    if (!StringUtils.isEmpty(key)) {
    +      // 240954528274124_0 and 240954528274124 is the same query id
    +      key = key.substring(0, 15);
    +    }
    +    if (queryStatisticsMap.get(key) != null) {
    +      queryStatisticsMap.get(key).add(statistic);
    +    } else {
    +      List<QueryStatistic> newQueryStatistics = new 
ArrayList<QueryStatistic>();
    +      newQueryStatistics.add(statistic);
    +      queryStatisticsMap.put(key, newQueryStatistics);
    +    }
       }
     
       /**
        * Below method will be used to log the statistic
        */
       public void logStatistics() {
         for (QueryStatistic statistic : queryStatistics) {
    -      LOGGER.statistic(statistic.getStatistics(queryIWthTask));
    +      LOGGER.statistic(statistic.getStatistics());
    +    }
    +  }
    +
    +  /**
    +   * Below method will be used to show statistic log as table
    +   */
    +  public void logStatisticsTable() {
    +    String tableInfo = putStatisticsIntoTable();
    +    if (null != tableInfo) {
    +      LOGGER.statistic(tableInfo);
    +    }
    +  }
    +
    +  /**
    +   * Below method will parse queryStatisticsMap and put time into table
    +   */
    +  public String putStatisticsIntoTable() {
    +    for (String key: queryStatisticsMap.keySet()) {
    +      try {
    +        // TODO: get the finished query, and print Statistics
    +        if (queryStatisticsMap.get(key).size() > 8) {
    +          String jdbc_connection_time = "";
    +          String sql_parse_time = "";
    +          String load_meta_time = "";
    +          String block_identification_time = "";
    +          String schedule_time = "";
    +          String driver_part_time = "";
    +          String executor_part_time = "";
    +          String load_index_time = "";
    --- End diff --
    
    change load_index_time to block loading time 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to