datatable 运算符datatable operator

返回一个表,在查询本身中定义其架构和值。Returns a table whose schema and values are defined in the query itself.

备注

此运算符没有管道输入。This operator doesn't have a pipeline input.

语法Syntax

datatable ( ColumnName : ColumnType [, ...] ) [ ScalarValue [, ScalarValue ...] ]datatable ( ColumnName : ColumnType [, ...] ) [ ScalarValue [, ScalarValue ...] ]

参数Arguments

  • ColumnName、ColumnType:这些参数定义表的架构。ColumnName, ColumnType: These arguments define the schema of the table. 参数使用的语法与定义表时使用的语法相同。The arguments use the same syntax as used when defining a table. 有关详细信息,请参阅 .create tableFor more information, see .create table).
  • ScalarValue:要插入到表中的常数标量值。ScalarValue: A constant scalar value to insert into the table. 值数必须是表中列的整数倍。The number of values must be an integer multiple of the columns in the table. 第 n 个值的类型必须与列 n % NumColumns 相对应。The n'th value must have a type that corresponds to column n % NumColumns.
  • ColumnName、ColumnType:这些参数定义表的架构。ColumnName, ColumnType: These arguments define the schema of the table.
  • ScalarValue:要插入到表中的常数标量值。ScalarValue: A constant scalar value to insert into the table. 值数必须是表中列的整数倍。The number of values must be an integer multiple of the columns in the table. 第 n 个值的类型必须与列 n % NumColumns 相对应。The n'th value must have a type that corresponds to column n % NumColumns.

返回Returns

此运算符返回给定架构和数据的数据表。This operator returns a data table of the given schema and data.

示例Example

datatable (Date:datetime, Event:string)
    [datetime(1910-06-11), "Born",
     datetime(1930-01-01), "Enters Ecole Navale",
     datetime(1953-01-01), "Published first book",
     datetime(1997-06-25), "Died"]
| where strlen(Event) > 4