-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a88273c
commit 8d99d65
Showing
60 changed files
with
1,641 additions
and
267 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
ydb/core/kqp/gateway/behaviour/tablestore/operations/drop_stat.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "drop_stat.h" | ||
#include <util/string/type.h> | ||
|
||
namespace NKikimr::NKqp { | ||
|
||
TConclusionStatus TDropStatOperation::DoDeserialize(NYql::TObjectSettingsImpl::TFeaturesExtractor& features) { | ||
{ | ||
auto fValue = features.Extract("NAME"); | ||
if (!fValue) { | ||
return TConclusionStatus::Fail("can't find parameter NAME"); | ||
} | ||
Name = *fValue; | ||
} | ||
return TConclusionStatus::Success(); | ||
} | ||
|
||
void TDropStatOperation::DoSerializeScheme(NKikimrSchemeOp::TAlterColumnTableSchema& schemaData) const { | ||
*schemaData.AddDropStatistics() = Name; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
ydb/core/kqp/gateway/behaviour/tablestore/operations/drop_stat.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "abstract.h" | ||
|
||
namespace NKikimr::NKqp { | ||
|
||
class TDropStatOperation : public ITableStoreOperation { | ||
static TString GetTypeName() { | ||
return "DROP_STAT"; | ||
} | ||
|
||
static inline auto Registrator = TFactory::TRegistrator<TDropStatOperation>(GetTypeName()); | ||
private: | ||
TString Name; | ||
public: | ||
TConclusionStatus DoDeserialize(NYql::TObjectSettingsImpl::TFeaturesExtractor& features) override; | ||
void DoSerializeScheme(NKikimrSchemeOp::TAlterColumnTableSchema& schemaData) const override; | ||
}; | ||
|
||
} | ||
|
49 changes: 49 additions & 0 deletions
49
ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_stat.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "upsert_stat.h" | ||
#include <util/string/type.h> | ||
#include <library/cpp/json/json_reader.h> | ||
|
||
namespace NKikimr::NKqp { | ||
|
||
TConclusionStatus TUpsertStatOperation::DoDeserialize(NYql::TObjectSettingsImpl::TFeaturesExtractor& features) { | ||
{ | ||
auto fValue = features.Extract("NAME"); | ||
if (!fValue) { | ||
return TConclusionStatus::Fail("can't find alter parameter NAME"); | ||
} | ||
Name = *fValue; | ||
} | ||
TString type; | ||
{ | ||
auto fValue = features.Extract("TYPE"); | ||
if (!fValue) { | ||
return TConclusionStatus::Fail("can't find alter parameter TYPE"); | ||
} | ||
type = *fValue; | ||
} | ||
{ | ||
auto fValue = features.Extract("FEATURES"); | ||
if (!fValue) { | ||
return TConclusionStatus::Fail("can't find alter parameter FEATURES"); | ||
} | ||
if (!Constructor.Initialize(type)) { | ||
return TConclusionStatus::Fail("can't initialize stat constructor object for type \"" + type + "\""); | ||
} | ||
NJson::TJsonValue jsonData; | ||
if (!NJson::ReadJsonFastTree(*fValue, &jsonData)) { | ||
return TConclusionStatus::Fail("incorrect json in request FEATURES parameter"); | ||
} | ||
auto result = Constructor->DeserializeFromJson(jsonData); | ||
if (result.IsFail()) { | ||
return result; | ||
} | ||
} | ||
return TConclusionStatus::Success(); | ||
} | ||
|
||
void TUpsertStatOperation::DoSerializeScheme(NKikimrSchemeOp::TAlterColumnTableSchema& schemaData) const { | ||
auto* proto = schemaData.AddUpsertStatistics(); | ||
proto->SetName(Name); | ||
Constructor.SerializeToProto(*proto); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_stat.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "abstract.h" | ||
#include <ydb/core/tx/columnshard/engines/scheme/statistics/abstract/constructor.h> | ||
|
||
namespace NKikimr::NKqp { | ||
|
||
class TUpsertStatOperation : public ITableStoreOperation { | ||
private: | ||
static TString GetTypeName() { | ||
return "UPSERT_STAT"; | ||
} | ||
|
||
static inline const auto Registrator = TFactory::TRegistrator<TUpsertStatOperation>(GetTypeName()); | ||
private: | ||
TString Name; | ||
NOlap::NStatistics::TConstructorContainer Constructor; | ||
public: | ||
TConclusionStatus DoDeserialize(NYql::TObjectSettingsImpl::TFeaturesExtractor& features) override; | ||
|
||
void DoSerializeScheme(NKikimrSchemeOp::TAlterColumnTableSchema& schemaData) const override; | ||
}; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.