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

Creating entity containing attribute of type set with duplicate values

    XMLWordPrintableJSON

Details

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

    Description

      Creating an entity having an attribute of type set with duplicate values is expected to have only unique values. But duplicate values are retained.

      Example : POSTing [1,2,3,1] stored as [1,2,3,1]. Expected is [1,2,3]

      Repro :
      1. POST the following JSON to /api/atlas/v2/types/typedefs

      {
         "enumDefs":[
      
         ],
         "structDefs":[
      
         ],
         "classificationDefs":[
      
         ],
         "entityDefs":[
            {
               "superTypes":[
      
               ],
               "attributeDefs":[
      {
                     "name":"type_set",
                     "typeName":"array<string>",
                     "isOptional":true,
                     "cardinality":"SET",
                     "valuesMinCount":-1,
                     "valuesMaxCount":-1,
                     "isUnique":false,
                     "isIndexable":false
                  }
      
               ],
               "category":"ENTITY",
               "guid":"kcdnvdsvsdvidnvidsonvosid",
               "createdBy":"USER",
               "updatedBy":"USER",
               "createTime":12345,
               "updateTime":12345,
               "version":12345,
               "name":"simple_entity_type_set",
               "description":"simple_entity_type_set",
               "typeVersion":"0.1"
            }
         ]
      }
      

      2. Create entity of the type

         "referredEntities":{},
         "entity":{
            "typeName":"simple_entity_type_set",
            "attributes":{
               "type_set":["a","a","b"]
            },
            "guid":"-1",
            "status":"ACTIVE",
            "createdBy":"admin",
            "updatedBy":"admin",
            "createTime":1489585008165,
            "updateTime":1489585008801,
            "version":0,
            "classifications":[],
            "superTypes":[]
         }
      }
      

      3. entity is created with value for type_set as [a,a,b] instead of [a,b]

      This is a regression in V1 APIs and seen in V2 APIs too.

      Attachments

        1. ATLAS-2325-branch-0.8.patch
          3 kB
          Madhan Neethiraj
        2. ATLAS-2325.patch
          4 kB
          Madhan Neethiraj

        Issue Links

          Activity

            People

              sarath Sarath Subramanian
              sharmadhas Sharmadha S
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: