Skip to content

Commit 6406f5f

Browse files
commit
1 parent 729914c commit 6406f5f

File tree

1 file changed

+5
-5
lines changed
  • examples/Ydb.Sdk.AdoNet.OpenSearch.ToYDB.Transfer

1 file changed

+5
-5
lines changed

examples/Ydb.Sdk.AdoNet.OpenSearch.ToYDB.Transfer/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
using System.Text.Json.Serialization;
77
using NLog.Extensions.Logging;
88

9-
if (args.Length != 3)
9+
if (args.Length != 4)
1010
{
11-
Console.WriteLine("Usage: Program.exe <YdbConnectionString> <OpenSearchConnectionString> <OpenSearchPassword>");
11+
Console.WriteLine("Usage: Program.exe <YdbConnectionString> <OpenSearchConnectionString> <OpenSearchPassword> <YdbTableName>");
1212

1313
return 1;
1414
}
@@ -29,8 +29,8 @@
2929
await using var ydbDataSource = new YdbDataSource(builder);
3030
await using (var ydbCommand = ydbDataSource.CreateCommand())
3131
{
32-
ydbCommand.CommandText = """
33-
CREATE TABLE IF NOT EXISTS `doc_25_08_28__12_00` (
32+
ydbCommand.CommandText = $"""
33+
CREATE TABLE IF NOT EXISTS `{args[3]}` (
3434
indexId Text NOT NULL,
3535
chunkId Text NOT NULL,
3636
fileId Text NOT NULL,
@@ -112,7 +112,7 @@ async Task WorkerJobSingleIndex(IndexName indexName, YdbConnection ydbConnection
112112
var countResponse = await openSearchClient.CountAsync<Document>(c => c.Index(indexName));
113113
var totalDocuments = countResponse.Count;
114114

115-
var bulkUpsertImporter = ydbConnection.BeginBulkUpsertImport("doc_25_08_28__12_00",
115+
var bulkUpsertImporter = ydbConnection.BeginBulkUpsertImport(args[3],
116116
[
117117
"indexId", "chunkId", "fileId", "folderId", "chunkText", "chunkVector", "createdAt", "createdBy", "updatedAt",
118118
"updatedBy"

0 commit comments

Comments
 (0)