Uploaded image for project: 'Kylin'
  1. Kylin
  2. KYLIN-5832

Add API to determine whether the query hits the index

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.0.0
    • Others
    • None

    Description

      Add a new API to determine if a query hits an index. This API has the following functions.

      1. Determine whether the model is hit or not.
      2. Determine if there is data in the segment.

      API : POST http://host:port/kylin/api/query/detection

      Param Datatype Required
      project string True
      sql string  
      True
       
      limit int False
      offset int False

      Sample

      curl --location 'http://host:port/kylin/api/query/detection' \
      --header 'Accept: application/vnd.apache.kylin-v4-public+json' \
      --header 'Accept-Language: cn' \
      --header 'Content-Type: application/json;charset=UTF-8' \
      --data '{
          "project": "project_ch",
          "sql": "SELECT LO_PARTKEY, SUM(LO_REVENUE) AS TOTAL_REVENUE\nFROM SSB.P_LINEORDER\nWHERE LO_ORDERDATE between '\''19920101'\'' AND '\''19970803'\'' \ngroup by LO_PARTKEY\norder by SUM(LO_REVENUE) DESC\nLIMIT 500"
      }' 

      Response

      Param Datatype
      code string
      data object
      is_exception boolean
      exception_message string
      query_id string
      is_push_down
       
      boolean
      is_post_aggregation
       
      boolean
      is_table_index
       
      boolean
      is_base_index
       
      boolean
      is_cache boolean
      is_constants boolean
      realizations
       
      object[]
      model_id string
      model_alias string
      layout_id int
      index_type string
      partial_match_model boolean
      valid boolean
      is_table_index
       
      boolean
      is_base_index
       
      boolean

      Sample

      {
          "code": "000",
          "data": {
              "is_exception": false,
              "exception_message": null,
              "query_id": "0ef8d8f2-c234-8211-f841-5b3db61ba217",
              "is_push_down": false,
              "is_post_aggregation": true,
              "is_table_index": false,
              "is_base_index": true,
              "is_cache": false,
              "is_constants": false,
              "realizations": [
                  {
                      "model_id": "aa7d0eab-6f72-3b02-019f-9f2fc84a0ecb",
                      "model_alias": "AUTO_MODEL_P_LINEORDER_1",
                      "layout_id": 1,
                      "index_type": "Agg Index",
                      "partial_match_model": false,
                      "valid": true,
                      "is_table_index": false,
                      "is_base_index": true
                  }
              ]
          },
          "msg": ""
      } 

      Attachments

        Activity

          People

            Jueyi Zhimin Wu
            Jueyi Zhimin Wu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: