Skip to content

cosmotech.coal.azure.adx.query

query

run_command_query(client, database, query)

Execute a command query on the database.

Args: client: The KustoClient to use database: The name of the database query: The query to execute

Returns: KustoResponseDataSet: The results of the query

Source code in cosmotech/coal/azure/adx/query.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
def run_command_query(client: KustoClient, database: str, query: str) -> KustoResponseDataSet:
    """
    Execute a command query on the database.

    Args:
        client: The KustoClient to use
        database: The name of the database
        query: The query to execute

    Returns:
        KustoResponseDataSet: The results of the query
    """
    LOGGER.debug(T("coal.services.adx.running_command").format(database=database, query=query))

    result = client.execute_mgmt(database, query)
    LOGGER.debug(T("coal.services.adx.command_complete"))

    return result

run_query(client, database, query)

Execute a simple query on the database.

Args: client: The KustoClient to use database: The name of the database query: The query to execute

Returns: KustoResponseDataSet: The results of the query

Source code in cosmotech/coal/azure/adx/query.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def run_query(client: KustoClient, database: str, query: str) -> KustoResponseDataSet:
    """
    Execute a simple query on the database.

    Args:
        client: The KustoClient to use
        database: The name of the database
        query: The query to execute

    Returns:
        KustoResponseDataSet: The results of the query
    """
    LOGGER.debug(T("coal.services.adx.running_query").format(database=database, query=query))

    result = client.execute(database, query)
    LOGGER.debug(
        T("coal.services.adx.query_complete").format(
            rows=len(result.primary_results[0]) if result.primary_results else 0
        )
    )

    return result