From 730f8e591bea35c379085ccc30711c0375e5fc18 Mon Sep 17 00:00:00 2001 From: Evgeniy Gatov Date: Thu, 16 May 2013 14:35:57 +0000 Subject: [PATCH] =?UTF-8?q?programs/=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= =?UTF-8?q?=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= =?UTF-8?q?,=20=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= =?UTF-8?q?=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88,=20=E2=96=88?= =?UTF-8?q?=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88?= =?UTF-8?q?=E2=96=88=E2=96=88=E2=96=88,=20dbms/Server:=20added=20ClickTarg?= =?UTF-8?q?etPhraseID,=20added=20missing=20commercial=20interests=20[#CONV?= =?UTF-8?q?-7548],=20[#CONV-7310].?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbms/src/Server/OLAPAttributesMetadata.h | 79 +++++++++++++++++++++--- dbms/src/Server/OLAPQueryConverter.cpp | 1 + 2 files changed, 72 insertions(+), 8 deletions(-) diff --git a/dbms/src/Server/OLAPAttributesMetadata.h b/dbms/src/Server/OLAPAttributesMetadata.h index 8c9b8141ddd..9cdd453185a 100644 --- a/dbms/src/Server/OLAPAttributesMetadata.h +++ b/dbms/src/Server/OLAPAttributesMetadata.h @@ -2030,6 +2030,10 @@ struct ClickOrderID : public AttributeUIntBase std::string getName() const { return "ClickOrderID"; } }; +struct ClickTargetPhraseID : public AttributeUIntBase +{ + std::string getName() const { return "ClickTargetPhraseID"; } +}; struct GoalReachesAny : public AttributeUIntBase { @@ -2129,10 +2133,20 @@ struct Interests : public AttributeUIntBase token_compress_on)); i != split_iterator(); ++i) { UInt16 interest = Poco::NumberParser::parseUnsigned(boost::copy_range(*i)); - value |= (interest == 512 ? 512 : (interest == 256 ? 256 : - (interest == 128 ? 128 : ( interest == 64 ? 64 :(interest == 32 ? 32 : - (interest == 16 ? 16 : (interest == 8 ? 8 :(interest == 4 ? 4 : - (interest == 2 ? 2 :(interest == 1 ? 1 : 0)))))))))); + value |= (interest == 0x2000 ? 0x2000 : + (interest == 0x1000 ? 0x1000 : + (interest == 0x800 ? 0x800 : + (interest == 0x400 ? 0x400 : + (interest == 0x200 ? 0x200 : + (interest == 0x100 ? 0x100 : + (interest == 0x80 ? 0x80 : + (interest == 0x40 ? 0x40 : + (interest == 0x20 ? 0x20 : + (interest == 0x10 ? 0x10 : + (interest == 8 ? 8 : + (interest == 4 ? 4 : + (interest == 2 ? 2 : + (interest == 1 ? 1 : 0)))))))))))))); } return value; @@ -2266,6 +2280,50 @@ struct HasInterestCulinary : public AttributeUIntBase } }; +struct HasInterestSoftware : public AttributeUIntBase +{ + std::string getName() const { return "HasInterestSoftware"; } + std::string getFileName() const { return "Interests"; } + + BinaryData extractFromOne(void* buf) const + { + return (static_cast(static_cast(buf)[0] & SOFTWARE)); + } +}; + +struct HasInterestEstate : public AttributeUIntBase +{ + std::string getName() const { return "HasInterestEstate"; } + std::string getFileName() const { return "Interests"; } + + BinaryData extractFromOne(void* buf) const + { + return (static_cast(static_cast(buf)[0] & ESTATE)); + } +}; + +struct HasInterestHealthyLifestyle : public AttributeUIntBase +{ + std::string getName() const { return "HasInterestHealthyLifestyle"; } + std::string getFileName() const { return "Interests"; } + + BinaryData extractFromOne(void* buf) const + { + return (static_cast(static_cast(buf)[0] & HEALTHY_LIFESTYLE)); + } +}; + +struct HasInterestLiterature : public AttributeUIntBase +{ + std::string getName() const { return "HasInterestLiterature"; } + std::string getFileName() const { return "Interests"; } + + BinaryData extractFromOne(void* buf) const + { + return (static_cast(static_cast(buf)[0] & LITERATURE)); + } +}; + struct OpenstatServiceNameHash : public AttributeHashBase { std::string getName() const { return "OpenstatServiceNameHash"; } @@ -2442,6 +2500,7 @@ inline AttributeMetadatas GetOLAPAttributeMetadata() metadata["ClickCost"] = new ClickCost; metadata["ClickURLHash"] = new ClickURLHash; metadata["ClickOrderID"] = new ClickOrderID; + metadata["ClickTargetPhraseID"] = new ClickTargetPhraseID; metadata["GoalReaches"] = new GoalReaches; metadata["GoalReachesAny"] = new GoalReachesAny; metadata["GoalReachesDepth"] = new GoalReachesDepth; @@ -2469,15 +2528,19 @@ inline AttributeMetadatas GetOLAPAttributeMetadata() metadata["BrowserCountry"] = new BrowserCountry; metadata["Interests"] = new Interests; metadata["HasInterestPhoto"] = new HasInterestPhoto; - metadata["HasInterestMoviePremieres"]= new HasInterestMoviePremieres; + metadata["HasInterestMoviePremieres"] = new HasInterestMoviePremieres; metadata["HasInterestMobileAndInternetCommunications"] = new HasInterestMobileAndInternetCommunications; metadata["HasInterestFinance"] = new HasInterestFinance; - metadata["HasInterestFamilyAndChildren"]= new HasInterestFamilyAndChildren; + metadata["HasInterestFamilyAndChildren"] = new HasInterestFamilyAndChildren; metadata["HasInterestCars"] = new HasInterestCars; metadata["HasInterestB2B"] = new HasInterestB2B; metadata["HasInterestTourism"] = new HasInterestTourism; - metadata["HasInterestBuilding"] = new HasInterestBuilding; - metadata["HasInterestCulinary"] = new HasInterestCulinary; + metadata["HasInterestBuilding"] = new HasInterestBuilding; + metadata["HasInterestCulinary"] = new HasInterestCulinary; + metadata["HasInterestSoftware"] = new HasInterestSoftware; + metadata["HasInterestEstate"] = new HasInterestEstate; + metadata["HasInterestHealthyLifestyle"] = new HasInterestHealthyLifestyle; + metadata["HasInterestLiterature"] = new HasInterestLiterature; metadata["OpenstatServiceNameHash"]= new OpenstatServiceNameHash; metadata["OpenstatCampaignIDHash"] = new OpenstatCampaignIDHash; diff --git a/dbms/src/Server/OLAPQueryConverter.cpp b/dbms/src/Server/OLAPQueryConverter.cpp index 94d245413cd..34ecf8d788f 100644 --- a/dbms/src/Server/OLAPQueryConverter.cpp +++ b/dbms/src/Server/OLAPQueryConverter.cpp @@ -503,6 +503,7 @@ void QueryConverter::fillNumericAttributeMap() M("ClickCost", "ClickCost") M("ClickURLHash", "ClickURLHash") M("ClickOrderID", "ClickOrderID") + M("ClickTargetPhraseID", "ClickTargetPhraseID") M("GoalReachesAny", "GoalReachesAny") M("GoalReachesDepth", "GoalReachesDepth") M("GoalReachesURL", "GoalReachesURL")