如何添加多个德鲁伊过滤器

时间:2018-08-02 00:27:17

标签: druid

例如,我有以下Druid查询:

"filter": {
    "type": "and",
    "fields": [
      {
        "type": "selector",
        "dimension": "city",
        "value": "landon"
      },
      {
        "type": "selector",
        "dimension": "name",
        "value": "Tom"
      }
    ]
  }

现在我想添加一个NOT字段,我应该在哪里插入它? 映射SQL如: 从“用户”中选择*,其中city ='landon'并命名为“ Tom”和标题<>“ teacher”。

1 个答案:

答案 0 :(得分:3)

我得到的答案如下:

"filter": {
    "type": "and",
    "fields": [
      {
        "type": "selector",
        "dimension": "city",
        "value": "landon"
      },
      {
        "type": "selector",
        "dimension": "name",
        "value": "Tom"
      },
      {
        "field": {
          "type": "selector",
          "dimension": "title",
          "value": "teacher"
        },
        "type": "not"
      }
    ]
  }