@@ -133,6 +133,8 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
133
133
// TODO: check all params;
134
134
135
135
TAutoPtr<NSchemeCache::TSchemeCacheNavigate> request (new NSchemeCache::TSchemeCacheNavigate ());
136
+ request->DatabaseName = CanonizePath (GrpcRequest->GetDatabaseName ().GetOrElse (" " ));
137
+
136
138
NSchemeCache::TSchemeCacheNavigate::TEntry entry;
137
139
entry.Path = NKikimr::SplitPath (table);
138
140
if (entry.Path .empty ()) {
@@ -372,7 +374,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
372
374
TString err;
373
375
374
376
bool filterParsedOk = CellsFromTuple (&filterType, columnValues, typesRef, true , false , cells, err, owner);
375
-
377
+
376
378
if (!filterParsedOk) {
377
379
ReplyWithError (Ydb::StatusIds::BAD_REQUEST, Sprintf (" Invalid filter: '%s'" , err.data ()), ctx);
378
380
return false ;
@@ -545,7 +547,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
545
547
ev->Record .SetPathColumnDelimiter (Request->Getpath_column_delimiter ());
546
548
ev->Record .SetSerializedStartAfterKeySuffix (StartAfterSuffixColumns.GetBuffer ());
547
549
ev->Record .SetMaxKeys (MaxKeys - ContentsRows.size () - CommonPrefixesRows.size ());
548
-
550
+
549
551
if (!CommonPrefixesRows.empty ()) {
550
552
// Next shard might have the same common prefix, need to skip it
551
553
ev->Record .SetLastCommonPrefix (CommonPrefixesRows.back ());
@@ -564,7 +566,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
564
566
565
567
if (!Filter.ColumnIds .empty ()) {
566
568
auto * filter = ev->Record .mutable_filter ();
567
-
569
+
568
570
for (const auto & colId : Filter.ColumnIds ) {
569
571
filter->add_columns (colId);
570
572
}
@@ -624,7 +626,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
624
626
afterLastFolderPrefix.Parse (prefixColumns);
625
627
626
628
auto & partitions = KeyRange->GetPartitions ();
627
-
629
+
628
630
for (CurrentShardIdx++; CurrentShardIdx < partitions.size (); CurrentShardIdx++) {
629
631
auto & partition = KeyRange->GetPartitions ()[CurrentShardIdx];
630
632
@@ -693,7 +695,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
693
695
shardResponse.GetMoreRows ()) {
694
696
if (!FindNextShard ()) {
695
697
ReplySuccess (ctx, (hasMoreShards && shardResponse.GetMoreRows ()) || maxKeysExhausted);
696
- return ;
698
+ return ;
697
699
}
698
700
MakeShardRequest (CurrentShardIdx, ctx);
699
701
} else {
@@ -714,7 +716,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
714
716
return NYdb::TTypeBuilder ().Pg (getPgTypeFromColMeta (colMeta)).Build ();
715
717
case NScheme::NTypeIds::Decimal:
716
718
return NYdb::TTypeBuilder ().Decimal (NYdb::TDecimalType (
717
- typeInfo.GetDecimalType ().GetPrecision (),
719
+ typeInfo.GetDecimalType ().GetPrecision (),
718
720
typeInfo.GetDecimalType ().GetScale ()))
719
721
.Build ();
720
722
default :
@@ -727,7 +729,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
727
729
for (const auto & colMeta : columns) {
728
730
const auto type = getTypeFromColMeta (colMeta);
729
731
auto * col = resultSet.Addcolumns ();
730
-
732
+
731
733
*col->mutable_type ()->mutable_optional_type ()->mutable_item () = NYdb::TProtoAccessor::GetProto (type);
732
734
*col->mutable_name () = colMeta.Name ;
733
735
}
@@ -754,7 +756,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
754
756
Ydb::Value valueProto;
755
757
valueProto.set_low_128 (loHi.first );
756
758
valueProto.set_high_128 (loHi.second );
757
- const NYdb::TDecimalValue decimal (valueProto,
759
+ const NYdb::TDecimalValue decimal (valueProto,
758
760
{static_cast <ui8>(colMeta.PType .GetDecimalType ().GetPrecision ()), static_cast <ui8>(colMeta.PType .GetDecimalType ().GetScale ())});
759
761
vb.Decimal (decimal);
760
762
} else {
@@ -801,10 +803,10 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
801
803
if (CommonPrefixesRows.size () > 0 ) {
802
804
lastDirectory = CommonPrefixesRows[CommonPrefixesRows.size () - 1 ];
803
805
}
804
-
806
+
805
807
if (isTruncated && (lastDirectory || lastFile)) {
806
808
NKikimrTxDataShard::TObjectStorageListingContinuationToken token;
807
-
809
+
808
810
if (lastDirectory > lastFile) {
809
811
token.set_last_path (lastDirectory);
810
812
token.set_is_folder (true );
@@ -814,7 +816,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
814
816
}
815
817
816
818
TString serializedToken = token.SerializeAsString ();
817
-
819
+
818
820
resp->set_next_continuation_token (serializedToken);
819
821
}
820
822
@@ -824,7 +826,7 @@ class TObjectStorageListingRequestGrpc : public TActorBootstrapped<TObjectStorag
824
826
GrpcRequest->RaiseIssue (NYql::ExceptionToIssue (ex));
825
827
GrpcRequest->ReplyWithYdbStatus (Ydb::StatusIds::INTERNAL_ERROR);
826
828
}
827
-
829
+
828
830
Finished = true ;
829
831
Die (ctx);
830
832
}
0 commit comments