mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Addition to prev. revision [#CLICKHOUSE-2].
This commit is contained in:
parent
50b84fcc9d
commit
dc0d5b604f
@ -35,62 +35,62 @@ int main(int argc, char ** argv)
|
||||
{
|
||||
NamesAndTypesList names_and_types_list
|
||||
{
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
};
|
||||
|
||||
Context context;
|
||||
@ -105,7 +105,8 @@ int main(int argc, char ** argv)
|
||||
|
||||
/// create an object of an existing hit log table
|
||||
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list));
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list),
|
||||
NamesAndTypesList{}, NamesAndTypesList{}, ColumnDefaults{}, DEFAULT_MAX_COMPRESS_BLOCK_SIZE);
|
||||
table->startup();
|
||||
|
||||
/// read from it, apply the expression, filter, and write in tsv form to the console
|
||||
|
@ -30,62 +30,62 @@ try
|
||||
|
||||
NamesAndTypesList names_and_types_list
|
||||
{
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
};
|
||||
|
||||
Names column_names;
|
||||
@ -95,7 +95,8 @@ try
|
||||
|
||||
/// create an object of an existing hit log table
|
||||
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list));
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list),
|
||||
NamesAndTypesList{}, NamesAndTypesList{}, ColumnDefaults{}, DEFAULT_MAX_COMPRESS_BLOCK_SIZE);
|
||||
table->startup();
|
||||
|
||||
/// read from it
|
||||
|
@ -34,62 +34,62 @@ try
|
||||
{
|
||||
NamesAndTypesList names_and_types_list
|
||||
{
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
};
|
||||
|
||||
using NamesAndTypesMap = std::map<String, DataTypePtr>;
|
||||
@ -107,7 +107,8 @@ try
|
||||
|
||||
/// create an object of an existing hit log table
|
||||
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list));
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list),
|
||||
NamesAndTypesList{}, NamesAndTypesList{}, ColumnDefaults{}, DEFAULT_MAX_COMPRESS_BLOCK_SIZE);
|
||||
table->startup();
|
||||
|
||||
/// read from it, sort it, and write it in tsv form to the console
|
||||
|
@ -29,62 +29,62 @@ try
|
||||
{
|
||||
NamesAndTypesList names_and_types_list
|
||||
{
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
{"WatchID", std::make_shared<DataTypeUInt64>()},
|
||||
{"JavaEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"Title", std::make_shared<DataTypeString>()},
|
||||
{"EventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"CounterID", std::make_shared<DataTypeUInt32>()},
|
||||
{"ClientIP", std::make_shared<DataTypeUInt32>()},
|
||||
{"RegionID", std::make_shared<DataTypeUInt32>()},
|
||||
{"UniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"CounterClass", std::make_shared<DataTypeUInt8>()},
|
||||
{"OS", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgent", std::make_shared<DataTypeUInt8>()},
|
||||
{"URL", std::make_shared<DataTypeString>()},
|
||||
{"Referer", std::make_shared<DataTypeString>()},
|
||||
{"ResolutionWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ResolutionDepth", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"FlashMinor2", std::make_shared<DataTypeString>()},
|
||||
{"NetMajor", std::make_shared<DataTypeUInt8>()},
|
||||
{"NetMinor", std::make_shared<DataTypeUInt8>()},
|
||||
{"UserAgentMajor", std::make_shared<DataTypeUInt16>()},
|
||||
{"UserAgentMinor", std::make_shared<DataTypeFixedString>(2)},
|
||||
{"CookieEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"JavascriptEnable", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsMobile", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhone", std::make_shared<DataTypeUInt8>()},
|
||||
{"MobilePhoneModel", std::make_shared<DataTypeString>()},
|
||||
{"Params", std::make_shared<DataTypeString>()},
|
||||
{"IPNetworkID", std::make_shared<DataTypeUInt32>()},
|
||||
{"TraficSourceID", std::make_shared<DataTypeInt8>()},
|
||||
{"SearchEngineID", std::make_shared<DataTypeUInt16>()},
|
||||
{"SearchPhrase", std::make_shared<DataTypeString>()},
|
||||
{"AdvEngineID", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsArtifical", std::make_shared<DataTypeUInt8>()},
|
||||
{"WindowClientWidth", std::make_shared<DataTypeUInt16>()},
|
||||
{"WindowClientHeight", std::make_shared<DataTypeUInt16>()},
|
||||
{"ClientTimeZone", std::make_shared<DataTypeInt16>()},
|
||||
{"ClientEventTime", std::make_shared<DataTypeDateTime>()},
|
||||
{"SilverlightVersion1", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion2", std::make_shared<DataTypeUInt8>()},
|
||||
{"SilverlightVersion3", std::make_shared<DataTypeUInt32>()},
|
||||
{"SilverlightVersion4", std::make_shared<DataTypeUInt16>()},
|
||||
{"PageCharset", std::make_shared<DataTypeString>()},
|
||||
{"CodeVersion", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsLink", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsDownload", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsNotBounce", std::make_shared<DataTypeUInt8>()},
|
||||
{"FUniqID", std::make_shared<DataTypeUInt64>()},
|
||||
{"OriginalURL", std::make_shared<DataTypeString>()},
|
||||
{"HID", std::make_shared<DataTypeUInt32>()},
|
||||
{"IsOldCounter", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsEvent", std::make_shared<DataTypeUInt8>()},
|
||||
{"IsParameter", std::make_shared<DataTypeUInt8>()},
|
||||
{"DontCountHits", std::make_shared<DataTypeUInt8>()},
|
||||
{"WithHash", std::make_shared<DataTypeUInt8>()},
|
||||
};
|
||||
|
||||
DataTypes data_types;
|
||||
@ -98,7 +98,8 @@ try
|
||||
|
||||
/// create a hit log table
|
||||
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list));
|
||||
StoragePtr table = StorageLog::create("./", "HitLog", std::make_shared<NamesAndTypesList>(names_and_types_list),
|
||||
NamesAndTypesList{}, NamesAndTypesList{}, ColumnDefaults{}, DEFAULT_MAX_COMPRESS_BLOCK_SIZE);
|
||||
table->startup();
|
||||
|
||||
/// create a description of how to read data from the tab separated dump
|
||||
|
@ -45,9 +45,9 @@ try
|
||||
|
||||
StoragePtr table = StorageMergeTree::create(
|
||||
"./", "default", "test",
|
||||
names_and_types, {}, {}, ColumnDefaults{}, false,
|
||||
names_and_types, NamesAndTypesList{}, NamesAndTypesList{}, ColumnDefaults{}, false,
|
||||
context, primary_expr, "d",
|
||||
nullptr, 101, params, false, {});
|
||||
ASTPtr{}, 101, params, false, MergeTreeSettings{});
|
||||
table->startup();
|
||||
|
||||
/// write into it
|
||||
|
@ -24,7 +24,8 @@ try
|
||||
names_and_types->push_back(NameAndTypePair("a", std::make_shared<DataTypeUInt64>()));
|
||||
names_and_types->push_back(NameAndTypePair("b", std::make_shared<DataTypeUInt8>()));
|
||||
|
||||
StoragePtr table = StorageLog::create("./", "test", names_and_types);
|
||||
StoragePtr table = StorageLog::create("./", "test", names_and_types,
|
||||
NamesAndTypesList{}, NamesAndTypesList{}, ColumnDefaults{}, DEFAULT_MAX_COMPRESS_BLOCK_SIZE);
|
||||
table->startup();
|
||||
|
||||
/// write into it
|
||||
|
Loading…
Reference in New Issue
Block a user