clickhouse: fix for prev. rev. [#CONV-6318].

This commit is contained in:
Michael Kolupaev 2012-12-26 14:40:38 +00:00
parent cd9a27b433
commit b1406f4631
2 changed files with 6 additions and 6 deletions

View File

@ -39,7 +39,7 @@ public:
ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
const IDataType * type = &*arguments[0];
if (type->isNumeric() &&
if (!type->isNumeric() &&
!dynamic_cast<const DataTypeDate *>(type) &&
!dynamic_cast<const DataTypeDateTime *>(type))
throw Exception("Cannot reinterpret " + type->getName() + " as String", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);

View File

@ -518,8 +518,8 @@ void QueryConverter::fillFormattedAttributeMap()
M("WindowClientArea", "concat(concat(toString(WindowClientWidth),'x'),toString(WindowClientHeight))")
M("UserAgent", "concat(concat(concat(toString(UserAgent), ' '), toString(UserAgentMajor)), UserAgentMinor == 0 ? '' : concat('.', reinterpretAsString(UserAgentMinor)))")
M("UserAgentVersion", "concat(toString(UserAgentMajor), UserAgentMinor == 0 ? '' : concat('.', reinterpretAsString(UserAgentMinor)))")
M("UserAgent", "concat(concat(concat(toString(UserAgent), ' '), toString(UserAgentMajor)), UserAgentMinor == 0 ? '' : concat('.', trimRight(reinterpretAsString(UserAgentMinor))))")
M("UserAgentVersion", "concat(toString(UserAgentMajor), UserAgentMinor == 0 ? '' : concat('.', trimRight(reinterpretAsString(UserAgentMinor))))")
M("UserAgentMajor", "concat(concat(toString(UserAgent), ' '), toString(UserAgentMajor))")
#undef M
}
@ -530,7 +530,7 @@ void QueryConverter::fillFormattingAggregatedAttributeMap()
std::string todate = "toDate(toDateTime(%s))";
std::string todatetime = "toDateTime(%s)";
std::string cuttime = "substring(toString(toDateTime(%s)), 12, 8)";
std::string tostring = "reinterpretAsString(%s)";
std::string tostring = "trimRight(reinterpretAsString(%s))";
M("VisitStartDateTime", todatetime)
M("VisitStartDate", todate)
@ -569,8 +569,8 @@ void QueryConverter::fillFormattingAggregatedAttributeMap()
M("WindowClientArea", "concat(concat(toString(intDiv(toUInt64(%[0]s), 65536)),'x'),toString(toUInt64(%[0]s) % 65536))")
M("UserAgent", "concat(concat(concat(toString(intDiv(toUInt32(%[0]s), 16777216)), ' '), toString(intDiv(toUInt32(%[0]s), 65536) % 256)), (toUInt32(%[0]s) % 65536) == 0 ? '' : concat('.', reinterpretAsString(toUInt32(%[0]s) % 65536)))")
M("UserAgentVersion", "concat(toString(intDiv(toUInt32(%[0]s), 65536)), (toUInt32(%[0]s) % 65536) == 0 ? '' : concat('.', reinterpretAsString(toUInt32(%[0]s) % 65536)))")
M("UserAgent", "concat(concat(concat(toString(intDiv(toUInt32(%[0]s), 16777216)), ' '), toString(intDiv(toUInt32(%[0]s), 65536) % 256)), (toUInt32(%[0]s) % 65536) == 0 ? '' : concat('.', trimRight(reinterpretAsString(toUInt32(%[0]s) % 65536))))")
M("UserAgentVersion", "concat(toString(intDiv(toUInt32(%[0]s), 65536)), (toUInt32(%[0]s) % 65536) == 0 ? '' : concat('.', trimRight(reinterpretAsString(toUInt32(%[0]s) % 65536))))")
M("UserAgentMajor", "concat(concat(toString(intDiv(toUInt32(%[0]s), 256)), ' '), toString(toUInt32(%[0]s) % 256))")
M("Interests", "bitmaskToList(%s)")