Skip to content

Commit 71e39db

Browse files
Revert "add pg types to TQueryPlan (#828)" (#850)
This reverts commit 3c0bb78.
1 parent 791e95e commit 71e39db

File tree

5 files changed

+13
-35
lines changed

5 files changed

+13
-35
lines changed

ydb/core/kqp/opt/kqp_query_plan.cpp

+10-16
Original file line numberDiff line numberDiff line change
@@ -515,23 +515,17 @@ class TxPlanSerializer {
515515
}
516516

517517
TString DescribeValue(const NKikimr::NClient::TValue& value) {
518-
if (value.GetType().GetKind() == NKikimrMiniKQL::ETypeKind::Data) {
519-
auto str = value.GetDataText();
520-
switch (value.GetType().GetData().GetScheme()) {
521-
case NScheme::NTypeIds::Utf8:
522-
case NScheme::NTypeIds::Json:
523-
case NScheme::NTypeIds::String:
524-
case NScheme::NTypeIds::String4k:
525-
case NScheme::NTypeIds::String2m:
526-
return "«" + str + "»";
527-
default:
528-
return str;
529-
}
530-
}
531-
if (value.GetType().GetKind() == NKikimrMiniKQL::ETypeKind::Pg) {
532-
return value.GetPgText();
518+
auto str = value.GetDataText();
519+
switch (value.GetType().GetData().GetScheme()) {
520+
case NScheme::NTypeIds::Utf8:
521+
case NScheme::NTypeIds::Json:
522+
case NScheme::NTypeIds::String:
523+
case NScheme::NTypeIds::String4k:
524+
case NScheme::NTypeIds::String2m:
525+
return "«" + str + "»";
526+
default:
527+
return str;
533528
}
534-
Y_ENSURE(false, TStringBuilder() << "unexpected NKikimrMiniKQL::ETypeKind: " << ETypeKind_Name(value.GetType().GetKind()));
535529
}
536530

537531
void Visit(const TKqpReadRangesSourceSettings& sourceSettings, TQueryPlanNode& planNode) {

ydb/core/kqp/ut/opt/kqp_not_null_ut.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1653,6 +1653,8 @@ Y_UNIT_TEST_SUITE(KqpNotNullColumns) {
16531653
}
16541654
}
16551655

1656+
#if 0
1657+
// TODO: fix TxPlanSerializer with PG keys
16561658
Y_UNIT_TEST(SecondaryIndexWithNotNullDataColumnPg) {
16571659
auto settings = TKikimrSettings()
16581660
.SetWithSampleTables(false)
@@ -1757,7 +1759,7 @@ Y_UNIT_TEST_SUITE(KqpNotNullColumns) {
17571759
result.GetIssues().ToString());
17581760
}
17591761
}
1760-
1762+
#endif
17611763

17621764
Y_UNIT_TEST_TWIN(JoinBothTablesWithNotNullPk, StreamLookup) {
17631765
NKikimrConfig::TAppConfig appConfig;

ydb/public/lib/value/value.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "value.h"
22

33
#include <ydb/library/yql/public/decimal/yql_decimal.h>
4-
#include <ydb/library/yql/parser/pg_wrapper/interface/type_desc.h>
54

65
#include <library/cpp/string_utils/base64/base64.h>
76

@@ -433,20 +432,6 @@ TString TValue::GetDataText() const {
433432
return TStringBuilder() << "\"<unknown type " << Type.GetData().GetScheme() << ">\"";
434433
}
435434

436-
TString TValue::GetPgText() const {
437-
Y_ASSERT(Type.GetKind() == NKikimrMiniKQL::ETypeKind::Pg);
438-
if (Value.HasNullFlagValue()) {
439-
return TString("null");
440-
}
441-
if (Value.HasText()) {
442-
return Value.GetText();
443-
}
444-
auto pgType = Type.GetPg();
445-
auto convertResult = NPg::PgNativeTextFromNativeBinary(Value.GetBytes(), NPg::TypeDescFromPgTypeId(pgType.Getoid()));
446-
Y_ENSURE(!convertResult.Error, convertResult.Error);
447-
return convertResult.Str;
448-
}
449-
450435
template <> TString TValue::GetTypeText<TFormatCxx>(const TFormatCxx& format) const {
451436
switch(Type.GetKind()) {
452437
case NKikimrMiniKQL::ETypeKind::Void:

ydb/public/lib/value/value.h

-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class TValue {
8989
NScheme::TTypeId GetDataType() const;
9090
// gets text representation of simple 'Data' types
9191
TString GetDataText() const;
92-
// gets text representation of 'Pg' types
93-
TString GetPgText() const;
9492
// returns text representation of value's type
9593
template <typename Format> TString GetTypeText(const Format& format = Format()) const;
9694
// returns text representation of value itself

ydb/public/lib/value/ya.make

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ PEERDIR(
99
library/cpp/string_utils/base64
1010
ydb/core/protos
1111
ydb/library/mkql_proto/protos
12-
ydb/library/yql/parser/pg_wrapper/interface
1312
ydb/public/lib/scheme_types
1413
ydb/public/sdk/cpp/client/ydb_value
1514
)

0 commit comments

Comments
 (0)