org.apache.hadoop.hive.ql.stats.jdbc
Class JDBCStatsUtils

java.lang.Object
  extended by org.apache.hadoop.hive.ql.stats.jdbc.JDBCStatsUtils

public class JDBCStatsUtils
extends Object


Constructor Summary
JDBCStatsUtils()
           
 
Method Summary
static String getBasicStat()
          Returns the basic type of the supported statistics.
static String getCreate(String comment)
          Prepares CREATE TABLE query
static String getDeleteAggr(String rowID, String comment)
          Prepares DELETE statement for cleanup.
static String getIdColumnName()
          Returns the name of the column storing the key for statistics.
static String getInsert(String comment)
          Prepares INSERT statement for statistic publishing.
static String getSelectAggr(String statType, String comment)
          Prepares SELECT query for statistics aggregation.
static String getStatColumnName(String statType)
          Returns the column where the statistics for the given type are stored.
static String getStatTableName()
           
static List<String> getSupportedStatistics()
          Returns the set of supported statistics
static String getTimestampColumnName()
           
static String getUpdate(String comment)
          Prepares UPDATE statement issued when updating existing statistics
static boolean isValidStatistic(String statType)
          Check if a particular statistic type is supported
static boolean isValidStatisticSet(Collection<String> stats)
          Check if the set to be published is within the supported statistics.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCStatsUtils

public JDBCStatsUtils()
Method Detail

getSupportedStatistics

public static List<String> getSupportedStatistics()
Returns the set of supported statistics


isValidStatisticSet

public static boolean isValidStatisticSet(Collection<String> stats)
Check if the set to be published is within the supported statistics. It must also contain at least the basic statistics (used for comparison)

Parameters:
stats - - stats to be published
Returns:
true if is a valid statistic set, false otherwise

isValidStatistic

public static boolean isValidStatistic(String statType)
Check if a particular statistic type is supported

Parameters:
statType - - statistic to be published
Returns:
true if statType is supported, false otherwise

getIdColumnName

public static String getIdColumnName()
Returns the name of the column storing the key for statistics.


getTimestampColumnName

public static String getTimestampColumnName()

getStatTableName

public static String getStatTableName()

getStatColumnName

public static String getStatColumnName(String statType)
Returns the column where the statistics for the given type are stored.

Parameters:
statType - - supported statistic.
Returns:
column name for the given statistic.

getBasicStat

public static String getBasicStat()
Returns the basic type of the supported statistics. It is used to determine which statistics are fresher.


getCreate

public static String getCreate(String comment)
Prepares CREATE TABLE query


getUpdate

public static String getUpdate(String comment)
Prepares UPDATE statement issued when updating existing statistics


getInsert

public static String getInsert(String comment)
Prepares INSERT statement for statistic publishing.


getSelectAggr

public static String getSelectAggr(String statType,
                                   String comment)
Prepares SELECT query for statistics aggregation.

Parameters:
statType - - statistic type to be aggregated.
comment -
Returns:
aggregated value for the given statistic

getDeleteAggr

public static String getDeleteAggr(String rowID,
                                   String comment)
Prepares DELETE statement for cleanup.



Copyright © 2014 The Apache Software Foundation. All rights reserved.