Which data types do we have
By Gianni Castaldi
Welcome to the third blog post in the series becoming a Kusto Knight. While the previous blog post was about where we store data in Kusto, this blog post will be about the possible data types of data stored in the tables and columns. Like SQL each column has its type and in Kusto we have 10 types.
Booleans can be true or false, and in the database, they are stored as 1 or 0.
Datetime is a value between 1-01-1T00:00 and 9999-12-31T23:59:59 and Microsoft strongly recommends this format (ISO 8601). When we subtract 2 dates the data type gets changed from datetime to timespan. Besides ISO8601 we can also use RFC 822 and RFC850.
Timespans are intervals and contain an amount of time. When we divide a timespan the data type gets changed from timespan to real.
Reals are 64-bit double-precision floating-point numbers.
Ints are 32-bit wide integers.
Longs are 64-bit wide integers.
Decimals are 128-bit wide integers.
Strings are UTF-8 encoded and are limited to 1MB. They must be enclosed in single quotes (‘), or double quotes (“). When we use the backslash (\) character we can escape it with another backslash. Another way to make sure the string is not escaped we can use the @-sign.
Dynamics can take any of the other data types and are also limited to 1MB.
GUIDs can contain unique identifiers, but do not have an index. Microsoft recommends using strings instead of GUIDs.
Nulls are a special value that can exist in all values except strings, and are used to return a non existing value.
In this blog post we read about the data types, and one of the most important data types is the datetime data type. You can read more about it in the next blog post.
And for some exercises on data types go to the Kusto Gym