class ClickHouseSecondTestModel(ClickHouseModel): django_model = SecondaryTestModel sync_delay = 2 sync_enabled = True id = fields.Int32Field() created_date = fields.DateField() value = fields.Int32Field() engine = ReplacingMergeTree('created_date', ('id', ))
class ClickHouseTestModel(ClickHouseModel): django_model = TestModel sync_delay = 2 sync_enabled = True id = fields.Int32Field() created_date = fields.DateField() value = fields.Int32Field() engine = ReplacingMergeTree('created_date', ('id', )) migrate_db_aliases = ('default', 'secondary')
class ClickHouseCollapseTestModel(ClickHouseModel): django_model = TestModel sync_delay = 2 sync_enabled = True id = fields.Int32Field() created_date = fields.DateField() value = fields.Int32Field() sign = fields.Int8Field() engine = CollapsingMergeTree('created_date', ('id', ), 'sign')
class ClickhouseAllFields(chm.Model): id = chf.Int64Field() timestamp = chf.DateTimeField() timestamp_date = chf.DateField() string_field = chf.StringField() intfield = chf.Int32Field() floatfield = chf.Float32Field() null_field = chf.NullableField(chf.StringField()) enum_field = chf.Enum16Field(enum_) array_field = chf.ArrayField(chf.Int16Field()) engine = MergeTree('timestamp_date', ['id'])
class BearRequests_development(models.Model): EventDate = fields.DateField() RequestTime = fields.DateTimeField() RequestPath = fields.StringField() RequestCommand = fields.StringField() RequestVersion = fields.StringField() RequestRaw = fields.StringField() ProbeName = fields.StringField() RequestDetectionID = fields.Int32Field() BotIP = fields.StringField() BotCountry = fields.StringField() BotUA = fields.StringField() BotContinent = fields.StringField() BotTracert = fields.StringField() BotDNSName = fields.StringField() engine = engines.MergeTree('EventDate', ('RequestTime', 'BotIP'))
class Any(ClickHouseModel): timestamp = fields.Int32Field() name = fields.StringField() type = fields.StringField() value = fields.StringField()
class InstanceData(models.Model): capacityStatus = fields.NullableField(fields.StringField()) clockSpeedIsUpTo = fields.NullableField(BooleanField()) clockSpeed = fields.NullableField(fields.Float32Field()) #in GHz currentGeneration = fields.NullableField(BooleanField()) dedicatedEbsThroughputIsUpTo = fields.NullableField(BooleanField()) dedicatedEbsThroughput = fields.NullableField( fields.Int32Field()) #in Mbps ebsOptimized = fields.NullableField(BooleanField()) ecuIsVariable = fields.NullableField(BooleanField()) ecu = fields.NullableField(fields.Float32Field()) elasticGraphicsType = fields.NullableField(fields.StringField()) enhancedNetworkingSupported = fields.NullableField(BooleanField()) fromLocation = fields.NullableField(fields.StringField()) fromLocationType = fields.NullableField(fields.StringField()) gpu = fields.NullableField(fields.Int32Field()) gpuMemory = fields.NullableField(fields.StringField()) group = fields.NullableField(fields.StringField()) groupDescription = fields.NullableField(fields.StringField()) instance = fields.NullableField(fields.StringField()) instanceCapacity10xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity12xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity16xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity18xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity24xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity2xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity32xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity4xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity8xlarge = fields.NullableField(fields.Int32Field()) instanceCapacity9xlarge = fields.NullableField(fields.Int32Field()) instanceCapacityLarge = fields.NullableField(fields.Int32Field()) instanceCapacityMedium = fields.NullableField(fields.Int32Field()) instanceCapacityXlarge = fields.NullableField(fields.Int32Field()) instanceFamily = fields.NullableField(fields.StringField()) instanceType = fields.NullableField(fields.StringField()) instanceSKU = fields.NullableField(fields.StringField()) intelAvx2Available = fields.NullableField(BooleanField()) intelAvxAvailable = fields.NullableField(BooleanField()) intelTurboAvailable = fields.NullableField(BooleanField()) licenseModel = fields.NullableField(fields.StringField()) location = fields.NullableField(fields.StringField()) locationType = fields.NullableField(fields.StringField()) maxIopsBurstPerformance = fields.NullableField(fields.StringField()) maxIopsVolume = fields.NullableField(fields.StringField()) maxThroughputVolume = fields.NullableField(fields.StringField()) maxVolumeSize = fields.NullableField(fields.Int32Field()) #in TiB memory = fields.NullableField(fields.Float32Field()) #in GiB networkPerformance = fields.NullableField(fields.StringField()) normalizationSizeFactor = fields.NullableField(fields.Float32Field()) operatingSystem = fields.NullableField(fields.StringField()) operation = fields.NullableField(fields.StringField()) physicalCores = fields.NullableField(fields.Int32Field()) physicalProcessor = fields.NullableField(fields.StringField()) preInstalledSw = fields.NullableField(fields.StringField()) processorArchitecture = fields.NullableField(fields.StringField()) processorFeatures = fields.NullableField(fields.StringField()) productFamily = fields.NullableField(fields.StringField()) provisioned = fields.NullableField(BooleanField()) serviceCode = fields.NullableField(fields.StringField()) serviceName = fields.NullableField(fields.StringField()) storageIsEbsOnly = fields.NullableField(BooleanField()) storageCount = fields.NullableField(fields.Int32Field()) storageCapacity = fields.NullableField(fields.Int32Field()) storageType = fields.NullableField(fields.StringField()) storageMedia = fields.NullableField(fields.StringField()) tenancy = fields.NullableField(fields.StringField()) toLocation = fields.NullableField(fields.StringField()) toLocationType = fields.NullableField(fields.StringField()) transferType = fields.NullableField(fields.StringField()) usageType = fields.NullableField(fields.StringField()) vcpu = fields.NullableField(fields.Int32Field()) volumeType = fields.NullableField(fields.StringField()) onDemandAppliesTo = fields.NullableField(fields.StringField()) onDemandBeginRange = fields.NullableField(fields.StringField()) onDemandDescription = fields.NullableField(fields.StringField()) onDemandEffectiveDate = fields.NullableField(fields.DateTimeField()) onDemandEndRange = fields.NullableField(fields.Float32Field()) onDemandOfferTermCode = fields.NullableField(fields.StringField()) onDemandRateCode = fields.NullableField(fields.StringField()) onDemandPricePerUnit = fields.NullableField(fields.StringField()) onDemandPriceUnit = fields.NullableField(fields.StringField()) reservedAppliesTo = fields.NullableField(fields.StringField()) reservedBeginRange = fields.NullableField(fields.StringField()) reservedDescription = fields.NullableField(fields.StringField()) reservedEffectiveDate = fields.NullableField(fields.StringField()) reservedEndRange = fields.NullableField(fields.StringField()) reservedLeaseContractLength = fields.NullableField(fields.StringField()) reservedOfferTermCode = fields.NullableField(fields.StringField()) reservedOfferingClass = fields.NullableField(fields.StringField()) reservedPurchaseOption = fields.NullableField(fields.StringField()) reservedRateCode = fields.NullableField(fields.StringField()) reservedPricePerUnit = fields.NullableField(fields.StringField()) reservedPriceUnit = fields.NullableField(fields.StringField()) spotPrice = fields.NullableField(fields.StringField()) spotTimestamp = fields.NullableField(fields.StringField()) spotInstanceType = fields.NullableField(fields.StringField()) spotAvailabilityZone = fields.NullableField(fields.StringField()) engine = engines.Memory()
class Hits_with_visits(md.Model): # describes datatypes and fields idSite=fd.Int32Field() idVisit = fd.UInt64Field() visitIp=fd.StringField(default='none') visitorId=fd.StringField() goalConversions=fd.UInt64Field() siteCurrency=fd.StringField() siteCurrencySymbol=fd.StringField() serverDate=fd.DateField() visitServerHour=fd.UInt64Field() lastActionTimestamp=fd.UInt64Field() lastActionDateTime=fd.StringField() userId=fd.StringField() visitorType=fd.StringField() visitorTypeIcon=fd.StringField() visitConverted=fd.UInt64Field() visitConvertedIcon=fd.StringField() visitCount=fd.UInt64Field() firstActionTimestamp=fd.UInt64Field() visitEcommerceStatus=fd.StringField() visitEcommerceStatusIcon=fd.StringField() daysSinceFirstVisit=fd.UInt64Field() daysSinceLastEcommerceOrder=fd.UInt64Field() visitDuration=fd.UInt64Field() visitDurationPretty=fd.StringField() searches=fd.UInt64Field() actions=fd.UInt64Field() interactions=fd.UInt64Field() referrerType=fd.StringField() referrerTypeName=fd.StringField() referrerName=fd.StringField() referrerKeyword=fd.StringField() referrerKeywordPosition=fd.UInt64Field() referrerUrl=fd.StringField() referrerSearchEngineUrl=fd.StringField() referrerSearchEngineIcon=fd.StringField() languageCode=fd.StringField() language=fd.StringField() deviceType=fd.StringField() deviceTypeIcon=fd.StringField() deviceBrand=fd.StringField() deviceModel=fd.StringField() operatingSystem=fd.StringField() operatingSystemName=fd.StringField() operatingSystemIcon=fd.StringField() operatingSystemCode=fd.StringField() operatingSystemVersion=fd.StringField() browserFamily=fd.StringField() browserFamilyDescription=fd.StringField() browser=fd.StringField() browserName=fd.StringField() browserIcon=fd.StringField() browserCode=fd.StringField() browserVersion=fd.StringField() events=fd.UInt64Field() continent=fd.StringField() continentCode=fd.StringField() country=fd.StringField() countryCode=fd.StringField() countryFlag=fd.StringField() region=fd.StringField() regionCode=fd.StringField() city=fd.StringField() location=fd.StringField() latitude=fd.Float64Field() longitude=fd.Float64Field() visitLocalTime=fd.StringField() visitLocalHour=fd.UInt64Field() daysSinceLastVisit=fd.UInt64Field() customVariables=fd.StringField() resolution=fd.StringField() plugins=fd.StringField() pluginsIcons=fd.StringField() provider=fd.StringField() providerName=fd.StringField() providerUrl=fd.StringField() dimension1=fd.StringField() campaignId=fd.StringField() campaignContent=fd.StringField() campaignKeyword=fd.StringField() campaignMedium=fd.StringField() campaignName=fd.StringField() campaignSource=fd.StringField() serverTimestamp=fd.UInt64Field() serverTimePretty=fd.StringField() serverDatePretty=fd.StringField() serverDatePrettyFirstAction=fd.StringField() serverTimePrettyFirstAction=fd.StringField() totalEcommerceRevenue=fd.Float64Field() totalEcommerceConversions=fd.UInt64Field() totalEcommerceItems=fd.UInt64Field() totalAbandonedCartsRevenue=fd.Float64Field() totalAbandonedCarts=fd.UInt64Field() totalAbandonedCartsItems=fd.UInt64Field() AdCampaignId=fd.StringField() AdBannerId=fd.StringField() AdChannelId=fd.StringField() AdDeviceType=fd.StringField() AdGroupId=fd.StringField() AdKeywordId=fd.StringField() AdPosition=fd.StringField() AdPositionType=fd.StringField() AdRegionId=fd.StringField() AdRetargetindId=fd.StringField() AdPlacement=fd.StringField() AdTargetId=fd.StringField() AdvertisingSystem=fd.StringField() DRF=fd.StringField() Gclid=fd.StringField() SmartClickId=fd.StringField() Type=fd.StringField() goalName=fd.StringField(default='none') goalId=fd.UInt64Field() revenue=fd.UInt64Field() goalPageId=fd.StringField(default='none') url=fd.StringField(default='none') pageTitle=fd.StringField(default='none') pageIdAction=fd.UInt64Field(default=0) pageId=fd.UInt64Field(default=0) generationTimeMilliseconds=fd.UInt64Field(default=0) generationTime=fd.StringField() interactionPosition=fd.UInt64Field(default=0) icon=fd.StringField(default='none') timestamp=fd.UInt64Field(default=0) idpageview=fd.StringField(default='none') serverTimePrettyHit=fd.StringField() sign=fd.Int8Field() # creating an sampled MergeTree engine = en.CollapsingMergeTree('serverDate', ('idSite','idVisit','visitIp','visitorId','goalConversions','siteCurrency','siteCurrencySymbol','serverDate','visitServerHour', 'lastActionTimestamp','lastActionDateTime','userId','visitorType','visitorTypeIcon','visitConverted','visitConvertedIcon', 'visitCount','firstActionTimestamp','visitEcommerceStatus','visitEcommerceStatusIcon','daysSinceFirstVisit','daysSinceLastEcommerceOrder', 'visitDuration','visitDurationPretty','searches','actions','interactions','referrerType','referrerTypeName','referrerName','referrerKeyword', 'referrerKeywordPosition','referrerUrl','referrerSearchEngineUrl','referrerSearchEngineIcon','languageCode','language','deviceType','deviceTypeIcon','deviceBrand','deviceModel', 'operatingSystem','operatingSystemName','operatingSystemIcon','operatingSystemCode','operatingSystemVersion','browserFamily','browserFamilyDescription', 'browser','browserName','browserIcon','browserCode','browserVersion','events','continent','continentCode', 'country','countryCode','countryFlag','region','regionCode','city','location','latitude','longitude','visitLocalTime','visitLocalHour', 'daysSinceLastVisit','customVariables','resolution','plugins','pluginsIcons','provider','providerName','providerUrl','dimension1','campaignId', 'campaignContent','campaignKeyword','campaignMedium','campaignName','campaignSource','serverTimestamp','serverTimePretty','serverDatePretty', 'serverDatePrettyFirstAction','serverTimePrettyFirstAction','totalEcommerceRevenue','totalEcommerceConversions','totalEcommerceItems','totalAbandonedCartsRevenue', 'totalAbandonedCarts','totalAbandonedCartsItems','AdCampaignId','AdBannerId','AdChannelId','AdDeviceType','AdGroupId','AdKeywordId','AdPosition','AdPositionType', 'AdRegionId','AdRetargetindId','AdPlacement','AdTargetId','AdvertisingSystem','DRF','Gclid','SmartClickId','Type','goalName','goalId','revenue','goalPageId','url','pageTitle','pageIdAction', 'pageId','generationTimeMilliseconds','generationTime','interactionPosition','icon','timestamp','idpageview','serverTimePrettyHit'),'sign')