xplain.Query_config [Beta]

class xplain.Query_config(name=None)

Bases: object

factory class to generate the xplain query configuration for execute_query method of Xsession

add_aggregation(object_name, dimension_name, type, aggregation_name=None)

add an aggregation specification to the query

Parameters
  • object_name – the name of xobject

  • dimension_name – the name of dimension

  • type – the aggregation type values are SUM, AVG, COUNT,

COUNTDISTINCT, MAX, MIN :param aggregation_name: the name of aggregation

add_groupby(attribute_name, object_name=None, dimension_name=None, groupby_level=None, groupby_level_number=None, groupby_states=None)

add a group by specification to the query configuration

Parameters
  • attribute_name – the attribute name

  • object_name – the name of object

  • dimension_name – the name of dimension

  • groupby_level – the group by level name

  • groupby_level_number – the group by leve number, if group by_level name is not specified,

you can define the level by the number of this level :param groupby_states: if the group by stats are maintained, the group by will be only applied to the specified group by states

add_selection(attribute_name, object_name=None, dimension_name=None, selected_states=None)

add a group by specification to the query configuration

Parameters
  • attribute_name – the name of attribute

  • object_name – the name of xobject

  • dimension_name – the name of dimension

  • selected_states – the set of selected states

set_name(request_name)

assign a specific name or id to te query

Parameters

request_name – the name/id to be assigned

to_json()

return the configuration of this query as json

Returns

json