Geni will automatically detect whether the following optional dependencies are present:
[com.google.api-client/google-api-client "1.30.9"]
[com.google.apis/google-api-services-drive "v3-rev197-1.25.0"]
[com.google.apis/google-api-services-sheets "v4-rev612-1.25.0"]
[com.google.oauth-client/google-oauth-client-jetty "1.30.6"]
[org.apache.hadoop/hadoop-client "2.7.3"]
If so, the vars g/read-sheets!
and g/write-sheets!
will be bound to the appropriate functions. Otherwise, the vars will remain unbound.
Note that the additional Hadoop dependency is required to prevent a Guava compatibility conflict between Spark and Google APIs. For a potential fix without downgrading Hadoop client, see here.
In order to read and write from Google Sheets, we need to ensure that we have the following:
"Sheet1"
.With that in mind, the following snippets write and read from a particular sheet on a spreadsheet:
(let [google-props {:credentials "{path-to-api-key}"
:spreadsheet-id "{gsheet-spreadsheet-id}"
:sheet-name "{sheet-name}"}
options {:header false}]
(g/read-sheets! spark google-props options)
(g/write-sheets! dataframe google-props options))
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close