Ejemplo n.º 1
0
class ModelWithArrays(Model):

    date_field = DateField()
    arr_str = ArrayField(StringField())
    arr_int = ArrayField(Int32Field())
    arr_date = ArrayField(DateField())

    engine = MergeTree('date_field', ('date_field', ))
class NamedModel(Model):
    _table_name = 'custom_name'

    date_column = DateField()
    field = StringField()

    engine = MergeTree('date_column', ('field', ))
class Person(Model):

    first_name = StringField()
    last_name = StringField()
    birthday = DateField()
    height = Float32Field()

    engine = MergeTree('birthday', ('first_name', 'last_name', 'birthday'))
Ejemplo n.º 4
0
class SimpleModel(Model):

    date_field = DateField()
    datetime_field = DateTimeField()
    str_field = StringField(default='dozo')
    int_field = Int32Field(default=17)
    float_field = Float32Field()

    engine = MergeTree('date_field', ('int_field', 'date_field'))
Ejemplo n.º 5
0
class Metrics(Model):
    Name = StringField()
    PartitionDate = DateField()
    Time = DateTimeField()
    Value = Float32Field()
    engine = MergeTree('PartitionDate', ('Name', 'PartitionDate'))
class ModelWithEnumArray(Model):

    date_field = DateField()
    enum_array = ArrayField(Enum16Field(Fruit))

    engine = MergeTree('date_field', ('date_field',))
class ModelWithEnum(Model):

    date_field = DateField()
    enum_field = Enum8Field(Fruit)

    engine = MergeTree('date_field', ('date_field',))
class ParentModel(Model):

    date_field = DateField()
    int_field = Int32Field()

    engine = MergeTree('date_field', ('int_field', 'date_field'))