ytsaurus / ytsaurus-ui

Web interface for YTsaurus.
https://ytsaurus.tech
Other
37 stars 19 forks source link

Draft Queries do not work properly #879

Open Krock21 opened 1 week ago

Krock21 commented 1 week ago

Normal queries show this part: Status, duration, date, author, Share button, Modify ACO button, Statistics/progress/meta

Screenshot 2024-11-21 at 15 58 22

Draft queries don't:

Screenshot 2024-11-21 at 15 55 55

We should fix UI for draft queries, so users can see basic information and perform basic operations (share, modify ACO)

UI doesn't allow creating draft queries now, but they can be created via CLI or SDKs CLI example:

yt start-query yql 'select 1' --params '{draft=%true}'
vrozaev commented 3 days ago

So here we need support Author, Share button and Modify ACO button for draft queries, because only these buttons makes sense for draft query. And clearly show that the query is draft.

Krock21 commented 3 days ago

Here is an example of get-query for a draft query:

{
    "id": "154e10ee-5ba30695-1b2baffc-3170f32f",
    "engine": "yql",
    "query": "select 1",
    "files": [],
    "start_time": "2024-11-21T14:53:12.387524Z",
    "settings": {},
    "user": "aleksandr.gaev",
    "access_control_object": "everyone",
    "access_control_objects": [
        "everyone"
    ],
    "state": "draft",
    "progress": {},
    "annotations": {}
}

and for a normal completed one:

{
    "id": "db33f3ed-560551aa-1cd978c2-9717381a",
    "engine": "yql",
    "query": "INSERT INTO `//home/yt-team/aleksandr.gaev/tmp/test-table-1` (key) VALUES (1);",
    "files": [],
    "start_time": "2024-11-29T10:25:00.786506Z",
    "finish_time": "2024-11-29T10:25:05.133850Z",
    "settings": {
        "cluster": "my-cluster"
    },
    "user": "aleksandr.gaev",
    "access_control_object": "nobody",
    "access_control_objects": [
        "nobody"
    ],
    "state": "completed",
    "result_count": 0,
    "progress": {
        "yql_plan": {
            ....
            }
        },
        "yql_statistics": {
        ...
        },
        "yql_progress": {
        ...
        }
    },
    "annotations": {},
    "error": {
        "code": 0,
        "message": "",
        "attributes": {}
    }
}

Draft query is in a special "draft" state