Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class KustoStreamingIngestClient extends KustoStreamingIngestClientBase {
descriptor.stream,
props.format,
props.ingestionMappingReference ?? null,
undefined,
clientRequestId,
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/azure-kusto-ingest/src/streamingIngestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class KustoStreamingIngestClient extends KustoStreamingIngestClientBase {
compressedStream,
props.format,
props.ingestionMappingReference ?? null,
undefined,
clientRequestId,
);
}
Expand Down
16 changes: 13 additions & 3 deletions packages/azure-kusto-ingest/test/e2eTests/e2eTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
IngestionResult,
} from "azure-kusto-ingest";

import { type AxiosError } from "axios";

Check warning on line 29 in packages/azure-kusto-ingest/test/e2eTests/e2eTest.ts

View workflow job for this annotation

GitHub Actions / build

'AxiosError' is defined but never used

import { sleep } from "../../src/retry.js";

Expand All @@ -38,6 +38,7 @@
import { basename, dirname } from "path";
import sinon from "sinon";
import { fileURLToPath } from "url";
import { BlockBlobClient, ContainerClient } from "@azure/storage-blob";

Check warning on line 41 in packages/azure-kusto-ingest/test/e2eTests/e2eTest.ts

View workflow job for this annotation

GitHub Actions / build

'BlockBlobClient' is defined but never used

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down Expand Up @@ -338,14 +339,23 @@
.filter((i) => i.testOnStreamingIngestion)
.map((i) => {
return { item: i };
}),
})
)("ingestFromBlob_$item.description", async ({ item }) => {
const blobName = uuidv4() + basename(item.path);
const blobUri = await ingestClient.uploadToBlobWithRetry(item.path, blobName);
const result = await dmKustoClient.execute(databaseName, ".show export containers");
const container = result.primaryResults?.[0]?.toJSON<{"StorageRoot": string}>().data[0].StorageRoot;
if (!container) {
assert.fail("Failed to get export containers");
}
const blockBlobClient = (new ContainerClient(container)).getBlockBlobClient(blobName);
const response = await blockBlobClient.uploadFile(item.path);
if (response.errorCode) {
assert.fail(`Failed to upload blob ${JSON.stringify(response)}`);
}

const table = tableNames[("streaming_blob" + "_" + item.description) as Table];
try {
await streamingIngestClient.ingestFromBlob(blobUri, item.ingestionPropertiesCallback(table));
await streamingIngestClient.ingestFromBlob(blockBlobClient.url, item.ingestionPropertiesCallback(table));
} catch (err) {
assert.fail(`Failed to ingest ${item.description} - ${util.format(err)}`);
}
Expand Down
Loading