Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
* @param page page index
* @param size page size
* @param user Query histories of specified user. ADMIN role is optional, other roles are mandatory.
* @param backendUrl Optional, you can query the history based on the backendUrl.
* @param externalUrl Optional, you can query the history based on the externalUrl.
* @param queryId Optional, you can query the query history based on the queryId of Trino.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public record QueryHistoryRequest(
@JsonProperty("page") Integer page,
@JsonProperty("size") Integer size,
@JsonProperty("user") String user,
@JsonProperty("backendUrl") String backendUrl,
@JsonProperty("externalUrl") String externalUrl,
@JsonProperty("queryId") String queryId,
@JsonProperty("source") String source)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public Response findQueryHistory(QueryHistoryRequest query, @Context SecurityCon
query.page(),
query.size(),
securityContext.getUserPrincipal().getName(),
query.backendUrl(),
query.externalUrl(),
query.queryId(),
query.source()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public TableData<QueryDetail> findQueryHistory(QueryHistoryRequest query)
if (!Strings.isNullOrEmpty(query.user())) {
condition += " and user_name = '" + query.user() + "'";
}
if (!Strings.isNullOrEmpty(query.backendUrl())) {
condition += " and backend_url = '" + query.backendUrl() + "'";
if (!Strings.isNullOrEmpty(query.externalUrl())) {
condition += " and external_url = '" + query.externalUrl() + "'";
}
if (!Strings.isNullOrEmpty(query.queryId())) {
condition += " and query_id = '" + query.queryId() + "'";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ void testQueryHistoryRequest()
throws JsonProcessingException
{
assertThat(objectMapper.writeValueAsString(new QueryHistoryRequest(null, null, "user1", "url1", "query_id", "source")))
.contains(ImmutableList.of("\"page\":1", "\"size\":10", "user", "backendUrl", "queryId", "source"));
.contains(ImmutableList.of("\"page\":1", "\"size\":10", "user", "externalUrl", "queryId", "source"));
assertThat(objectMapper.writeValueAsString(new QueryHistoryRequest(5, 6, "user1", "url1", "query_id", "source")))
.contains(ImmutableList.of("\"page\":5", "\"size\":6", "user", "backendUrl", "queryId", "source"));
.contains(ImmutableList.of("\"page\":5", "\"size\":6", "user", "externalUrl", "queryId", "source"));
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function History() {
<Form labelPosition="left"
render={() => (
<>
<Form.Select field="backendUrl" label='RoutedTo' style={{ width: 200 }} showClear placeholder={Locale.History.RoutedToTip}>
<Form.Select field="externalUrl" label='RoutedTo' style={{ width: 200 }} showClear placeholder={Locale.History.RoutedToTip}>
{backendData?.map(b => (
<Form.Select.Option key={b.externalUrl} value={b.externalUrl}>
<Tag color={'blue'} style={{ marginRight: '5px' }}>{backendMapping[b.externalUrl]}</Tag>
Expand Down