diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-12-02 14:55:03 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-12-02 14:55:03 +0000 |
commit | 3301787707269da1e7b44e909ce54db3b40adcad (patch) | |
tree | 13b1041390dbaeaf7f51d492ef186f6d3e6766d1 /yql/providers/stat/expr_nodes | |
parent | 7cae2d2ae6fe8f179e567a8e85e9d934f42ed6ea (diff) | |
parent | 24211947581091f2f54c8e50e3427e6621dfec3d (diff) | |
download | ydb-3301787707269da1e7b44e909ce54db3b40adcad.tar.gz |
Merge branch 'rightlib' into mergelibs-241202-1453
Diffstat (limited to 'yql/providers/stat/expr_nodes')
-rw-r--r-- | yql/providers/stat/expr_nodes/ya.make | 52 | ||||
-rw-r--r-- | yql/providers/stat/expr_nodes/yql_stat_expr_nodes.cpp | 1 | ||||
-rw-r--r-- | yql/providers/stat/expr_nodes/yql_stat_expr_nodes.h | 67 | ||||
-rw-r--r-- | yql/providers/stat/expr_nodes/yql_stat_expr_nodes.json | 111 |
4 files changed, 231 insertions, 0 deletions
diff --git a/yql/providers/stat/expr_nodes/ya.make b/yql/providers/stat/expr_nodes/ya.make new file mode 100644 index 0000000000..478e92f4d3 --- /dev/null +++ b/yql/providers/stat/expr_nodes/ya.make @@ -0,0 +1,52 @@ +LIBRARY() + +PEERDIR( + yql/essentials/core/expr_nodes + yql/essentials/providers/common/provider +) + +SRCS( + yql_stat_expr_nodes.cpp +) + +SRCDIR( + yql/essentials/core/expr_nodes_gen +) + +IF(EXPORT_CMAKE) + RUN_PYTHON3( + ${ARCADIA_ROOT}/yql/essentials/core/expr_nodes_gen/gen/__main__.py + yql_expr_nodes_gen.jnj + yql_stat_expr_nodes.json + yql_stat_expr_nodes.gen.h + yql_stat_expr_nodes.decl.inl.h + yql_stat_expr_nodes.defs.inl.h + IN yql_expr_nodes_gen.jnj + IN yql_stat_expr_nodes.json + OUT yql_stat_expr_nodes.gen.h + OUT yql_stat_expr_nodes.decl.inl.h + OUT yql_stat_expr_nodes.defs.inl.h + OUTPUT_INCLUDES + ${ARCADIA_ROOT}/yql/essentials/core/expr_nodes_gen/yql_expr_nodes_gen.h + ${ARCADIA_ROOT}/util/generic/hash_set.h + ) +ELSE() + RUN_PROGRAM( + yql/essentials/core/expr_nodes_gen/gen + yql_expr_nodes_gen.jnj + yql_stat_expr_nodes.json + yql_stat_expr_nodes.gen.h + yql_stat_expr_nodes.decl.inl.h + yql_stat_expr_nodes.defs.inl.h + IN yql_expr_nodes_gen.jnj + IN yql_stat_expr_nodes.json + OUT yql_stat_expr_nodes.gen.h + OUT yql_stat_expr_nodes.decl.inl.h + OUT yql_stat_expr_nodes.defs.inl.h + OUTPUT_INCLUDES + ${ARCADIA_ROOT}/yql/essentials/core/expr_nodes_gen/yql_expr_nodes_gen.h + ${ARCADIA_ROOT}/util/generic/hash_set.h + ) +ENDIF() + +END() diff --git a/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.cpp b/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.cpp new file mode 100644 index 0000000000..7520ee7682 --- /dev/null +++ b/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.cpp @@ -0,0 +1 @@ +#include "yql_stat_expr_nodes.h" diff --git a/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.h b/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.h new file mode 100644 index 0000000000..97ca544354 --- /dev/null +++ b/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.h @@ -0,0 +1,67 @@ +#pragma once + +#include <yql/essentials/core/expr_nodes/yql_expr_nodes.h> +#include <yql/essentials/providers/common/provider/yql_provider_names.h> +#include <yql/providers/stat/expr_nodes/yql_stat_expr_nodes.gen.h> + + +namespace NYql { +namespace NNodes { + +#include <yql/providers/stat/expr_nodes/yql_stat_expr_nodes.decl.inl.h> + +class TStatDSource: public NGenerated::TStatDSourceStub<TExprBase, TCallable, TCoAtom> { +public: + explicit TStatDSource(const TExprNode* node) + : TStatDSourceStub {node} + { + } + + explicit TStatDSource(const TExprNode::TPtr& node) + : TStatDSourceStub {node} + { + } + + static bool Match(const TExprNode* node) { + if (!TStatDSourceStub::Match(node)) { + return false; + } + + if (node->Child(0)->Content() != StatProviderName) { + return false; + } + + return true; + } +}; + + +class TStatDSink: public NGenerated::TStatDSinkStub<TExprBase, TCallable, TCoAtom> { +public: + explicit TStatDSink(const TExprNode* node) + : TStatDSinkStub {node} + { + } + + explicit TStatDSink(const TExprNode::TPtr& node) + : TStatDSinkStub {node} + { + } + + static bool Match(const TExprNode* node) { + if (!TStatDSinkStub::Match(node)) { + return false; + } + + if (node->Child(0)->Content() != StatProviderName) { + return false; + } + + return true; + } +}; + +#include <yql/providers/stat/expr_nodes/yql_stat_expr_nodes.defs.inl.h> + +} // namespace NNodes +} // namespace NYql diff --git a/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.json b/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.json new file mode 100644 index 0000000000..2b52d95b78 --- /dev/null +++ b/yql/providers/stat/expr_nodes/yql_stat_expr_nodes.json @@ -0,0 +1,111 @@ +{ + "NodeRootType": "TExprBase", + "NodeBuilderBase": "TNodeBuilderBase", + "ListBuilderBase": "TListBuilderBase", + "FreeArgCallableBase": "TFreeArgCallable", + "FreeArgBuilderBase": "TFreeArgCallableBuilderBase", + "Nodes": [ + { + "Name": "TStatDSource", + "Base": "TCallable", + "Definition": "Custom", + "Builder": {"Generate": "None"}, + "Match": {"Type": "Callable", "Name": "DataSource"}, + "Children": [ + {"Index": 0, "Name": "Category", "Type": "TCoAtom"}, + {"Index": 1, "Name": "Cluster", "Type": "TCoAtom"} + ] + }, + { + "Name": "TStatDSink", + "Base": "TCallable", + "Definition": "Custom", + "Builder": {"Generate": "None"}, + "Match": {"Type": "Callable", "Name": "DataSink"}, + "Children": [ + {"Index": 0, "Name": "Category", "Type": "TCoAtom"}, + {"Index": 1, "Name": "Cluster", "Type": "TCoAtom"} + ] + }, + { + "Name": "TStatRead", + "Base": "TFreeArgCallable", + "Match": {"Type": "Callable", "Name": "Read!"}, + "Children": [ + {"Index": 0, "Name": "World", "Type": "TExprBase"}, + {"Index": 1, "Name": "DataSource", "Type": "TStatDSource"} + ] + }, + { + "Name": "TStatWrite", + "Base": "TFreeArgCallable", + "Match": {"Type": "Callable", "Name": "Write!"}, + "Children": [ + {"Index": 0, "Name": "World", "Type": "TExprBase"}, + {"Index": 1, "Name": "DataSink", "Type": "TStatDSink"} + ] + }, + { + "Name": "TStatNamedSettingsBase", + "VarArgBase": "TCoNameValueTuple", + "Builder": {"Generate": "None"} + }, + { + "Name": "TStatFields", + "Base": "TStatNamedSettingsBase", + "Match": {"Type": "Callable", "Name": "StatFields"} + }, + { + "Name": "TStatMeta", + "Base": "TStatNamedSettingsBase", + "Match": {"Type": "Callable", "Name": "StatMeta"} + }, + { + "Name": "TStatTable", + "Base": "TCallable", + "Match": {"Type": "Callable", "Name": "StatTable"}, + "Children": [ + {"Index": 0, "Name": "Name", "Type": "TCoAtom"}, + {"Index": 1, "Name": "Scale", "Type": "TCoAtom"}, + {"Index": 2, "Name": "Cluster", "Type": "TCoAtom"}, + {"Index": 3, "Name": "Fields", "Type": "TExprBase"}, + {"Index": 4, "Name": "Meta", "Type": "TExprBase"} + ] + }, + { + "Name": "TStatReadTableScheme", + "Base": "TFreeArgCallable", + "Match": {"Type": "Callable", "Name": "StatReadTableScheme!"}, + "Children": [ + {"Index": 0, "Name": "World", "Type": "TExprBase"}, + {"Index": 1, "Name": "DataSource", "Type": "TStatDSource"}, + {"Index": 2, "Name": "Table", "Type": "TStatTable"}, + {"Index": 3, "Name": "Settings", "Type": "TCoNameValueTupleList"} + ] + }, + { + "Name": "TStatWriteTable", + "Base": "TCallable", + "Match": {"Type": "Callable", "Name": "StatWriteTable!"}, + "Children": [ + {"Index": 0, "Name": "World", "Type": "TExprBase"}, + {"Index": 1, "Name": "DataSink", "Type": "TStatDSink"}, + {"Index": 2, "Name": "Input", "Type": "TExprBase"}, + {"Index": 3, "Name": "Table", "Type": "TStatTable"}, + {"Index": 4, "Name": "ReplaceMask", "Type": "TCoAtomList"}, + {"Index": 5, "Name": "Settings", "Type": "TCoNameValueTupleList"} + ] + }, + { + "Name": "TStatPublish", + "Base": "TCallable", + "Match": {"Type": "Callable", "Name": "StatPublish!"}, + "Children": [ + {"Index": 0, "Name": "World", "Type": "TExprBase"}, + {"Index": 1, "Name": "DataSink", "Type": "TStatDSink"}, + {"Index": 2, "Name": "Input", "Type": "TExprBase"}, + {"Index": 3, "Name": "Table", "Type": "TStatTable"} + ] + } + ] +} |