forked from apache/kyuubi
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KYUUBI apache#5366][UI] Add submit SQL page in Kyuubi Web UI
### _Why are the changes needed?_ This PR is to introduce a submit SQL editor page to close apache#5366. Users then can submit SQL in SQL editor page to retrieve, update or do other data manipulations by Spark engine with this feature. Once users open up a new tab in SQL editor, a new connection(session) is established with the a Kyuubi server instance. After that, users can input their SQL statements in a text box provided on the page and select the desired number of data rows to be shown in result from a dropdown list located at the right side of the run button. When the statement is executed in one of server instances, the execution status of the job is displayed to the user. After the statement is executed successfully , the result is displayed in the bottom of page for users. ![03_53_07](https://github.com/apache/kyuubi/assets/32693629/33806d90-7db8-4137-b8bc-872c3c42e36f) ![03_31_26](https://github.com/apache/kyuubi/assets/32693629/dd6d4226-9ddc-443e-a976-6ddd47d08d8a) ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No Closes apache#5616 from zhaohehuhu/dev-1103. Closes apache#5366 078d19e [William Tong] code optimize (#9) 1d839bc [William Tong] code change (#8) ddffd19 [William Tong] fix code conflict in layout (#7) f1fc9a2 [William Tong] UI change (#6) 265f02d [William Tong] sql UI change (#5) 4bb22f0 [William Tong] Merge branch 'master' into dev-1103 065a497 [William Tong] Merge master into branch (#4) 3438012 [William Tong] Merge pull request #3 from zhaohehuhu/dev-1103-3 a374028 [weitong] add error message for sql page f04acf2 [William Tong] Merge branch 'master' into dev-1103 93fa6a2 [William Tong] Merge pull request #2 from zhaohehuhu/dev-1103-2 f0669ba [weitong] fix ecdbe5c [hezhao2] fix 531761d [hezhao2] change TabPaneName to TabPanelName 466a5ba [hezhao2] remove api2 ab0661f [hezhao2] change format for table header 5f4bca5 [hezhao2] move logo picture to images folder 159c35a [hezhao2] change layout 7379c4e [weitong] code change 0ddc6d5 [weitong] sql lab page dda47bd [hezhao2] add license 9f80e20 [weitong] sql page test Lead-authored-by: He Zhao <hezhao2@cisco.com> Co-authored-by: William Tong <weitong@cisco.com> Co-authored-by: hezhao2 <hezhao2@cisco.com> Co-authored-by: weitong <weitong@cisco.com> Signed-off-by: Cheng Pan <chengpan@apache.org>
- Loading branch information
Showing
22 changed files
with
914 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import request from '@/utils/request' | ||
import type { | ||
IOpenSessionRequest, | ||
IRunSqlRequest, | ||
IGetSqlRowsetRequest, | ||
IGetSqlMetadataRequest | ||
} from './types' | ||
|
||
export function openSession(data: IOpenSessionRequest): any { | ||
return request({ | ||
url: 'api/v1/sessions', | ||
method: 'post', | ||
data | ||
}) | ||
} | ||
|
||
export function closeSession(identifier: string): any { | ||
return request({ | ||
url: `api/v1/sessions/${identifier}`, | ||
method: 'delete' | ||
}) | ||
} | ||
|
||
export function runSql(data: IRunSqlRequest, identifier: string): any { | ||
return request({ | ||
url: `api/v1/sessions/${identifier}/operations/statement`, | ||
method: 'post', | ||
data | ||
}) | ||
} | ||
|
||
export function getSqlRowset(params: IGetSqlRowsetRequest): any { | ||
return request({ | ||
url: `api/v1/operations/${params.operationHandleStr}/rowset`, | ||
method: 'get', | ||
params | ||
}) | ||
} | ||
|
||
export function getSqlMetadata(params: IGetSqlMetadataRequest): any { | ||
return request({ | ||
url: `api/v1/operations/${params.operationHandleStr}/resultsetmetadata`, | ||
method: 'get', | ||
params | ||
}) | ||
} | ||
|
||
export function getLog(identifier: string): any { | ||
return request({ | ||
url: `api/v1/operations/${identifier}/log`, | ||
method: 'get' | ||
}) | ||
} | ||
|
||
export function closeOperation(identifier: string) { | ||
return request({ | ||
url: `api/v1/admin/operations/${identifier}`, | ||
method: 'delete' | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
interface IOpenSessionRequest { | ||
'kyuubi.engine.type': string | ||
} | ||
|
||
interface IRunSqlRequest { | ||
statement: string | ||
runAsync: boolean | ||
} | ||
|
||
interface IGetSqlRowsetRequest { | ||
operationHandleStr: string | ||
fetchorientation: 'FETCH_NEXT' | ||
maxrows: number | ||
} | ||
|
||
interface IGetSqlMetadataRequest { | ||
operationHandleStr: string | ||
} | ||
|
||
export { | ||
IOpenSessionRequest, | ||
IRunSqlRequest, | ||
IGetSqlRowsetRequest, | ||
IGetSqlMetadataRequest | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
interface IServer { | ||
attributes: any | null | ||
host: string | ||
instance: string | ||
namespace: string | ||
nodeName: string | ||
port: number | ||
status: string | ||
} | ||
|
||
export { IServer } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.