facet 运算符facet operator

返回一组表(每个指定列一个表)。Returns a set of tables, one for each specified column. 每个表指定其列所采用的值的列表。Each table specifies the list of values taken by its column. 可以使用 with 子句创建附加表。An additional table can be created by using the with clause.


T | facet by ColumnName [, ...] [with ( filterPipe )T | facet by ColumnName [, ...] [with ( filterPipe )


  • ColumnName:输入中的列的名称(要汇总为输出表)。ColumnName: The name of column in the input, to be summarized as an output table.
  • filterPipe:一个查询表达式,应用于输入表以生成一个输出。filterPipe: A query expression applied to the input table to produce one of the outputs.


多个表:with 子句对应一个表,每个列对应一个表。Multiple tables: one for the with clause, and one for each column.


| facet by city, eventType 
    with (where timestamp > ago(7d) | take 1000)