库斯托接收客户
azure-kusto-ingest的Python项目详细描述
fromazure.kusto.data.requestimportKustoConnectionStringBuilderfromazure.kusto.ingestimportKustoIngestClient,IngestionProperties,FileDescriptor,BlobDescriptor,DataFormatingestion_props=IngestionProperties(database="{database_name}",table="{table_name}",dataFormat=DataFormat.csv)client=KustoIngestClient("https://ingest-{cluster_name}.kusto.windows.net")file_descriptor=FileDescriptor("{filename}.csv",3333)# 3333 is the raw size of the data in bytes.client.ingest_from_file(file_descriptor,ingestion_properties=ingestion_props)client.ingest_from_file("{filename}.csv",ingestion_properties=ingestion_props)blob_descriptor=BlobDescriptor("https://{path_to_blob}.csv.gz?sas",10)# 10 is the raw size of the data in bytes.client.ingest_from_blob(blob_descriptor,ingestion_properties=ingestion_props)
概述
kusto python摄取客户端库提供使用python将数据摄取到kusto集群的功能。 它与Python2.x/3.x兼容,并通过熟悉的PythonDBAPI接口支持数据类型。
例如,可以使用附加到火花团的Jupyter Notebooks库, 包括但不限于Azure Databricks实例。