Databricks workspace list command to list subdirectories and it's content recursively

Offen
#3,619 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
52/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
go, shell
Bereich
cli

Rechercherichtung

Beginne mit dem Befehl databricks workspace list und untersuche, wie seine aktuelle Ausgabe Workspace-Einträge darstellt. Bestätige das erwartete rekursive Verhalten anhand eines Workspace mit verschachtelten Verzeichnissen und ändere den Befehl anschließend so, dass er jedes Unterverzeichnis und dessen Inhalte auflistet, wobei die vom bestehenden Befehl angezeigten Eintragsdetails erhalten bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

CLI Enhancement

It's not an issue but a feature request may be. We were trying to use Databricks workspace list command to list all content of the folder in the workspace. However, it seems like there is no option to list all subfolders and their contents.

So we used below shell script to achieve the result:

list_recursive() {
local path = "$1"
databricks workspace list "$path" | tail -n +2 | while read id type lang path ; do
    if [[ -z "$path" ]] ; then
        path = "$lang"
        lang = ""
    fi
    echo "ID: $id | Type: $type | Language: $lang | Path: $path"
    if [[ "$type" = = "DIRECTORY" ]] ; then
        list_recursive "$path"
    fi
done
}
for folder in $DATABRICKS_FOLDERS ; do
    path = "$(DATABRICKS_DST_ROOT)/$folder"
    echo "Listing: $path"
    list_recursive "$path"
done
Vorherrschende Sprache
Go
Sterne
427
Forks
267
Ø Merge
2 T. 1 Std.
Gemergte PRs (30 T.)
233

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Hat eine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus databricks/cli

Alle Issues in databricks/cli

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.