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
[ZEPPELIN-5896]feat:add sql debug feature #4598
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why you open so many pull requests with the same subject? You can always change the existing pull request. If everything works with the Maven plugin, the pull request can be shortened to a manageable minimum.
ok,sorry,i am not familiar with it, i will try it next times,thanks for your advices |
hi @Reamer is this pr has other problems? i really want to add this feature to zeppelin, could you help me complete it? |
Don't you see the review comments from me? |
i have changed it according to your advice |
Please also remove the default configurations. You can probably also delete most of the files under |
Please also remove the default configurations --- this is more detaily?such as give the line of code hi,if delete the code in zeppelin-interpreter/src/main/java/org/apache/zeppelin/antrl4/ ,the feature cannot run ,really to do it? |
I have created zhugezifang#1 for you. Please look over it. The compilation works. I can't make any statement about the functionality. |
thank you very much for your guidance,i look over it |
48dc626
to
029e898
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need also an integration in the new UI zeppelin-web-angular
.
zeppelin-interpreter/src/main/java/org/apache/zeppelin/antlr/SqlSplitVisitor.java
Outdated
Show resolved
Hide resolved
yes,it also need |
83bb3d1
to
28c6ea8
Compare
hi @Reamer i am not familiar with the new ui of angular , is there a developer familiar with angular in zeppelin community to complete it? |
5e89610
to
d9edf18
Compare
i try to completed it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found two minor improvements. Can you correct your formatter. For example, Zeppelin uses an indentation of two spaces.
Furthermore, the use of antlr4 must be included in the license.
Also, it would be nice if you upload screenshots of both frontends in the pull request description.
Glad you've been reading up on the new Angular frontend. In my opinion, this one was always easier than the other. But I'm not a frontend developer and can't really evaluate your code there.
zeppelin-interpreter/src/main/java/org/apache/zeppelin/antlr/SqlSplitVisitor.java
Outdated
Show resolved
Hide resolved
zeppelin-interpreter/src/main/java/org/apache/zeppelin/antlr/SqlSplitVisitor.java
Outdated
Show resolved
Hide resolved
zeppelin-interpreter/src/main/java/org/apache/zeppelin/antlr/SqlSplitVisitor.java
Outdated
Show resolved
Hide resolved
57d11e4
to
c023a55
Compare
ok,thans for your advices,it really help me very much , i learn a lot from processing the problems of this pr , and i completed it |
@Reamer hi,could you help to review it again? |
@Reamer hi, could you help to review it again? is this pr can be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few comments. Please remember to include images of both front ends in the PullRequest description.
zeppelin-interpreter/src/test/java/org/apache/zeppelin/antlr/SqlSplitVisitorTest.java
Outdated
Show resolved
Hide resolved
zeppelin-interpreter/src/main/java/org/apache/zeppelin/antlr/SqlSplitVisitor.java
Outdated
Show resolved
Hide resolved
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
Outdated
Show resolved
Hide resolved
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/control/control.component.ts
Outdated
Show resolved
Hide resolved
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/control/control.component.ts
Outdated
Show resolved
Hide resolved
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/control/control.component.ts
Show resolved
Hide resolved
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.ts
Outdated
Show resolved
Hide resolved
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.ts
Outdated
Show resolved
Hide resolved
Thank you for your contribution. I already saw some comments by @Reamer but I also could see some style issue. (Yes, Zeppelin doesn't have very-very strict rules for styling but I think contributors should do their best to keep the style with the current one. Some Java code doesn't match with the current code so I recommend you reformat your code block in your IDE. Could you please do it kindly? |
no problem,i will keep it ,thanks for your help @Reamer @jongyoul ,it really help me lot |
hi @Reamer ,i not do the new ui ,You see, okay? i am really not familiar with the angular |
d7934c5
to
79f53db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am very unhappy with the code quality and therefore will not pursue this feature. Another reviewer is welcome to ask my opinion once the code is clean.
In my opinion, most of the code belongs in the JDBC interpreter and not in the general Zeppelin interpreter.
There should also be an implementation for the new frontend, since the old frontend will be replaced at some point.
In the backend will not check for a JDBC paragraph. The check takes place only in the frontend....
@zhugezifang
I don't have the time to develop this feature.
text=""; | ||
for (String createTableSql:createTableList){ | ||
text+=createTableSql+"\n"; | ||
size++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you iterate through a list to determine the length of the list?
//split | ||
List<String> createTableList= SqlSplitVisitor.splitSql(text,paragraphId); | ||
int size=0; | ||
text=""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you overwrite text? It is better to use a new name here.
int size=0; | ||
text=""; | ||
for (String createTableSql:createTableList){ | ||
text+=createTableSql+"\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you ever heard of the StringBuilder?
throws IOException { | ||
super.onSuccess(p, context); | ||
//change result | ||
setResult(p, finalSize,createTableList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to change the result of the paragraph?
connectionManager.unicastParagraph(p.getNote(), p2, context.getAutheInfo().getUser(), fromMessage.msgId); | ||
} | ||
|
||
// if it's the last paragraph and not empty, let's add a new one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have copied a lot of code from other places. This should be prevented.
I am very sorry, i will improve the code quality, and i will try to completed the new ui , because i am not familiar with angular,it may cost me lot time, but i will try my best to do it. and you really help me a lot to develop this feature, the Limite of my ability,i complete the code which cannot meet your requirements,it really sorry,i try to improve it .At last, Thank you sincerely for your advice very much @Reamer and @jongyoul |
b1d76df
to
6dd002d
Compare
hi, i try my best to improve the code quality, and completed the new ui ,and add images of both front ends in the PullRequest description |
hi @jongyoul could you help me to review this pr? |
@jongyoul hi |
@zhugezifang Hello, sorry for the late reply. I glance at your PR and suggest you make a child interpreter like |
@jongyoul hi,the menu of sql debug is controlled, it only can be viewed and used in jdbc interpreter, it cannot be viewed in other interpreter |
@jongyoul hi,could help me to review it? |
}, | ||
{ | ||
label: 'Debug', | ||
show: this.defaultInterpreterGroup === 'jdbc' ? true : false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhugezifang In my understanding, defaultInterpreterGroup
can be changed dynamically if you create a new interpreter from the type of interpreter. E.g. We can have jdbc2
as a jdbc
type but it won't work properly. So that's the reason why I don't think we can control the type of interpreters. Moreover, we can change the type of paragraph dynamically from jdbc to spark and flink. In this case will it work properly? The third, I don't know if this debug feature is general for all kinds of jdbc-related engine. We can use several types of jdbc drivers by default but I don't know how we can guarantee current jdbc provide jdbc features.
In another aspect, I feel like adding a new interpreter seems quite good. Do you have any concerns to add a new interpreter in the jdbc interpreter group?
What is this PR for?
This pull request add sql debug feat into zeppelin
Design Document: https://docs.google.com/document/d/1b0MkUwnPdqXQ3uALpELUUau0D50QEM6z_Xuwrs4GQmA/edit?usp=sharing
What type of PR is it?
Feature
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-5896
How should this be tested?
Questions: