vogievetsky opened a new pull request, #12919: URL: https://github.com/apache/druid/pull/12919
Do you ever use the web console? Well, be prepared to have your experience elevated! This PR adds functionality to the web console primarily driven by the desire to support the [Multi-stage distributed queries](https://github.com/apache/druid/issues/12262) effort with appropriate UI/UX. This PR needs https://github.com/apache/druid/pull/12918 to work. Here are the high level bits. > Please note: The example data is hosted on [static.imply.io](http://static.imply.io/). Storage space and bandwidth on this server is being donated by Imply as a service to the community. I thought about using [druid.apache.org](http://druid.apache.org/) instead, but that didn't seem like a good place to host larger data files, since the server is designed for website content. ## New query view (WorkbenchView) with tabs and long running query support <img width="1605" alt="image" src="https://user-images.githubusercontent.com/177816/185309077-8840ff85-19a9-4fc0-8398-4f2446ff29b3.png"> The new query lets you execute [multi-stage, task based, queries](https://github.com/apache/druid/issues/12262) via the `/druid/v2/sql/task` and `/druid/indexer/v1/task/*` APIs as well as native and sql-native queries just like the old Query view. A key point of the sql-msq-task based queries is that they may run for a long time. This inspired / necessitated many UX changes including (but not limited to): ### Tabs You can now have many queries stored and running at the same time. In my opinion tabs are a UX game changer <img width="792" alt="image" src="https://user-images.githubusercontent.com/177816/185309114-fe82cccd-a917-415c-a394-a3485403226d.png"> You can, open many tabs, duplicate them, and copy them as text to be pasted into any console and reopened there. ### Progress reports (counter reports) sql-msq-task queries have detailed progress reports and these can be visualized using the summary progress bar, or the in detail execution table that provides summaries of the counters for every step. <img width="1065" alt="image" src="https://user-images.githubusercontent.com/177816/185309244-cba3d640-c48a-49bd-8c72-ed3e842b0cb2.png"> ### Error and warning reports sql-msq-task queries go out of their way to present user friendly warnings and errors should anything go wrong. The new query view has components to visualize these with their full detail including a stack-trace. <img width="727" alt="image" src="https://user-images.githubusercontent.com/177816/185309488-421e7410-251d-4590-88f1-92fb23f4be13.png"> ### Recent query panel Since sql-msq-task queries are tasks is it possible to show queries that are executing currently and that have executed in the recent past. <img width="507" alt="image" src="https://user-images.githubusercontent.com/177816/185309579-e2ce021c-6bf6-4576-bdee-ff552e1c4c3b.png"> For any query in this panel you can view the execution details for it and you can also attach it as a new tab and continue iterating on the query. It is also possible to download the "query detail archive" which is a JSON file containing all the important details for a given query that can be easily shared for troubleshooting. ### Connect external data flow Running SQL-based ingestion queries is all well and good once you have the query, but where do queries come from? The `Connect external data` flow lets you use the sampler to sample your data, determine its schema, and generate a fully formed SQL query that you can edit to your hearts content before clicking `Run`. <img width="1265" alt="image" src="https://user-images.githubusercontent.com/177816/185309631-5ceed7d0-2bb2-43b9-83ed-fdcad4a152be.png"> This point-and-click flow will save you a bunch of typing. ### Preview button The `Preview` button appears when you type in an INSERT or REPLACE SQL query. <img width="268" alt="image" src="https://user-images.githubusercontent.com/177816/185309669-e262d0fc-cdd3-4ae2-a249-f60fefab38ba.png"> When clicked it removes the INSERT or REPLACE clause and executes your query as an "inline" query (with a limit). This lets you get a sense of how your data will be shaped after all the transformations that you coded into the SQL query have been applied. ### Results table The query results table has been improved in style and function. <img width="467" alt="image" src="https://user-images.githubusercontent.com/177816/185309870-50d9a142-495e-498b-981b-3f782da03e29.png"> It now shows you type icons for the column types and supports the ability to manipulate nested columns with ease. ### Helper queries Do you like notebooks? Do you like [CTEs]()? Well now they have some UI affordances in the console. Helper queries are collapsable elements that hold a query that can be referenced from the main query just like they were defined with a WITH statement. <img width="1230" alt="image" src="https://user-images.githubusercontent.com/177816/185309989-68688bbe-d440-4848-baf6-c67d5f528a1c.png"> The idea is that if you are composing a complicated query it is nice to be able to break it down into queries and be able to preview each part on its own. ### Misc tools Along with these features there are also miscellaneous tools available from the `...` menu. <img width="872" alt="image" src="https://user-images.githubusercontent.com/177816/185310070-856956ca-daab-415a-a694-ec72eede2b47.png"> Along these you will find: - Explain query - show the query plan for a sql-native and sql-msq-task query. - Convert ingestion spec to SQL - Helps you migrate your native batch and hadoop based specs to the SQL-based format. - Open query detail archive - lets you open a query detail archive downloaded earlier. - Load demo queries - lets you load a set of pre-made queries to play around with sql-msq-task functionality. ## New SQL-based data loader The data loader exists as a GUI wizard to help users craft a JSON ingestion spec using point and click and quick previews. The SQL data loader is the SQL-based ingestion analog of that. <img width="1754" alt="image" src="https://user-images.githubusercontent.com/177816/185310358-8d4421b0-4429-4ddf-86e1-825bf570e50f.png"> Just like the native based data loader that serves as its inspiration, all the state is stored in the actual SQL query and at any moment the user can opt to manipulate the query directly. What is the difference between the SQL-based data loader and the "Connect external data" flow? They start off exactly the same, they figure out the source and format to use and generate the external. After the external has been defined the "Connect external data" flow generates a seed query that you can then edit as you wish. The key point is that (unless you just want to ingest with the seed query) you must edit a rather complex SQL statement and preview it using the "Preview" functionality that is not sub-second (it reached out to the data for every preview). On the other hand the data loader let's you manipulate the (SQL) ingestion spec completely with point-and-click it also samples the data and lets you preview it using sql-native making the previews sub-second. The SQL data loader limits you to what kind of query you can write, for example you can not currently use it to express a query involving a JOIN, but at any point in time it lets you take your query to the regular que ry view so there is no need to worry about being restricted. <img width="476" alt="image" src="https://user-images.githubusercontent.com/177816/185310417-fa7d3c9d-8013-407d-bfea-66361541b508.png"> Since the SQL-based data loader is batch only and the existing data loader is for streaming (supervisors) and batch data (tasks). The existing data loader has been split up into its streaming and batch components to make the comparison clearer. ## Misc other changes Since the MSQ part is so transformative it drove other parts of the console development as well. ### Header rearrangment Now that the query view has tabs and can do ingestion and data manipulation it is about time it took the helm as the most important view in the header. <img width="1040" alt="image" src="https://user-images.githubusercontent.com/177816/185310493-94513a22-fe2f-4849-ad9d-ea3d80218783.png"> There is now also a more `...` button that can host all the views not important enough to be top level. ### Data preview for both the Datasource and Segment detail modals You can now click on a datasource or segment to see a preview of the data within. <img width="1751" alt="image" src="https://user-images.githubusercontent.com/177816/185310616-9c118136-3882-4009-9f94-ae43e5772c59.png"> ### Task cancel status The task table now explicitly shows if a task has been canceled in a different color than a failed task. <img width="1196" alt="image" src="https://user-images.githubusercontent.com/177816/185310767-0592578d-3e36-46d3-b686-6c13bddf9483.png"> ### Other improvements - Expose the tuning config property `maxColumnsToMerge` for batch ingestion and compaction in the form UI - Fixed docs link URL - Better filtering on all data tables (Datasources, Ingestion, Services, etc) - Made filtering on modules work better in the Status dialog - Added the file `filter` property to all inputSources where it applies - Mixed some confusing labels in the UI - Future proof the `useQueryManager` hook to work with React18 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
