mozilla / redash

This is a Mozilla fork of the re:dash project (https://redash.io/), where we do work to be contributed back to the upstream project and for our own custom needs.
BSD 2-Clause "Simplified" License
21 stars 21 forks source link

Enhancement Request: Data Samples in the Schema Viewer #376

Open fbertsch opened 6 years ago

fbertsch commented 6 years ago

User story: Writing queries often works with data of not necessarily known exact types. For example, a string date could be YYYYMMDD, or YYYY-MM-DD. A long timestamp could be seconds, milliseconds, or nanoseconds since the epoch.

Generally I have to do a quick SELECT * on some recent data and keep that open in a new window when writing queries. This would reduce that burden.

It would be nice to have them be some recent data, but it's not clear to me that re:dash will always know how to find which data is recent and which is not. For the very least we can select a few rows from the most recent dates in all of the telemetry datasets partitioned by submission_date_s3.

jezdez commented 6 years ago

I'm wondering if this just is another perspective on #372? Either way this is a non-trivial departure of the UI that Redash provides and working on that feature in the upstream repo is more likely to be successful long term.

@arikfr Wasn't that something you mentioned as well in our last talk?

fbertsch commented 6 years ago

@jezdez I would consider this very different from #372. That issue is more for understanding the data sources, this is for understanding the tables. It does seem like something that could be useful upstream!

arikfr commented 6 years ago

Having a better schema browser is something I wanted to have for a long time... What I had in mind:

I thought of having dedicated pages for the extended schema browser, but maybe we can figure out a way to have it in the query editor?

emtwo commented 6 years ago

Taking a first pass at a couple of these ideas. Though I could really use some help with design! @kocsmy @arikfr

screen shot 2018-10-17 at 11 29 33 am screen shot 2018-10-17 at 11 34 41 am screen shot 2018-10-17 at 11 29 11 am
emtwo commented 6 years ago

A couple other thoughts/questions I had:

Perhaps we can use the bottom area where visualization tabs are made and have an additional tab there where query samples could go?

@arikfr For your 3rd point about selecting schema viewer tables and descriptions, I guess this would be additional info that an admin can add to a data source?

arikfr commented 6 years ago

How about we use an icon to indicate the column type?

As for showing data example on hover: that's interesting! Maybe use something like Ant's Popover? We can later extend it to show more rich information.

Also we can have a similar popover on the table name to show full row example.

arikfr commented 6 years ago

For your 3rd point about selecting schema viewer tables and descriptions, I guess this would be additional info that an admin can add to a data source?

Yes. Maybe on the data source page. Instead of showing configuration editor like we do today, show information about the data source along with schema and option around the schema.

arikfr commented 6 years ago

Perhaps we can use the bottom area where visualization tabs are made and have an additional tab there where query samples could go?

Query samples?

emtwo commented 6 years ago

Perhaps we can use the bottom area where visualization tabs are made and have an additional tab there where query samples could go?

Query samples?

The info I added in hover text there is what I meant by "query samples". It sounds like they might be ok as hover text for now. But once the admin adds a variety of other metadata, such as table description, where can we show that to the user? Maybe in brackets next to the table name? Though it's getting a little crammed in that schema viewer! heh XD

emtwo commented 6 years ago

An example of Loggly showing sample query data under visualizations ^

2018-10-17 12 50 30

kocsmy commented 6 years ago

How about we use an icon to indicate the column type?

Hm, not sure if we can find icons that indicates those types properly.

I'm not sure what's the best solution here right now.

arikfr commented 6 years ago

Hm, not sure if we can find icons that indicates those types properly.

I don't think we need an icon for "character varying" and a different one for "text". We need icons for the human types: number, string, date, etc.

arikfr commented 6 years ago

Maybe instead of showing it in the visualization area, we will use a Drawer? (see the Drawer that opens from the bottom)