Uploaded image for project: 'Atlas'
  1. Atlas
  2. ATLAS-1874

V2 DSL search query does not support for count() but v1 do.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.8.1
    • 0.8.1, 1.0.0
    • atlas-core
    • None

    Description

      v1 DSL query supports count()

      curl -u admin:admin 'http://ctr-e133-1493418528701-113468-01-000002.hwx.site:21000/api/atlas/discovery/search/dsl?query=hive_table%20where%20db.name%3D%22default%22%20select%20count()%20as%20%27count%27' | python -m json.tool
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100   537    0   537    0     0    339      0 --:--:--  0:00:01 --:--:--   339
      {
          "count": 1,
          "dataType": {
              "attributeDefinitions": [
                  {
                      "dataTypeName": "long",
                      "isComposite": false,
                      "isIndexable": false,
                      "isUnique": false,
                      "multiplicity": {
                          "isUnique": false,
                          "lower": 0,
                          "upper": 1
                      },
                      "name": "count",
                      "reverseAttributeName": null
                  }
              ],
              "typeDescription": null,
              "typeName": "__tempQueryResultStruct286",
              "typeVersion": "1.0"
          },
          "query": "hive_table where db.name=\"default\" select count() as 'count'",
          "queryType": "dsl",
          "requestId": "pool-2-thread-9 - 47389e3f-bbf1-4209-8e50-8a3235a7e5a9",
          "results": [
              {
                  "$typeName$": "__tempQueryResultStruct286",
                  "count": 68
              }
          ]
      }
      

      v2 DSL search query does not

      curl -u admin:admin 'http://ctr-e133-1493418528701-113468-01-000002.hwx.site:21000/api/atlas/v2/search/dsl?limit=25&excludeDeletedEntities=true&query=where+db.name%3D%22default%22+select+count()+as+%27count%27&typeName=hive_table&_=1497434602692' | python -m json.tool
      {
          "queryText": "`hive_table` where db.name=\"default\" select count() as 'count'",
          "queryType": "DSL"
      }
      

      From the initial analysis, it seems like, V2 API response does not have the count attribute which is cause for this failure. might want to consider adding the count in V2?

      Attachments

        Activity

          People

            apoorvnaik Apoorv Naik
            ayubpathan Ayub Pathan
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: