> On Jan. 9, 2018, 2:43 p.m., Sarath Subramanian wrote:
> > intg/src/main/java/org/apache/atlas/v1/model/discovery/DSLSearchResult.java
> > Lines 48 (patched)
> > <https://reviews.apache.org/r/65037/diff/1/?file=1936312#file1936312line48>
> >
> >     'results' format for tag search on v1 dsl is different (includes 
> > 'instanceInfo' and 'traitDetails') and not always list of Referenceables. 
> > Please review.
> >     
> >     e.g: 
> >     http://localhost:21000/api/atlas/discovery/search/dsl?query=`PII`
> >     
> >     {
> >         "requestId": "pool-2-thread-9 - 
> > a6448c2d-1b08-423c-bffc-e2584edf7f74",
> >         "query": "`PII`",
> >         "queryType": "dsl",
> >         "count": 2,
> >         "results": [
> >             {
> >                 "$typeName$": "__tempQueryResultStruct1",
> >                 "instanceInfo": {
> >                     "$typeName$": "__IdType",
> >                     "guid": "9b29d7ef-ac2a-487f-aa2b-b47056e62731",
> >                     "state": "ACTIVE",
> >                     "typeName": "hive_column",
> >                     "version": 0
> >                 },
> >                 "traitDetails": null
> >             },
> >             {
> >                 "$typeName$": "__tempQueryResultStruct1",
> >                 "instanceInfo": {
> >                     "$typeName$": "__IdType",
> >                     "guid": "08180454-4938-45e8-a202-d52111500d65",
> >                     "state": "ACTIVE",
> >                     "typeName": "hive_column",
> >                     "version": 0
> >                 },
> >                 "traitDetails": null
> >             }
> >         ],
> >         "dataType": {
> >             "typeName": "__tempQueryResultStruct1",
> >             "typeDescription": null,
> >             "typeVersion": "1.0",
> >             "attributeDefinitions": [
> >                 {
> >                     "name": "traitDetails",
> >                     "dataTypeName": "PII",
> >                     "multiplicity": {
> >                         "lower": 0,
> >                         "upper": 1,
> >                         "isUnique": false
> >                     },
> >                     "isComposite": false,
> >                     "isUnique": false,
> >                     "isIndexable": false,
> >                     "reverseAttributeName": null
> >                 },
> >                 {
> >                     "name": "instanceInfo",
> >                     "dataTypeName": "__IdType",
> >                     "multiplicity": {
> >                         "lower": 0,
> >                         "upper": 1,
> >                         "isUnique": false
> >                     },
> >                     "isComposite": false,
> >                     "isUnique": false,
> >                     "isIndexable": false,
> >                     "reverseAttributeName": null
> >                 }
> >             ]
> >         }
> >     }

Good catch Sarath! Earlier DSL used a 'temporary struct' to serialize results 
for the following cases:
- the query is for a classification
- the query has a select clause

In such cases, the reponse includes the type-defintion of the 'temporary 
struct' as well. I think this adds unnecessary complications in parsing of the 
response. Having a single response format for all variations will make it 
easier to parse the response. I would suggest to go with a single response 
format, as done in this patch.


- Madhan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65037/#review195035
-----------------------------------------------------------


On Jan. 9, 2018, 8:09 a.m., Madhan Neethiraj wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65037/
> -----------------------------------------------------------
> 
> (Updated Jan. 9, 2018, 8:09 a.m.)
> 
> 
> Review request for atlas.
> 
> 
> Bugs: ATLAS-2347
>     https://issues.apache.org/jira/browse/ATLAS-2347
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> Updated serialization of V1 search API response to be consistent with earlier 
> verion of Atlas
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/utils/AtlasJson.java a82b7ba9 
>   intg/src/main/java/org/apache/atlas/v1/model/discovery/DSLSearchResult.java 
> PRE-CREATION 
>   
> intg/src/main/java/org/apache/atlas/v1/model/discovery/FullTextSearchResult.java
>  PRE-CREATION 
>   
> webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java
>  252cc0e7 
> 
> 
> Diff: https://reviews.apache.org/r/65037/diff/1/
> 
> 
> Testing
> -------
> 
> - verified that the response is consistent with Atlas from branch-0.8
> 
> 
> Thanks,
> 
> Madhan Neethiraj
> 
>

Reply via email to