atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damian Warszawski (Jira)" <j...@apache.org>
Subject [jira] [Updated] (ATLAS-3776) graph query fails when orderBy attribute is specified
Date Fri, 01 May 2020 22:06:00 GMT

     [ https://issues.apache.org/jira/browse/ATLAS-3776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Damian Warszawski updated ATLAS-3776:
-------------------------------------
    Description: 
EntitySearchProcessor fails when doing search by classification and specify orderBy attribute.
The issue is that for graph query you cannot refer to attribute by name but need to provide
absolute path to entity attribute e.g. 

 

```

{ "attributes": [ "description", "comment", "popularityScore" ], "classification": "customer_NON_PII",
"excludeDeletedEntities": "False", "limit": "", "offset": 100, "sortBy": "Table.popularityScore",
"sortOrder": "DESCENDING", "typeName": "hive_table" }

```

this query fails with following exception:

 

```

{"exception":{"message":"Provided key does not exist: Table.popularityScore","class":"java.lang.IllegalArgumentException","stacktrace":"java.lang.IllegalArgumentException:
Provided key does not exist: hive_table.popularityScore\n\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:163)\n\tat
org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder.
 orderBy(GraphCentricQueryBuilder.java:160)

```

 

When specify full reference to attribute e.g. 

 

```

{ "attributes": [ "description", "comment", "popularityScore" ], "classification": "customer_NON_PII",
"excludeDeletedEntities": "False", "limit": "", "offset": 100, "sortBy": "Table.popularityScore",
"sortOrder": "DESCENDING", "typeName": "hive_table" }

```

it fails on validation stage

 

```

{"exception":{"message":"Attribute Table.popularityScore not found for type Table","class":"org.apache.atlas.exception.AtlasBaseException","stacktrace":"org.apache.atlas.exception.AtlasBaseException:
Attribute Table.popularityScore not found for type Table\n\tat org.apache.atlas.discovery.SearchContext.validateAttributes(SearchContext.java:288)

```

workaround is provided as a patch.

  was:
EntitySearchProcessor fails when doing search by classification and specify orderBy attribute.
The issue is that for graph query you cannot refer to attribute by name but need to provide
absolute path to entity attribute e.g. 

 

```

{
 "attributes": [
 "description",
 "comment",
 "popularityScore"
 ],
 "classification": "customer_NON_PII",
 "excludeDeletedEntities": "False",
 "limit": "",
 "offset": 100,
 "sortBy": "Table.popularityScore",
 "sortOrder": "DESCENDING",
 "typeName": "hive_table"
}

```

this query fails with following exception:

 

```

{"exception":{"message":"Provided key does not exist: hive_table.popularityScore","class":"java.lang.IllegalArgumentException","stacktrace":"java.lang.IllegalArgumentException:
Provided key does not exist: hive_table.popularityScore\n\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:163)\n\tat
org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder.
orderBy(GraphCentricQueryBuilder.java:160)

```

 

When specify full reference to attribute e.g. 

 

```

{
 "attributes": [
 "description",
 "comment",
 "popularityScore"
 ],
 "classification": "customer_NON_PII",
 "excludeDeletedEntities": "False",
 "limit": "",
 "offset": 100,
 "sortBy": "Table.popularityScore",
 "sortOrder": "DESCENDING",
 "typeName": "hive_table"
}

```

it fails on validation stage

 

```

{"exception":{"message":"Attribute Table.popularityScore not found for type Table","class":"org.apache.atlas.exception.AtlasBaseException","stacktrace":"org.apache.atlas.exception.AtlasBaseException:
Attribute Table.popularityScore not found for type Table\n\tat org.apache.atlas.discovery.SearchContext.validateAttributes(SearchContext.java:288)

```

workaround is provided as a patch.


> graph query fails when orderBy attribute is specified
> -----------------------------------------------------
>
>                 Key: ATLAS-3776
>                 URL: https://issues.apache.org/jira/browse/ATLAS-3776
>             Project: Atlas
>          Issue Type: Bug
>          Components:  atlas-core
>    Affects Versions: 3.0.0
>            Reporter: Damian Warszawski
>            Priority: Minor
>
> EntitySearchProcessor fails when doing search by classification and specify orderBy attribute.
The issue is that for graph query you cannot refer to attribute by name but need to provide
absolute path to entity attribute e.g. 
>  
> ```
> { "attributes": [ "description", "comment", "popularityScore" ], "classification": "customer_NON_PII",
"excludeDeletedEntities": "False", "limit": "", "offset": 100, "sortBy": "Table.popularityScore",
"sortOrder": "DESCENDING", "typeName": "hive_table" }
> ```
> this query fails with following exception:
>  
> ```
> {"exception":{"message":"Provided key does not exist: Table.popularityScore","class":"java.lang.IllegalArgumentException","stacktrace":"java.lang.IllegalArgumentException:
Provided key does not exist: hive_table.popularityScore\n\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:163)\n\tat
org.janusgraph.graphdb.query.graph.GraphCentricQueryBuilder.
>  orderBy(GraphCentricQueryBuilder.java:160)
> ```
>  
> When specify full reference to attribute e.g. 
>  
> ```
> { "attributes": [ "description", "comment", "popularityScore" ], "classification": "customer_NON_PII",
"excludeDeletedEntities": "False", "limit": "", "offset": 100, "sortBy": "Table.popularityScore",
"sortOrder": "DESCENDING", "typeName": "hive_table" }
> ```
> it fails on validation stage
>  
> ```
> {"exception":{"message":"Attribute Table.popularityScore not found for type Table","class":"org.apache.atlas.exception.AtlasBaseException","stacktrace":"org.apache.atlas.exception.AtlasBaseException:
Attribute Table.popularityScore not found for type Table\n\tat org.apache.atlas.discovery.SearchContext.validateAttributes(SearchContext.java:288)
> ```
> workaround is provided as a patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message