DBI_table: DBI methods for Kusto table management

dbReadTable,AzureKustoConnection,character-methodR Documentation

DBI methods for Kusto table management

Description

DBI methods for Kusto table management

Usage

## S4 method for signature 'AzureKustoConnection,character'
dbReadTable(conn, name, ...)

## S4 method for signature 'AzureKustoConnection,ANY'
dbWriteTable(conn, name, value, method, ...)

## S4 method for signature 'AzureKustoConnection'
dbCreateTable(conn, name, fields, ..., row.names = NULL, temporary = FALSE)

## S4 method for signature 'AzureKustoConnection,ANY'
dbRemoveTable(conn, name, ...)

## S4 method for signature 'AzureKustoConnection'
dbListTables(conn, ...)

## S4 method for signature 'AzureKustoConnection,ANY'
dbExistsTable(conn, name, ...)

Arguments

conn

An AzureKustoConnection object.

name

A string containing a table name.

...

Further arguments passed to run_query.

value

For dbWriteTable, a data frame to be written to a Kusto table.

method

For dbWriteTable, the ingestion method to use to write the table. See ingest_local.

fields

For dbCreateTable, the table specification: either a named character vector, or a data frame of sample values.

row.names

For dbCreateTable, the row names. Not used.

temporary

For dbCreateTable, whether to create a temporary table. Must be FALSE for Kusto.

Details

These functions read, write, create and delete a table, list the tables in a Kusto database, and check for table existence. With the exception of dbWriteTable, they ultimately call run_query which does the actual work of communicating with the Kusto server. dbWriteTable calls ingest_local to write the data to the server; note that it only supports ingesting a local data frame, as per the DBI spec.

Kusto does not have the concept of temporary tables, so calling dbCreateTable with temporary set to anything other than FALSE will generate an error.

dbReadTable and dbWriteTable are likely to be of limited use in practical scenarios, since Kusto tables tend to be much larger than available memory.

Value

For dbReadTable, an in-memory data frame containing the table.

See Also

AzureKusto-connection, dbConnect, run_query, ingest_local

Examples

## Not run: 
db <- DBI::dbConnect(AzureKusto(),
    server="https://mycluster.location.kusto.windows.net", database="database"...)

DBI::dbListTables(db)

if(!DBI::dbExistsTable(db, "mtcars"))
    DBI::dbCreateTable(db, "mtcars")

DBI::dbWriteTable(db, "mtcars", mtcars, method="inline")

DBI::dbReadTable(db, "mtcars")

DBI::dbRemoveTable(db, "mtcars")


## End(Not run)

AzureKusto documentation built on Oct. 12, 2023, 5:11 p.m.