diff options
author | andrew-rykov <arykov@ydb.tech> | 2023-07-11 16:49:05 +0300 |
---|---|---|
committer | andrew-rykov <arykov@ydb.tech> | 2023-07-11 16:49:05 +0300 |
commit | 3b55459e2c33baed82cf68d6a52ad299a35bf491 (patch) | |
tree | 715cd61b512b76ef3506ab87820bcccaa8b70428 | |
parent | 5dedf000fbf44b5a38ab77541dea9599aaa483b8 (diff) | |
download | ydb-3b55459e2c33baed82cf68d6a52ad299a35bf491.tar.gz |
KIKIMR-18399 query handler added syntax param
-rw-r--r-- | ydb/core/viewer/json_query.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ydb/core/viewer/json_query.h b/ydb/core/viewer/json_query.h index 8dab5bb1c0..00405d45ed 100644 --- a/ydb/core/viewer/json_query.h +++ b/ydb/core/viewer/json_query.h @@ -34,6 +34,7 @@ class TJsonQuery : public TActorBootstrapped<TJsonQuery> { TString Action; TString Stats; TString Schema = "classic"; + TString Syntax; public: static constexpr NKikimrServices::TActivity::EType ActorActivityType() { @@ -73,6 +74,7 @@ public: Stats = params.Get("stats"); Action = params.Get("action"); Schema = params.Get("schema"); + Syntax = params.Get("syntax"); if (Schema.empty()) { Schema = "classic"; } @@ -144,6 +146,11 @@ public: if (!Event->Get()->UserToken.empty()) { event->Record.SetUserToken(Event->Get()->UserToken); } + if (Syntax == "yql_v1") { + request.SetSyntax(Ydb::Query::Syntax::SYNTAX_YQL_V1); + } else if (Syntax = "pg") { + request.SetSyntax(Ydb::Query::Syntax::SYNTAX_PG); + } ActorIdToProto(SelfId(), event->Record.MutableRequestActorId()); Send(NKqp::MakeKqpProxyID(SelfId().NodeId()), event.Release()); @@ -414,10 +421,11 @@ struct TJsonRequestParameters<TJsonQuery> { static TString GetParameters() { return R"___([{"name":"ui64","in":"query","description":"return ui64 as number","required":false,"type":"boolean"}, {"name":"query","in":"query","description":"query text","required":true,"type":"string"}, + {"name":"syntax","in":"query","description":"query syntax (yql_v1, pg)","required":false,"type":"string"}, {"name":"database","in":"query","description":"database name","required":false,"type":"string"}, {"name":"schema","in":"query","description":"result format schema (classic, modern, ydb)","required":false,"type":"string"}, {"name":"stats","in":"query","description":"return stats (profile)","required":false,"type":"string"}, - {"name":"action","in":"query","description":"execute method (execute-scan, execute-script, explain, explain-ast, explain-scan, explain-script)","required":false,"type":"string"}, + {"name":"action","in":"query","description":"execute method (execute-scan, execute-script, execute-query, execute-data,explain-ast, explain-scan, explain-script, explain-query, explain-data)","required":false,"type":"string"}, {"name":"timeout","in":"query","description":"timeout in ms","required":false,"type":"integer"}])___"; } }; |