Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix beeline with -e When there are other SQL statements before the source statement, the source statement cannot be executed normally #4619

Closed
wants to merge 12 commits into from

Conversation

thomasg19930417
Copy link
Contributor

@thomasg19930417 thomasg19930417 commented Mar 27, 2023

Why are the changes needed?

When using beeline -e, if there is a newline or space between the source statement and the previous sql, the source statement will be misjudged as a sql statement and sent to the server for execution
image

image

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 locally before make a pull request

@codecov-commenter
Copy link

Codecov Report

Merging #4619 (a2bfc0f) into master (6fd3353) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #4619      +/-   ##
============================================
- Coverage     53.32%   53.29%   -0.03%     
  Complexity       13       13              
============================================
  Files           577      577              
  Lines         31591    31593       +2     
  Branches       4249     4250       +1     
============================================
- Hits          16845    16838       -7     
- Misses        13159    13167       +8     
- Partials       1587     1588       +1     
Impacted Files Coverage Δ
...n/java/org/apache/hive/beeline/KyuubiCommands.java 0.00% <0.00%> (ø)

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@turboFei
Copy link
Member

Cc @cfmcgrady

@yaooqinn yaooqinn changed the title [KYUUBI BUG] Fix beeline with -e When there are other SQL statements before the source statement, the source statement cannot be executed normally Fix beeline with -e When there are other SQL statements before the source statement, the source statement cannot be executed normally Apr 3, 2023
@turboFei turboFei closed this in d7c1c94 Apr 4, 2023
turboFei pushed a commit that referenced this pull request Apr 4, 2023
…s before the source statement, the source statement cannot be executed normally

### _Why are the changes needed?_

When using beeline -e, if there is a newline or space between the source statement and the previous sql, the source statement will be misjudged as a sql statement and sent to the server for execution
![image](https://user-images.githubusercontent.com/20243868/227915694-42445ecb-7d0e-4ebe-8e8c-b2a25fe069a1.png)

![image](https://user-images.githubusercontent.com/20243868/227915440-fcc540d8-a265-4050-82de-3ffa25c7abc2.png)

### _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/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4619 from thomasg19930417/master.

Closes #4619

a2bfc0f [xu.guo] Fix When there are other sql before the source statement, the source statement cannot be executed normally
1ec0b81 [xu.guo] Fix When there are other sql before the source statement, the source statement cannot be executed normally
9abba3c [thomasgx] Merge branch 'apache:master' into master
f8405eb [Cheng Pan] Update kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiCommands.java
3ad46c1 [Cheng Pan] Update kyuubi-hive-beeline/src/main/java/org/apache/hive/beeline/KyuubiCommands.java
31fa807 [xu.guo] Merge branch 'master' of https://github.com/thomasg19930417/kyuubi
41e090d [thomasgx] Merge branch 'apache:master' into master
ba82229 [xu.guo] Move initializeConsoleReader to KyuubiCommands#connect
e06927b [xu.guo] Replace create new  consoleReader instance with  call initializeConsoleReader
86f2e50 [xu.guo] Fix code style
b0c4722 [xu.guo] Fix Beeline with -i run sql faild
042987a [xu.guo] Fix Beeline with -i run sql faild

Lead-authored-by: xu.guo <xu.guo@brgroup.com>
Co-authored-by: thomasgx <570736711@qq.com>
Co-authored-by: Cheng Pan <pan3793@gmail.com>
Signed-off-by: fwang12 <fwang12@ebay.com>
(cherry picked from commit d7c1c94)
Signed-off-by: fwang12 <fwang12@ebay.com>
@turboFei turboFei added this to the v1.7.1 milestone Apr 4, 2023
@turboFei
Copy link
Member

turboFei commented Apr 4, 2023

thanks for your contribution @thomasg19930417 , merged to master and 1.7.1

turboFei added a commit to turboFei/kyuubi that referenced this pull request Jun 15, 2023
… SQL statements before the source statement, the source statement cannot be executed normally"

This reverts commit fadb802.
turboFei added a commit that referenced this pull request Jun 16, 2023
…mments for non-python mode

### _Why are the changes needed?_

Close #4803

The beeline has regression because of 70590f7#diff-993fdbefe9fe3d1c91fcedba99362a8c8d9b94793ec16cbfbc989e750367ea89

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4965 from turboFei/revert_beeline_python_change.

Closes #4965

856d923 [fwang12] trim for non python mdoe
f846460 [fwang12] Revert "[KYUUBI #4619] Fix beeline with -e When there are other SQL statements before the source statement, the source statement cannot be executed normally"
e5e3c31 [fwang12] revert trim
bec09c2 [fwang12] migration guide
585da6f [fwang12] fix'
f3fcfe9 [fwang12] save
8cb8cb9 [fwang12] save
e153977 [fwang12] comments
814c970 [fwang12] save
b1baa77 [fwang12] save
3337ca8 [fwang12] options

Authored-by: fwang12 <fwang12@ebay.com>
Signed-off-by: fwang12 <fwang12@ebay.com>
pan3793 pushed a commit that referenced this pull request Jul 16, 2023
…mments for non-python mode

Close #4803

The beeline has regression because of 70590f7#diff-993fdbefe9fe3d1c91fcedba99362a8c8d9b94793ec16cbfbc989e750367ea89

- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4965 from turboFei/revert_beeline_python_change.

Closes #4965

856d923 [fwang12] trim for non python mdoe
f846460 [fwang12] Revert "[KYUUBI #4619] Fix beeline with -e When there are other SQL statements before the source statement, the source statement cannot be executed normally"
e5e3c31 [fwang12] revert trim
bec09c2 [fwang12] migration guide
585da6f [fwang12] fix'
f3fcfe9 [fwang12] save
8cb8cb9 [fwang12] save
e153977 [fwang12] comments
814c970 [fwang12] save
b1baa77 [fwang12] save
3337ca8 [fwang12] options

Authored-by: fwang12 <fwang12@ebay.com>
Signed-off-by: fwang12 <fwang12@ebay.com>
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.

5 participants