Removed code that was used solely by Metrika [#DEVTOOLS-3343].

This commit is contained in:
Alexey Milovidov 2017-06-15 21:27:51 +03:00
parent 9bf083625d
commit 0743cfe6d7
4 changed files with 0 additions and 143 deletions

View File

@ -1,6 +1,5 @@
#pragma once
#include <common/MetrikaTypes.h>
#include <common/LocalDate.h>
#include <common/LocalDateTime.h>
#include <Core/Field.h>

View File

@ -1,109 +0,0 @@
#pragma once
#include <mysqlxx/Row.h>
#include <mysqlxx/Null.h>
#include <mysqlxx/Manip.h>
#include <common/MetrikaTypes.h>
#include <Core/Field.h>
#include <Core/FieldVisitors.h>
#include <IO/WriteHelpers.h>
/// This is for Yandex.Metrica code.
namespace mysqlxx
{
inline std::ostream & operator<< (mysqlxx::EscapeManipResult res, const DB::Array & value)
{
return res.ostr << DB::applyVisitor(DB::FieldVisitorToString(), DB::Field(value));
}
inline std::ostream & operator<< (mysqlxx::QuoteManipResult res, const DB::Array & value)
{
throw Poco::Exception("Cannot quote Array with mysqlxx::quote.");
}
inline std::istream & operator>> (mysqlxx::UnEscapeManipResult res, DB::Array & value)
{
throw Poco::Exception("Cannot unescape Array with mysqlxx::unescape.");
}
inline std::istream & operator>> (mysqlxx::UnQuoteManipResult res, DB::Array & value)
{
throw Poco::Exception("Cannot unquote Array with mysqlxx::unquote.");
}
inline std::ostream & operator<< (mysqlxx::EscapeManipResult res, const DB::Tuple & value)
{
return res.ostr << DB::applyVisitor(DB::FieldVisitorToString(), DB::Field(value));
}
inline std::ostream & operator<< (mysqlxx::QuoteManipResult res, const DB::Tuple & value)
{
throw Poco::Exception("Cannot quote Tuple with mysqlxx::quote.");
}
inline std::istream & operator>> (mysqlxx::UnEscapeManipResult res, DB::Tuple & value)
{
throw Poco::Exception("Cannot unescape Tuple with mysqlxx::unescape.");
}
inline std::istream & operator>> (mysqlxx::UnQuoteManipResult res, DB::Tuple & value)
{
throw Poco::Exception("Cannot unquote Tuple with mysqlxx::unquote.");
}
template <> inline VisitID_t Value::get<VisitID_t>() const { return VisitID_t(getUInt()); }
}
namespace DB
{
/// Output mysqlxx::Row in tab-separated form
inline void writeEscapedRow(const mysqlxx::Row & row, WriteBuffer & buf)
{
for (size_t i = 0; i < row.size(); ++i)
{
if (i != 0)
buf.write('\t');
if (unlikely(row[i].isNull()))
{
buf.write("\\N", 2);
continue;
}
writeAnyEscapedString<'\''>(row[i].data(), row[i].data() + row[i].length(), buf);
}
}
template <typename T>
inline void writeText(const mysqlxx::Null<T> & x, WriteBuffer & buf)
{
if (x.isNull())
writeCString("\\N", buf);
else
writeText(static_cast<const T &>(x), buf);
}
template <typename T>
inline void writeQuoted(const mysqlxx::Null<T> & x, WriteBuffer & buf)
{
if (x.isNull())
writeCString("NULL", buf);
else
writeText(static_cast<const T &>(x), buf);
}
template <typename T>
inline Field toField(const mysqlxx::Null<T> & x)
{
return x.isNull() ? Field(Null()) : toField(static_cast<const T &>(x));
}
}

View File

@ -29,7 +29,6 @@ add_library (common
include/common/ApplicationServerExt.h
include/common/Types.h
include/common/MetrikaTypes.h
include/common/DateLUT.h
include/common/DateLUTImpl.h
include/common/LocalDate.h

View File

@ -1,32 +0,0 @@
#pragma once
#include <functional>
#include <common/Types.h>
#include <common/strong_typedef.h>
/// The following is for Yandex.Metrika code. Not used by ClickHouse.
/** Тип данных для хранения идентификатора пользователя. */
using UserID_t = UInt64;
/** Тип данных для хранения идентификатора счетчика. */
using CounterID_t = UInt32;
/** Идентификатор хита */
using WatchID_t = UInt64;
/** Идентификатор визита */
STRONG_TYPEDEF(UInt64, VisitID_t);
namespace std
{
template <> struct is_integral<VisitID_t> : std::true_type {};
template <> struct is_arithmetic<VisitID_t> : std::true_type {};
}
/** Идентификатор клика */
using ClickID_t = UInt64;
/** Идентификатор цели */
using GoalID_t = UInt32;