Create lookml and write back to looker from R

lookml
low_priority
done
reply
api
#1

I am relatively new to Looker and have a specific use case.

Our Looker instance sits on top of snowflake (sf). I access all my data directly connecting to sf, bypassing looker. However, I would like to be able to write back my results (from R) to looker ( /sf ).

How can I do so? How can I write my R output back into looker/sf programmatically? I have across this video, but I would like to see some examples. https://info.looker.com/youtube-join-2017/join-2017-integrating-with-python-and-r

Thank you.

0 Likes

The Podium — April 1, 2019
(Ben Silverstein) #2

This article might help. I’m guessing that using the Snowpipe API to post to the insertFiles endpoint should get you where you want to be, unless I’m misunderstanding your goal. Hope this works for you! As an aside, I think an easy writeback approach is going to be important in Looker’s future to finish that ‘actions to insight’ strategy and make it a reality :slight_smile:

https://docs.snowflake.net/manuals/user-guide/data-load-snowpipe-rest-apis.html#endpoint-insertfiles

0 Likes

(Max Corbin) #3

Hey first of all, welcome the Looker community! I’m happy to talk a little bit about what would be required here.

Looker is really, really good at acting as a single source of truth for data consumers, but at the moment it doesn’t support any kind of feedback that would write back to your database. In fact, if Snowflake is set up using our recommended steps, it’s likely that Looker doesn’t even have permissions to write to Snowflake.

You’re probably using something like dplyr or RJDBC to access Snowflake, right? Writing back to the database using these tools is probably your best bet. I have seen some folks who use the Looker API to query data and then write back to their database using ODBC, for example to write back the results of their regression or their machine learning classification. This can be useful because querying becomes very easy and you benefit from all the data clean-up and transformation that happens in Looker’s modeling layer, but some people are more comfortable using ODBC for both reading and writing.

Let me know if you have any questions or if I got something wrong about your original post, and welcome again!

1 Like