| 1 |
# Copyright (c) Microsoft Corporation. |
| 2 |
# Licensed under the MIT License |
| 3 |
from enum import Enum |
| 4 |
|
| 5 |
|
| 6 |
class IngestionMappingKind(Enum): |
| 7 |
CSV = "Csv" |
| 8 |
JSON = "Json" |
| 9 |
AVRO = "Avro" |
| 10 |
APACHEAVRO = "ApacheAvro" |
| 11 |
PARQUET = "Parquet" |
| 12 |
SSTREAM = "SStream" |
| 13 |
ORC = "Orc" |
| 14 |
W3CLOGFILE = "W3CLogFile" |
| 15 |
UNKNOWN = "Unknown" |
| 16 |
|
| 17 |
|
| 18 |
class DataFormat(Enum): |
| 19 |
"""All data formats supported by Kusto.""" |
| 20 |
|
| 21 |
CSV = ("csv", IngestionMappingKind.CSV, True) |
| 22 |
TSV = ("tsv", IngestionMappingKind.CSV, True) |
| 23 |
SCSV = ("scsv", IngestionMappingKind.CSV, True) |
| 24 |
SOHSV = ("sohsv", IngestionMappingKind.CSV, True) |
| 25 |
PSV = ("psv", IngestionMappingKind.CSV, True) |
| 26 |
TXT = ("txt", IngestionMappingKind.CSV, True) |
| 27 |
TSVE = ("tsve", IngestionMappingKind.CSV, True) |
| 28 |
JSON = ("json", IngestionMappingKind.JSON, True) |
| 29 |
SINGLEJSON = ("singlejson", IngestionMappingKind.JSON, True) |
| 30 |
MULTIJSON = ("multijson", IngestionMappingKind.JSON, True) |
| 31 |
AVRO = ("avro", IngestionMappingKind.AVRO, False) |
| 32 |
APACHEAVRO = ("apacheavro", IngestionMappingKind.APACHEAVRO, False) |
| 33 |
PARQUET = ("parquet", IngestionMappingKind.PARQUET, False) |
| 34 |
SSTREAM = ("sstream", IngestionMappingKind.SSTREAM, False) |
| 35 |
ORC = ("orc", IngestionMappingKind.ORC, False) |
| 36 |
RAW = ("raw", IngestionMappingKind.CSV, True) |
| 37 |
W3CLOGFILE = ("w3clogfile", IngestionMappingKind.W3CLOGFILE, True) |
| 38 |
|
| 39 |
def __init__(self, kusto_value: str, ingestion_mapping_kind: IngestionMappingKind, compressible: bool): |
| 40 |
self.kusto_value = kusto_value # Formatted how Kusto Service expects it |
| 41 |
self.ingestion_mapping_kind = ingestion_mapping_kind |
| 42 |
self.compressible = compressible # Binary formats should not be compressed |