Skip to content

Instantly share code, notes, and snippets.

@jaor
Created April 13, 2016 00:00
Show Gist options
  • Save jaor/1153a4f1b20da283c5a4b155398bf145 to your computer and use it in GitHub Desktop.
Save jaor/1153a4f1b20da283c5a4b155398bf145 to your computer and use it in GitHub Desktop.
(define (make-dataset src-id)
(create-and-wait "dataset" {"source" src-id}))
(define (make-cluster ds-id)
(create-and-wait "cluster" {"dataset" ds-id}))
(define (make-batchcentroid c-id ds-id)
(let (bc-id (create-and-wait "batchcentroid" {"cluster" c-id
"dataset" ds-id
"output_dataset" true
"all_fields" true}))
(get (fetch bc-id) "output_dataset_resource")))
(define (source->batch-centroid src-id)
(let (ds-id (make-dataset src-id)
cl-id (make-cluster ds-id))
(make-batchcentroid cl-id ds-id)))
(define dataset-id (source->batch-centroid source_id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment