@@ -399,8 +399,8 @@ class TPgTableContent : public TMutableComputationNode<TPgTableContent> {
399399 ApplyFillers (AllPgTablesFillers, Y_ARRAY_SIZE (AllPgTablesFillers), PgTablesFillers_);
400400 } else if (Table_ == " pg_roles" ) {
401401 static const std::pair<const char *, TPgRolesFiller> AllPgRolesFillers[] = {
402- {" rolname" , [](ui32 index) {
403- return PointerDatumToPod ((Datum)MakeFixedString (index == 1 ? " postgres" : *PGGetGUCSetting (" ydb_user" ), NAMEDATALEN));
402+ {" rolname" , [](ui32 index) {
403+ return PointerDatumToPod ((Datum)MakeFixedString (index == 1 ? " postgres" : *PGGetGUCSetting (" ydb_user" ), NAMEDATALEN));
404404 }},
405405 {" oid" , [](ui32) { return ScalarDatumToPod (ObjectIdGetDatum (1 )); }},
406406 {" rolbypassrls" , [](ui32) { return ScalarDatumToPod (BoolGetDatum (true )); }},
@@ -489,7 +489,7 @@ class TPgTableContent : public TMutableComputationNode<TPgTableContent> {
489489 };
490490
491491 ApplyFillers (AllPgLanguageFillers, Y_ARRAY_SIZE (AllPgLanguageFillers), PgLanguageFillers_);
492- }
492+ }
493493 } else {
494494 if (Table_ == " tables" ) {
495495 static const std::pair<const char *, TTablesFiller> AllTablesFillers[] = {
@@ -799,7 +799,7 @@ class TPgTableContent : public TMutableComputationNode<TPgTableContent> {
799799 });
800800
801801 for (const auto & t : tables) {
802- const ui32 amOid = (t.Kind == NPg::ERelKind::Relation) ? btreeAmOid : 0 ;
802+ const ui32 amOid = (t.Kind == NPg::ERelKind::Relation) ? btreeAmOid : 0 ;
803803 NUdf::TUnboxedValue* items;
804804 auto row = compCtx.HolderFactory .CreateDirectArrayHolder (PgClassFillers_.size (), items);
805805 for (ui32 i = 0 ; i < PgClassFillers_.size (); ++i) {
@@ -1168,7 +1168,7 @@ class TPgResolvedCallBase : public TMutableComputationNode<TDerived> {
11681168 const TVector<TType*> ArgTypes;
11691169 const TStructType* StructType;
11701170 TVector<NPg::TTypeDesc> ArgDesc;
1171-
1171+
11721172 TPgArgsExprBuilder ArgsExprBuilder;
11731173};
11741174
@@ -1312,7 +1312,7 @@ class TPgResolvedMultiCall : public TPgResolvedCallBase<TPgResolvedMultiCall> {
13121312
13131313 rsInfo.expectedDesc = BlessTupleDesc (rsInfo.expectedDesc );
13141314 }
1315-
1315+
13161316 TupleSlot = MakeSingleTupleTableSlot (rsInfo.expectedDesc , &TTSOpsMinimalTuple);
13171317 for (ui32 i = 0 ; i < args.size (); ++i) {
13181318 const auto & value = args[i];
@@ -1383,7 +1383,7 @@ class TPgResolvedMultiCall : public TPgResolvedCallBase<TPgResolvedMultiCall> {
13831383 FinishAndFree ();
13841384 return false ;
13851385 }
1386-
1386+
13871387 slot_getallattrs (TupleSlot);
13881388 if (RetTypeDesc.TypeId == RECORDOID) {
13891389 if (StructType) {
@@ -2003,7 +2003,7 @@ NUdf::TUnboxedValuePod ConvertToPgValue(NUdf::TUnboxedValuePod value, TMaybe<NUd
20032003 auto res = Timestamp2Pg (value.Get <ui64>());
20042004 return ScalarDatumToPod (res);
20052005 }
2006- case NUdf::EDataSlot::Interval:
2006+ case NUdf::EDataSlot::Interval:
20072007 case NUdf::EDataSlot::Interval64: {
20082008 auto res = Interval2Pg (value.Get <i64 >());
20092009 return PointerDatumToPod (PointerGetDatum (res));
@@ -2244,7 +2244,7 @@ class TToPg : public TMutableComputationNode<TToPg<Slot>> {
22442244
22452245 if constexpr (Slot == NUdf::EDataSlot::Decimal) {
22462246 auto decimalType = static_cast <TDataDecimalType*>(ArgType);
2247- return PointerDatumToPod (NumericGetDatum (DecimalToPgNumeric (value,
2247+ return PointerDatumToPod (NumericGetDatum (DecimalToPgNumeric (value,
22482248 decimalType->GetParams ().first , decimalType->GetParams ().second )));
22492249 } else {
22502250 return ConvertToPgValue<Slot>(value);
@@ -2941,7 +2941,7 @@ struct TToPgExec {
29412941 *res = builder.Build (true );
29422942 break ;
29432943 }
2944- case NUdf::EDataSlot::Json:
2944+ case NUdf::EDataSlot::Json:
29452945 {
29462946 NUdf::TStringBlockReader<arrow::BinaryType, true > reader;
29472947 NUdf::TStringArrayBuilder<arrow::BinaryType, true > builder (NKikimr::NMiniKQL::TTypeInfoHelper (), arrow::binary (), *ctx->memory_pool (), length);
@@ -2964,7 +2964,7 @@ struct TToPgExec {
29642964 *res = builder.Build (true );
29652965 break ;
29662966 }
2967- case NUdf::EDataSlot::JsonDocument:
2967+ case NUdf::EDataSlot::JsonDocument:
29682968 {
29692969 NUdf::TStringBlockReader<arrow::BinaryType, true > reader;
29702970 NUdf::TStringArrayBuilder<arrow::BinaryType, true > builder (NKikimr::NMiniKQL::TTypeInfoHelper (), arrow::binary (), *ctx->memory_pool (), length);
@@ -2985,7 +2985,7 @@ struct TToPgExec {
29852985
29862986 *res = builder.Build (true );
29872987 break ;
2988- }
2988+ }
29892989 default :
29902990 ythrow yexception () << " Unsupported type: " << NUdf::GetDataTypeInfo (SourceDataSlot).Name ;
29912991 }
@@ -4013,16 +4013,26 @@ arrow::Datum MakePgScalar(NKikimr::NMiniKQL::TPgType* type, const NUdf::TBlockIt
40134013 );
40144014}
40154015
4016- TMaybe< ui32> ConvertToPgType (NUdf::EDataSlot slot) {
4016+ ui32 ConvertToPgType (NUdf::EDataSlot slot) {
40174017 switch (slot) {
40184018 case NUdf::EDataSlot::Bool:
40194019 return BOOLOID;
4020+ case NUdf::EDataSlot::Int8:
4021+ return INT2OID;
4022+ case NUdf::EDataSlot::Uint8:
4023+ return INT2OID;
40204024 case NUdf::EDataSlot::Int16:
40214025 return INT2OID;
4026+ case NUdf::EDataSlot::Uint16:
4027+ return INT4OID;
40224028 case NUdf::EDataSlot::Int32:
40234029 return INT4OID;
4030+ case NUdf::EDataSlot::Uint32:
4031+ return INT8OID;
40244032 case NUdf::EDataSlot::Int64:
40254033 return INT8OID;
4034+ case NUdf::EDataSlot::Uint64:
4035+ return NUMERICOID;
40264036 case NUdf::EDataSlot::Float:
40274037 return FLOAT4OID;
40284038 case NUdf::EDataSlot::Double:
@@ -4031,8 +4041,40 @@ TMaybe<ui32> ConvertToPgType(NUdf::EDataSlot slot) {
40314041 return BYTEAOID;
40324042 case NUdf::EDataSlot::Utf8:
40334043 return TEXTOID;
4034- default :
4035- return Nothing ();
4044+ case NUdf::EDataSlot::Yson:
4045+ return BYTEAOID;
4046+ case NUdf::EDataSlot::Json:
4047+ return JSONOID;
4048+ case NUdf::EDataSlot::Uuid:
4049+ return UUIDOID;
4050+ case NUdf::EDataSlot::Date:
4051+ return DATEOID;
4052+ case NUdf::EDataSlot::Datetime:
4053+ return TIMESTAMPOID;
4054+ case NUdf::EDataSlot::Timestamp:
4055+ return TIMESTAMPOID;
4056+ case NUdf::EDataSlot::Interval:
4057+ return INTERVALOID;
4058+ case NUdf::EDataSlot::TzDate:
4059+ return TEXTOID;
4060+ case NUdf::EDataSlot::TzDatetime:
4061+ return TEXTOID;
4062+ case NUdf::EDataSlot::TzTimestamp:
4063+ return TEXTOID;
4064+ case NUdf::EDataSlot::Decimal:
4065+ return NUMERICOID;
4066+ case NUdf::EDataSlot::DyNumber:
4067+ return NUMERICOID;
4068+ case NUdf::EDataSlot::JsonDocument:
4069+ return JSONBOID;
4070+ case NUdf::EDataSlot::Date32:
4071+ return DATEOID;
4072+ case NUdf::EDataSlot::Datetime64:
4073+ return TIMESTAMPOID;
4074+ case NUdf::EDataSlot::Timestamp64:
4075+ return TIMESTAMPOID;
4076+ case NUdf::EDataSlot::Interval64:
4077+ return INTERVALOID;
40364078 }
40374079}
40384080
@@ -4053,7 +4095,15 @@ TMaybe<NUdf::EDataSlot> ConvertFromPgType(ui32 typeId) {
40534095 case BYTEAOID:
40544096 return NUdf::EDataSlot::String;
40554097 case TEXTOID:
4098+ case VARCHAROID:
4099+ case CSTRINGOID:
40564100 return NUdf::EDataSlot::Utf8;
4101+ case DATEOID:
4102+ return NUdf::EDataSlot::Date32;
4103+ case TIMESTAMPOID:
4104+ return NUdf::EDataSlot::Timestamp64;
4105+ case UUIDOID:
4106+ return NUdf::EDataSlot::Uuid;
40574107 }
40584108
40594109 return Nothing ();
0 commit comments