Skip to content

Web console: Page downloader, and fix JSON error resetting#14712

Merged
vogievetsky merged 7 commits intoapache:masterfrom
vogievetsky:page_downloader
Aug 1, 2023
Merged

Web console: Page downloader, and fix JSON error resetting#14712
vogievetsky merged 7 commits intoapache:masterfrom
vogievetsky:page_downloader

Conversation

@vogievetsky
Copy link
Copy Markdown
Contributor

Added ability download pages of results from the new async APIs:

image

Also fixed the issue where a JSON error might cause the Next button to stay disabled if there is a json error while typing JSON

@adarshsanjeev
Copy link
Copy Markdown
Contributor

Tried this out locally and it works great! Way better than manually making posts to get results.

I noticed something only while downloading the results, the format saved is as a json file, though according to the ResultFormat, ObjectLines is not valid json. (Firefox pointed this out too)
https://github.com/apache/druid/blob/master/sql/src/main/java/org/apache/druid/sql/http/ResultFormat.java#L96
Should the file extension be changed here?

I think part of the reason might be that the get results api is tagged as @Produces(MediaType.APPLICATION_JSON). I think I missed this while changing the default format. I'm not sure if the console takes this into account while deciding the file extension.

@adarshsanjeev
Copy link
Copy Markdown
Contributor

Tried making the change to @Produces(MediaType.TEXT_PLAIN) locally to see if that fixes it, but the files downloaded are still .json.

I also noticed that the Edit context part of the UI has the plural as X keies in this PR (and not in the build of master), though I don't see any such change in the diff. Is this just me?
Screenshot 2023-08-01 at 5 26 01 PM

Comment thread web-console/src/utils/general.tsx Fixed
Comment thread web-console/src/utils/general.tsx Fixed
Comment thread web-console/src/utils/general.tsx Fixed
@vogievetsky
Copy link
Copy Markdown
Contributor Author

Thank you for the testing and the feedback @adarshsanjeev I have addressed both issues in my commit. The extension is hard coded in the console right now and I changed it to jsonl which is more appropriate. Also I fixed the pluralizer

@vogievetsky vogievetsky merged commit 4a31ae2 into apache:master Aug 1, 2023
AmatyaAvadhanula pushed a commit to AmatyaAvadhanula/druid that referenced this pull request Aug 2, 2023
)

* fix error reset

* add page dialog logic

* add to detail archive

* update tests

* fix plurals

* use jsonl ext

* fix regex issue
@vogievetsky vogievetsky deleted the page_downloader branch August 3, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants