标量数据类型Scalar data types
每个数据值(例如表达式的值或函数的参数)都有一个数据类型。Every data value (such as the value of an expression, or the parameter to a function, or the value of an expression) has a data type. 数据类型为标量数据类型(一种内置的预定义类型,已列在下面)或用户定义的记录(一系列已排序的名称/标量数据类型对,例如表的某个行的数据类型)。A data type is either a scalar data type (one of the built-in predefined types listed below), or a user-defined record (an ordered sequence of name/scalar-data-type pairs, such as the data type of a row of a table).
Kusto 提供一组系统数据类型,这些类型定义了可以与 Kusto 配合使用的所有类型的数据。Kusto supplies a set of system data types that define all the types of data that can be used with Kusto.
备注
Kusto 不支持用户定义的数据类型。User-defined data types are not supported in Kusto.
下表列出了 Kusto 支持的数据类型、其他可以用来引用它们的别名,以及大致等效的 .NET Framework 类型。The following table lists the data types supported by Kusto, alongside additional aliases you can use to refer to them and a roughly equivalent .NET Framework type.
类型Type | 其他名称Additional name(s) | 等效 .NET 类型Equivalent .NET type | gettype()gettype() |
---|---|---|---|
bool |
boolean |
System.Boolean |
int8 |
datetime |
date |
System.DateTime |
datetime |
dynamic |
System.Object |
array 或 dictionary ,或者任何其他值array or dictionary or any of the other values |
|
guid |
uuid , uniqueid uuid , uniqueid |
System.Guid |
guid |
int |
System.Int32 |
int |
|
long |
System.Int64 |
long |
|
real |
double |
System.Double |
real |
string |
System.String |
string |
|
timespan |
time |
System.TimeSpan |
timespan |
decimal |
System.Data.SqlTypes.SqlDecimal |
decimal |
所有非字符串数据类型都包括一个特殊的“null”值,它表示缺少数据或数据不匹配。All non-string data types include a special "null" value, which represents the lack of data or a mismatch of data. 例如,尝试将字符串 "abc"
引入 int
列中会生成此值。For example, attempting to ingest the string "abc"
into an int
column results in this value.
无法以显式方式将此值具体化,但可使用 isnull()
函数来检测某个表达式的求值是否为此值。It isn't possible to materialize this value explicitly, but you can detect whether an expression evaluates to this value by using the isnull()
function.
警告
对 guid
类型的支持尚不完全。Support for the guid
type is incomplete.
强烈建议相关团队改用类型为 string
的值。We strongly recommend that teams use values of type string
instead.