aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruzhas <uzhas@ydb.tech>2023-07-17 18:21:32 +0300
committeruzhas <uzhas@ydb.tech>2023-07-17 18:21:32 +0300
commit0e636597924f0fa87bfc61c7f65b572d42e96ed1 (patch)
treedeab2d55a448405bfc17bc72c7c96c6bc7bcb58b
parent54c2702ef9a5f7fcff23ef380009baf2f13c9737 (diff)
downloadydb-0e636597924f0fa87bfc61c7f65b572d42e96ed1.tar.gz
support all types in external tables, switch test_interval_unit to v2
-rw-r--r--ydb/core/kqp/provider/yql_kikimr_exec.cpp5
-rw-r--r--ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp23
2 files changed, 2 insertions, 26 deletions
diff --git a/ydb/core/kqp/provider/yql_kikimr_exec.cpp b/ydb/core/kqp/provider/yql_kikimr_exec.cpp
index e659c7610c..3e8d8fd27d 100644
--- a/ydb/core/kqp/provider/yql_kikimr_exec.cpp
+++ b/ydb/core/kqp/provider/yql_kikimr_exec.cpp
@@ -263,12 +263,11 @@ namespace {
auto type = columnType->Cast<TTypeExprType>()->GetType();
auto notNull = type->GetKind() != ETypeAnnotationKind::Optional;
- auto actualType = notNull ? type : type->Cast<TOptionalExprType>()->GetItemType();
- auto dataType = actualType->Cast<TDataExprType>();
+ auto actualType = RemoveAllOptionals(type);
TKikimrColumnMetadata columnMeta;
columnMeta.Name = columnName;
- columnMeta.Type = dataType->GetName();
+ columnMeta.Type = FormatType(actualType);
columnMeta.NotNull = notNull;
out.ColumnOrder.push_back(columnName);
diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp
index a2daebc882..077cd36ebe 100644
--- a/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp
+++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_external_table.cpp
@@ -60,23 +60,6 @@ bool Validate(const TString& sourceType, const NKikimrSchemeOp::TExternalTableDe
&& ValidateDataSourcePath(desc.GetDataSourcePath(), errStr);
}
-bool IsAllowedType(ui32 typeId) {
- if (!NScheme::NTypeIds::IsYqlType(typeId)) {
- return false;
- }
-
- switch (typeId) {
- case NYql::NProto::Bool:
- case NYql::NProto::Interval:
- case NYql::NProto::Decimal:
- case NYql::NProto::DyNumber:
- return false;
- default:
- break;
- }
- return true;
-}
-
Ydb::Type CreateYdbType(const NScheme::TTypeInfo& typeInfo, bool notNull) {
Ydb::Type ydbType;
if (typeInfo.GetTypeId() == NScheme::NTypeIds::Pg) {
@@ -139,12 +122,6 @@ TExternalTableInfo::TPtr CreateExternalTable(const TString& sourceType, const NK
auto typeName = NMiniKQL::AdaptLegacyYqlType(col.GetType());
const NScheme::IType* type = typeRegistry->GetType(typeName);
- if (!type || !IsAllowedType(type->GetTypeId())) {
- errStr = TStringBuilder()
- << "Type '" << col.GetType() << "' specified for column '" << colName << "' is not supported";
- return nullptr;
- }
-
NScheme::TTypeInfo typeInfo;
if (type) {
// Only allow YQL types