Project

General

Profile

Actions

Feature #8501

open

[SDKs] Add client-side join switches to `arv foo list`

Added by Joshua Randall about 8 years ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
SDKs
Target version:
Story points:
-
Release:
Release relationship:
Auto

Description

It is possible to do client-side joins using the CLI, but it is very cumbersome, and is hard to write efficiently.

This is especially useful when dealing with links (as one rarely cares about the link itself, but rather wants to know something about the entities that are linked), but I think support should be generic and not specific to links.

For example, one might want to lookup collections having a particular tag and give the collection name and owner information. Today, one can accomplish this using the CLI using numerous invocations to `arv get` and `jq`:

$ for collection_uuid in $(arv link list -f '[["link_class","=","tag"],["head_kind","=","arvados#collection"],["name","=","my_favorite_tag"]]' -s '["head_uuid"]' | jq -r '.items[].head_uuid'); do collection_name=$(arv get "${collection_uuid}" | jq -r '.name') && collection_owner_uuid=$(arv get "${collection_uuid}" | jq -r '.owner_uuid') && owner_name=$(arv get "${collection_owner_uuid}" | jq -r '.name') && owner_kind=$(arv get "${collection_owner_uuid}" | jq -r '.kind') && echo "${collection_owner_uuid} "'{"collection_name":"'${collection_name}'","owner_name":"'${owner_name}'","owner_kind":"'${owner_kind}'"}'; done

One way this could be made simpler would be by adding a "join" option for `arv foo list` along with having extended syntax for select and filter options that allow one to refer to columns namespaced to be within the joined objects.

An example of how an invocation might look:

arv link list -s '["collection.name", "owner.name", "owner.kind"]' -j '{"collection":"head_uuid","owner":"collection.owner_uuid"}' -f '[["link_class","=","tag"],["head_kind","=","arvados#collection"],["name","=","my_favorite_tag"]]'

Actions #1

Updated by Brett Smith about 8 years ago

  • Subject changed from `arv foo list` client-side joins to [SDKs] Add client-side join switches to `arv foo list`
Actions #2

Updated by Brett Smith about 8 years ago

  • Target version set to Arvados Future Sprints
Actions #3

Updated by Ward Vandewege almost 3 years ago

  • Target version deleted (Arvados Future Sprints)
Actions #4

Updated by Peter Amstutz about 1 year ago

  • Release set to 60
Actions #5

Updated by Peter Amstutz about 2 months ago

  • Target version set to Future
Actions

Also available in: Atom PDF