Ejemplo n.º 1
0
INGESTION_PROPERTIES = IngestionProperties(database="database name",
                                           table="table name",
                                           dataFormat=DataFormat.csv)

INGEST_CLIENT = KustoIngestClient(
    "https://ingest-<clustername>.kusto.windows.net")

KCSB = KustoConnectionStringBuilder.with_aad_application_key_authentication(
    "https://ingest-<clustername>.kusto.windows.net", "aad app id", "secret")
INGEST_CLIENT = KustoIngestClient(KCSB)

FILE_DESCRIPTOR = FileDescriptor(
    "E:\\filePath.csv", 3333)  # 3333 is the raw size of the data in bytes.
INGEST_CLIENT.ingest_from_multiple_files(
    [FILE_DESCRIPTOR],
    delete_sources_on_success=True,
    ingestion_properties=INGESTION_PROPERTIES)

INGEST_CLIENT.ingest_from_multiple_files(
    ["E:\\filePath.csv"],
    delete_sources_on_success=True,
    ingestion_properties=INGESTION_PROPERTIES)

BLOB_DESCRIPTOR = BlobDescriptor(
    "https://path-to-blob.csv.gz?sas",
    10)  # 10 is the raw size of the data in bytes.
INGEST_CLIENT.ingest_from_multiple_blobs(
    [BLOB_DESCRIPTOR],
    delete_sources_on_success=True,
    ingestion_properties=INGESTION_PROPERTIES)
Ejemplo n.º 2
0
ingestion_properties = IngestionProperties(database="database name",
                                           table="table name",
                                           dataFormat=DataFormat.csv)

ingest_client = KustoIngestClient(
    "https://ingest-<clustername>.kusto.windows.net")
ingest_client = KustoIngestClient(
    "https://ingest-<clustername>.kusto.windows.net",
    client_id="aad app id",
    client_secret="secret")

file_descriptor = FileDescriptor(
    "E:\\filePath.csv", 3333)  # 3333 is the raw size of the data in bytes.
ingest_client.ingest_from_multiple_files(
    [file_descriptor],
    delete_sources_on_success=True,
    ingestion_properties=ingestion_properties)

ingest_client.ingest_from_multiple_files(
    ["E:\\filePath.csv"],
    delete_sources_on_success=True,
    ingestion_properties=ingestion_properties)

blob_descriptor = BlobDescriptor(
    "https://path-to-blob.csv.gz?sas",
    10)  # 10 is the raw size of the data in bytes.
ingest_client.ingest_from_multiple_blobs(
    [blob_descriptor],
    delete_sources_on_success=True,
    ingestion_properties=ingestion_properties)