
CSV upload preview
Bring any date you want into the workbook. Now users can mash-up ad hoc data sets with the database - targets, custom enrichment, or even one-off data sets for dashboards. These new data…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
let me grab the mic so I can get out and free up a spot again uh so uh let's say I've got this you know my canonical 200 person user data set in the test data and it's got please oh yeah gota see this uh it's got country State and zip it doesn't have County that's annoying uh this new button that kind of put this button in uh so this a collaboration between me and Kai um I've got random CSP that I found on the internet I upload it gives me a preview with the data there's my CSV it changed the column order we've got to fix that um but there it is it's a view it's got Fields it didn't generate a count field
generate a count field got to fix that um but like I'll leave this tab alone but if I pop over here there got to make a topic for it so topic only users can quar it but got to make the topic special so they don't get locked out lots to do but this right now is it works here so I can do you know whatever um they how many this C so this query for reference like Ori this is even though I'm in a workbook on postgress this query is just running entirely on duct DB on top of the uploaded CSV um but then the important thing right this is a fun toy I can query my CSV data not that interesting what's more interesting
is I can pop over here say I want this County which is what's Z ended up being C here um I did memorize which one this was think you need see1 or maybe this will work anyway I think this works how I write my XB UPS Colin it corrects it for you uh and again random data set I downloaded from the internet no idea why it doesn't have zip code for this but I checked it's not a bug it just doesn't somebody have some of the zip codes uh you know garbage didn't garbage out but the important thing is that the xup worked um just to kind of again Orient yourself like it's right so we've run the main clear on postest and then we
stitch together on dtb um with the kind of just tweaking the way we plan the X lookups um and I mean in theory uh I I don't push my luck but you know this not it's not a toy arbitary thing should continue to work so if I just this probably not going to give me any data at all did I group by state don't remember um something happened uh I think that was bu to count the distinct cities within the state or something uh so right 2x the you can stitch together multiple X lookups into csvs I didn't make multiple X lookups between DB queries and X lookups into the csvs work that needs to be done um Stephen Could you um I I mean
I believe this works but if you go into the camel tab I'm assuming we can just graph that and put it on dashboard too yeah yeah it's just a it's just aary yeah can we share uh the csvs across other workbooks or is it just this one so yeah I mean haven't so there's a lot to do around like the life cycle management of these but um if you oh gosh now I'm in give me the field picker uh so this looks like a normal view except it's got this thing which is read only and it's just a sort of identifier like what was this uploaded as um and I haven't even tried this but there's no reason it wouldn't work so let's try it
um and while this is while happening where does this live right now the CSV uh so it's in S3 so so it's in S3 and we use the same mechanism that we use to load cach result um it's the same deal basically when the planner kicks in and goes oh you plan something with one of these external uploaded tables um let me grab that and stuff it into duct DB for you uh and run the query um but yeah I think that worked so I Popp into promoted that Geo dat it's there that's not interesting I can remake my super interesting distinct City query um and so the thing that needs to happen is there needs to be an admin page listing these and you
need to be able to delete them and that's where it gets a little hairy because it's like if you promoted one how do you kind of say like how do you say it's okay to delete one and then we also need um to do more work work to have the backend know if one then gets deleted because like right now they're just there and the back end just knows the S3 path and can go look them up there needs to be like a validator error if you go then oh I don't want that data to be there I delete it we need to put a validator errror on that view and that's going to take a little bit of management um that even is there
a size limit to that CSV upload right now H yes um so we decided to to kick this off with a uh 50 I mean actually no because I haven't implemented it but there will be there's a there's going to be a 50k row limit so just like uh we'll just basic because the way it works is when you hit that upload button in the UI we actually stick it in duct DB and transform it into Arrow there um and so we'll hit that with a limit 50k uh and say like oh you went over either worn or block but um yeah there's there's no right now we don't yet support arbitrary upload SES thank you hey Stephen uh when you say it's using dtb
I assume that you mean in the browser no on the server oh great yeah yeah yeah yeah it it the the the results have been uploaded to S3 and just like the server side requery cache results um if it behaves in a very very similar way where if we plan a query and then we optimize it and we realize that it needs to requiry some server results that are stored in S3 we pull that down from S3 and put it in duct DB and then run the server side requery on top of that same thing with here like it it needs an external table it's an S3 we pull it down from S3 stuff it in duct DB and run the query on top of
that I was just G to remind that occas we have to disable duct in the browser so glad you hear that it's not running there um do we have all the usual stuff on these like can I add new columns that are you know first character of State put Cals on top of them all that jazz yeah because it's it's all just I mean there there might be some confusion around like dialect what type sequel yeah I was going to say like what there's definitely that that could cause confusion um you know that that would be be a good argument for you know the old Omni SQL uh but yeah so in if you tried to write dialect specific SQL um it's possible the planner
could get confused we could put in code that attempted to like uh to translate some SQL uh as best we could it's duck DB SQL right now what would it be it would be duck dbel um okay it's hard it's hard for me to think of an example post from Duck DB share a lot of functions but can you actually uh open the SQL editor and edit the sequel directly like can I just query this table induct that is almost certainly not going to work but you know let's try it um hey it worked never mind uh the system is solid uh no I mean yeah because it just it made a new field Con cat is it's probably a little confused under Hood about
which dialect concat is running in but it doesn't matter it works from Duck DB that that's a uh that's a more universal one so I think if you stick to universalists Universal is operators uh it'll work um this is sort of an argument though for the the omn SQL stuff especially some of the stuff we talked about in the past where we had like a it's probably pretty close to duct DB SQL but like a really generic SQL language that you could always write in and we will always be able to translate that and also always be able to parch that could be something worth chatting about it's yeah I think I think that tends to be more of an us problem than a customer
problem like if the customer has snowflake they pretty much want to write snowflake sequel yeah um the other thing I was going to say is like step we've been chatting about a f a future step of being able to push down these tables into the customer's Warehouse so like if they're on bigquery push it to bigquery if they're on snowfl which would negate that problem because I in that case they're just writing their dialect sequel anyways and the other thing that will eventually open up uh is also true SQL joins right instead of just X lookups to mash this to other data so that that's like a future future phase that we'll want to do as probably the primary gesture in most cases is best
to push down and the question I had there Stephen um back to like the file size limit in a world where we do push down to Warehouse do you anticipate that we could loosen up those size limits sub stantially yes although that's not primary reason the file size limit exists today it's it's more it's actually more about the upload mechanism yeah doesn't stream makes sense cool um actually had a question on the file size limit um so one thing that's common when like exporting Excel data to CSV is you can end up with a lot of blank rows uh below and so you could end up having you know many Superfluous rows like do we do any kind of CSV truncation before we enforce that
50 50k row limit great question basically what we'll do is we ask we we we put the CSV in the browsers in the browser and then we ask duck DB to query it um and so like whatever duck DB does we will do um so we it's partly why it that's a good argument for maybe starting off with doing a select star limit 50,000 and then rather than failing if you hit 50,000 just putting a little warning like hey we truncated this and if you're like there's not 50,000 rows I don't care then that maybe that's the way to go but it it's a good call out check yeah and and um yeah that totally makes sense like a you know select top 50,000 from
you know from Jack DB and then um are empty cells null or empty strin just out of curiosity you gotta ask duck DB whatever duck DB thinks they are uh they are possibly depends on data type maybe they're empty string for Strings but null for because that dub will detect data types from uh from that the CSV so it's possible that if it thinks it's a number then it has to be null or it's a string maybe it's empty okay but yeah that's that makes perfect sense then that we can just we're inheriting all the defaults from duct d so and it's it's very possible that we could make this configurable that the the dub CSV te process is extremely configurable and I'm sure the
defaults are intelligent and they're supposedly extremely fast as well um but uh you may want to say no actually parse all the stuff as dates or parse all the stuff as strings even though they look like dates etc etc and we you we'll just have to expose the things that are important we want to um and then how are we handling data types here I I'm assuming the answer is the default but how it it's like do we are we just looking at it well du like duct D is just looking at it doing the defaults and then yeah as Johnny says we I think we can there is a lot of fine grain control that you could do by tweaking duct DB settings so
we could expose that for the user but but like for one of these we C like same thing in the data model we could just go in like whatever Duck's cast is and we can turn the string into a time stamp type thing totally totally uh and even yeah and there again the um the uh because the whole system is probably a little confused about what uh dialect it's in but like we do do some translations some things like I bet this will work yeah even though we use the postrest cast syntax we kind of pars it out like it's a cast then we put it back in and it worked um cool huge