Kusto, Can't User gettype() function?

Viewed 15

in kusto (KQL) I'm trying to print type of column in my table so I did:

SamplePowerRequirementHistorizedData
| print gettype(my_column_name)

which failed, so I replaced my_column_name with 5 and it failed too. How may I fix this?

The error message says:

The operator must be the first operator in the query.(KS175)

Which doesn't make sense as I need the table name to be first... (to access its columns)

1 Answers
  1. i believe you intended to use the project operator and not the print operator

  2. given that the type is the same for the entire column, and you don't need to get it per record, you can use the getschema operator instead:

TableName
| getschema
| where ColumnName == "MyColumn"
Related