delta_trace_db.query.sort.single_sort

Classes

SingleSort(field[, reversed_, v_type])

(en) This class allows you to specify single-key sorting for the return values of a query.

class delta_trace_db.query.sort.single_sort.SingleSort(field: str, reversed_: bool = False, v_type: EnumValueType = EnumValueType.auto_)

Bases: AbstractSort

(en) This class allows you to specify single-key sorting for the return values of a query. When sorting with this class, null values are moved to the back in ascending sorting and to the front in descending sorting. Also, boolean values are calculated as 1 for true and 0 for false.

(ja) クエリの戻り値について、単一キーでのソートを指定するためのクラスです。 このクラスのソートでは、null値は昇順ソートでは後ろに、降順ソートでは前に移動します。 また、bool値はtrueなら1、falseなら0として計算されます。

Parameters:
  • field (str) – The name of the variable within the class to use for sorting.

  • reversed (bool) – Specifies whether to reverse the sort result.

  • v_type (EnumValueType) – Specifies the comparison type during calculation. If you select anything other than auto_, the value will be cast to that type before the comparison is performed. If an exception occurs, such as a conversion failure, an Exception is thrown.

class_name = 'SingleSort'
classmethod from_dict(src: Dict[str, Any]) SingleSort

(en) The appropriate object is automatically detected and restored from the dictionary.

(ja) 辞書から適切なオブジェクトを自動判定して復元します。

Parameters:

src (Dict[str, Any]) – A dictionary made with toDict of this class.

get_comparator() Callable[[Dict[str, Any], Dict[str, Any]], int]

(en) Return a comparator function for sorting.

(ja) ソート用のcomparatorオブジェクトを作成して返します。

to_dict() Dict[str, Any]

(en) Convert the object to a dictionary. The returned dictionary can only contain primitive types, null, lists or dicts with only primitive elements. If you want to include other classes, the target class should inherit from this class and chain calls toDict.

(ja) このオブジェクトを辞書に変換します。 戻り値の辞書にはプリミティブ型かプリミティブ型要素のみのリスト またはマップ等、そしてnullのみを含められます。 それ以外のクラスを含めたい場合、対象のクラスもこのクラスを継承し、 toDictを連鎖的に呼び出すようにしてください。

version = '5'