questdb / questdb/ui

Improved usability of error log messages in web console

Open
#49 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Severity: 2 web-console
Dominant language
TypeScript
Stars
29
Forks
39
Avg merge
4d 11h
Merged PRs (30d)
4

Description

Is your feature request related to a problem?

No response

Describe the solution you'd like.

Given this setup:

CREATE TABLE hits (
    id string,
    url string,
    timestamp timestamp
) timestamp(timestamp);

INSERT INTO hits VALUES (rnd_str(36, 36, 0), 'https://questdb.io/, systimestamp());
INSERT INTO hits VALUES (rnd_str(36, 36, 0), 'https://questdb.io', systimestamp());
INSERT INTO hits VALUES (rnd_str(36, 36, 0), 'https://questdb.io', systimestamp());
INSERT INTO hits VALUES (rnd_str(36, 36, 0), 'https://questdb.io', systimestamp());

This query is correct and when executed in localhost:9000 we get results:

SELECT a.part, coalesce(b.views, 0) as views FROM
    (SELECT part, 0 views FROM (SELECT case WHEN (hour(now()) + cast(x as int)) >= 24 THEN (hour(now()) + cast(x as int)) - 24 ELSE hour(now()) + cast(x as int) END AS part FROM long_sequence(24)) GROUP BY part) AS a
    LEFT JOIN (SELECT cast(hour(timestamp) as int) part, count() views FROM hits GROUP BY part) AS b
ON a.part = b.part

The process of producing the above SQL statement involves a lot of trial an error and in some cases the error log is not very helpful. In addition there is no way of copying the error message plus potentially its context stack to a text file for further analysis.

For illustration, if we accidentally allow Rufus (the cat) loose on the desk and he accidentally hits the ; key and this lands somewhere in our statement, for instance:

SELECT a.part, coalesce(b.views, 0) as views FROM
    (SELECT part, 0 views FROM (SELECT case WHEN (hour(now()) + cast(x as int)) >= 2;4 THEN (hour(now()) + cast(x as int)) - 24 ELSE hour(now()) + cast(x as int) END AS part FROM long_sequence(24)) GROUP BY part) AS a
    LEFT JOIN (SELECT cast(hour(timestamp) as int) part, count() views FROM hits GROUP BY part) AS b
ON a.part = b.part

The error simply says: dangling expression.

  • It would be nice if the error log contained similar information as bellow.
  • It would be nice if there was some form of visualising the error stack and copying message and all to the clipboard
Describe alternatives you've considered.

Using tools that rely on the postgres wire protocol, the error is more useful:

org.postgresql.util.PSQLException: ERROR: dangling expression
  Position: 136
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2657)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2347)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:337)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:484)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:404)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:325)
    at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:311)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:287)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:282)
    at io.quest.model.SQLExecutor.executeRequest(SQLExecutor.java:201)
    at io.quest.model.SQLExecutor.lambda$submit$1(SQLExecutor.java:142)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Additional context.

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example query in the web console at localhost:9000 and compare its displayed error with the PostgreSQL error example. Done means the console presents more useful error context, supports visualising the error stack, and allows the message and context to be copied.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.