This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The top level request | |
GetRelevantTimeseriesData('3000000004') | |
//Creates a function to joins data from SQL, ADT and ADX | |
.create-or-alter function with (folder = "Analytics/IoT", skipvalidation = "true") GetRelevantTimeseriesData(purchaseOrder:string) { | |
let productionOrder = GetProductionOrderData(purchaseOrder); | |
let plantID = toscalar (productionOrder | project tostring(Plant_Code)); | |
let lineID = toscalar (productionOrder | project tostring(Mfg_Line)); | |
let productionDate = toscalar (productionOrder | project todatetime(Date)); | |
let startDate = productionDate - 24h; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LightIngest.exe "https://ingest-<clusterName>.<region>.kusto.windows.net/;Fed=True" -database:"<databaseName>" -table:"tableName" -source:"https://<storageAccountName>.blob.core.windows.net/<containerName><sasToken>" -format:"parquet" -prefix:"<folderPrefix>" -pattern:"*.parquet" -ingestionMappingRef:"<mappingName" -creationTimePattern:"day='yyyyMMdd'/" -dontWait:true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let telemetryData = datatable (deviceid: string, ts: datetime, latitude: real, longitude: real) [ | |
"alice",datetime(2022-11-07T23:11:19Z),real(47.6423771),real(-122.1267281), | |
"alice",datetime(2022-11-07T23:11:20Z),real(47.6424771),real(-122.1277281), | |
"alice",datetime(2022-11-07T23:11:21Z),real(47.6425771),real(-122.1287281), | |
"bob",datetime(2022-11-07T23:11:19Z),real(47.6424771),real(-122.1287281), | |
"bob",datetime(2022-11-07T23:11:20Z),real(47.6424771),real(-122.1287281), | |
"carol",datetime(2022-11-07T23:11:22Z),real(47.6423771),real(-122.1267281), | |
"carol",datetime(2022-11-07T23:11:22Z),real(47.6523771),real(-122.1267281), | |
"carol",datetime(2022-11-07T23:11:24Z),real(47.6623771),real(-122.1267281), | |
"dave",datetime(2022-11-07T23:11:24Z),real(47.644205),real(-122.1412026), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.create-or-alter function with (skipvalidation = "true") VisualizeGraphPlotly( | |
E:(sourceId:long,targetId:long), N:(nodeId:long), | |
pLayout:string="spring_layout", pColorscale:string="Picnic", pTitle:string="Happy kraphing!") { | |
let pythonCodeBlueprint = ``` | |
import numpy as np | |
import pandas as pd | |
import plotly.graph_objects as go | |
import networkx as nx | |
G = nx.Graph() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"clusters": [ | |
{ | |
"subscription_id": "sid", | |
"resource_group_name": "kusto-workload", | |
"cluster_name": "adx-in-vnet" | |
}, | |
{ | |
"subscription_id": "sid", | |
"resource_group_name": "kusto-workload", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let jakh = "Just another Kusto hacker"; | |
let base = range skip from 0 to strlen(jakh) step 1 | |
| extend jakhString = jakh | |
| extend ['char'] = substring(jakh, skip, 1) | |
| project-away jakhString | |
| project ['char'], id = strcat(['char'], skip) | |
| serialize; | |
let nodes = base | |
| where isnotempty( next(id)); | |
base |
OlderNewer