pareshddevalia opened a new pull request, #720:
URL: https://github.com/apache/atlas/pull/720
… attribute in the response changes
Store search attributes in LinkedHashSet so json array order is kept when
building attributes.name and attributes.values. Duplicate attribute names are
deduped using first-occurrence order. Fixes mismatched column order between
request and response for POST /api/atlas/v2/search/basic.
## What changes were proposed in this pull request?
Basic search with excludeHeaderAttributes=true did not preserve the order of
attributes from the client request. For example, a request with "attributes":
["qualifiedName", "createTime"] could return "attributes": { "name":
["createTime", "qualifiedName"], ... }, so column order in attributes.values
did not match the request.
Root cause: SearchParameters.attributes was stored as Set<String>. Jackson
deserialized the JSON array into a HashSet, which does not preserve insertion
order. The response builder copied that set into attributes.name and used the
same iteration order when building each row in attributes.values.
Fix:
Store attributes in a LinkedHashSet in SearchParameters and
QuickSearchParameters
Use @JsonDeserialize(as = LinkedHashSet.class) so JSON deserialization keeps
order
Update relationship search REST API to accept List<String> query params,
which are normalized through the same setter
## How was this patch tested?
Unit tests
Manual testing
Started Atlas with PostgreSQL + Hive using docker compose
Created hive_table entities via Hive
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]