async ingestFromStream()

in packages/azure-kusto-ingest/src/streamingIngestClient.ts [22:47]


    async ingestFromStream(
        stream: StreamDescriptor | Readable | ArrayBuffer,
        ingestionProperties?: IngestionPropertiesInput,
        clientRequestId?: string,
    ): Promise<any> {
        this.ensureOpen();

        const props = this._getMergedProps(ingestionProperties);
        const descriptor: StreamDescriptor = stream instanceof StreamDescriptor ? stream : new StreamDescriptor(stream);

        const compressedStream =
            descriptor.compressionType === CompressionType.None
                ? !(descriptor.stream instanceof ArrayBuffer)
                    ? descriptor.stream.pipe(zlib.createGzip())
                    : descriptor.stream
                : descriptor.stream;
        return await this.kustoClient.executeStreamingIngest(
            props.database as string,
            props.table as string,
            compressedStream,
            props.format,
            props.ingestionMappingReference ?? null,
            undefined,
            clientRequestId,
        );
    }