Calc Magic

Friday Demos · August 18, 2023 · 5:01

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. um I've got two screen um the first of which was is something that um we saw on one of our customers and it was a um it basically a a corner of the planner where we were doing something that we wanted to be able to do but we're unable to actually do in certain levels so in this particular case it was a Omni offset which is not currently supported in SQL in in Snowflake SQL so what we would have to do is issue a sort of two queries in order or rather a query and then re-query that result in order to do that which is a much more complicated plan to execute to sort of the first place where we have sort of a multi-stage

  2. plan um so I can come in here and add a field and for this I'm just going to grab it typing it um users you can see here actually click the add button um SQL got a little more complicated not exactly sure what happened there but the Omnia is in here it is now taking the offset from the previous row I guess the previous pivot um and if we take a look here's the step one that says run on snowflake that result gets pulled in run on Duck DB we then do the Partition by um and we start doing the minimum over and then giving range basically to do that offset so that we can subtract the two and get that that value and while

  3. it it sort of is allowing for sort of us to be more flexible in what kinds of queries we can support and the calculations that we can support on top of a result set um which will be important for things like um I mean it will be important for calcs in general um but it also sort of opens the door for more complicated queries so things like a merge query things like a taking a result set from a CSV and re-querying it and things like that um joining it in ETC um and just sort of begins to open up that conversation a little bit more um the this is basically all happening in the server side re-query there's no reason except for it's not implemented

  4. yet why it couldn't happen on the front end side of re-querying we would just send the original result set down to the client and then the client can do that requirey um so it's really really not um not too different there but it's just an optimization that we could make in the future foreign second is um I got a lot of folks um asking I think because a prospect or a client was interested in um query downloads um so I was just poking around um I was unsuccessful in making this actually look at all nice but doing things like downloading a query adding a limit and going and downloading it it's actually going to take quite a while um for a variety of reasons one

  5. of which is that we're not streaming data through any of these systems so it's um we're not streaming it through the the remix layer yet so it's doing all of that I think I may have actually crashed my browser in this case um so a couple of across the remix layer so there's a couple of things where uh sort of having to continue to do some work here um but it's not huge um definitely something that want to be able to make significantly better in the future so this is probably going to take a little while before this this functionality is fully out there but just sort of getting the pieces rolling so that we could have changing limits and having limits work with SQL

  6. queries and whatnot so that we can successfully download some of these larger result sets and build on top of the work that I was working on last week um which is being able to store these larger result sets while we're passing them around and doing all that um but um obviously there's a there's a little bit more work that needs to happen in order to make this real Johnny is that intended to be a replacement for the existing download CSV button you know I was going to stick it behind a feature flag um or not even merge it yet until we've kind of gone a little bit further I was mostly looking at the sort of what is needed to support this sort of at

  7. all layers and what what does it look like in particular um what we're currently doing is we're taking the entire result set downloading it shoving it into um the sort of remix uh layer turning that into a CSV and sending that down which is fine for smaller result sets but it would be great if we could process it sort of on a row by row basis for the UI it was mostly just um what can I do to stick something in there that potentially worked um right but but so this is roughly the same functionality as the existing download CSV with some additional features like setting a different limit but implemented in a much more scalable way yeah basically I mean it needs to be

  8. implemented in a much more scalable way and it's not fully yet but the sort of uh deep query processing parts