Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kusto create an in-memory table for testing

Just looking to create a quick in-memory/temp table for testing out queries. I've seen this done before but I'm having trouble finding any examples from a web search or StackOverflow search. I'm looking for something like this:

let TempTable = table("TestTable",
    Column column1 = [1,2,3],
    Column comumn2 = ["A","B","C"]
    );

Result:

resulting table

I don't need to save the table in any database, just want to use for testing & demonstration purposes.

like image 830
SendETHToThisAddress Avatar asked Dec 02 '20 03:12

SendETHToThisAddress


People also ask

What is kusto table?

Kusto Query Language is a powerful tool to explore your data and discover patterns, identify anomalies and outliers, create statistical modeling, and more. The query uses schema entities that are organized in a hierarchy similar to SQL's: databases, tables, and columns.

What is the difference between SQL and KQL?

In SQL, the queries start with the column names and we only get to know about the table name when we reach the “From” statement, whereas, in KQL, the query starts with the table name followed by the pipe character after which the conditions are defined.

What is kusto KQL?

Kusto Query Language (KQL) is a powerful pipeline-driven, read-only query language that enables the queries against the Azure logs to be easier and straightforward. It will look very familiar if you've ever worked with a structured query language (SQL).

Which type of datatype is allowed in kusto?

Conversely, Kusto will parse strings as strongly-typed values if they can be parsed as such. This applies for datetime , real , long , and guid types.


1 Answers

you could use the datatable operator: https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/datatableoperator

for example:

let T = datatable(column1:int, column2:string)
[
   1, "A",
   2, "B",
   3, "C",
];
... do something with T ...
like image 146
Yoni L. Avatar answered Oct 05 '22 14:10

Yoni L.