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

[ZEPPELIN-5896]feat:add sql debug feature #4598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhugezifang
Copy link
Contributor

@zhugezifang zhugezifang commented May 9, 2023

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

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-5896

How should this be tested?

  • CI

Questions:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? Yes

Copy link
Contributor

@Reamer Reamer left a 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.

zeppelin-interpreter/pom.xml Show resolved Hide resolved
zeppelin-interpreter/pom.xml Outdated Show resolved Hide resolved
zeppelin-interpreter/src/main/antrl4/Sql.g4 Outdated Show resolved Hide resolved
@zhugezifang
Copy link
Contributor Author

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

@zhugezifang
Copy link
Contributor Author

hi @Reamer is this pr has other problems? i really want to add this feature to zeppelin, could you help me complete it?

@Reamer
Copy link
Contributor

Reamer commented May 11, 2023

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?

@zhugezifang
Copy link
Contributor Author

zhugezifang commented May 11, 2023

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

@Reamer
Copy link
Contributor

Reamer commented May 11, 2023

I do not see your changes.
grafik

@Reamer
Copy link
Contributor

Reamer commented May 11, 2023

Please also remove the default configurations. You can probably also delete most of the files under zeppelin-interpreter/src/main/java/org/apache/zeppelin/antrl4/.

@zhugezifang
Copy link
Contributor Author

I do not see your changes. grafik

the older version

image

the latest version

image

@zhugezifang
Copy link
Contributor Author

Please also remove the default configurations. You can probably also delete most of the files under zeppelin-interpreter/src/main/java/org/apache/zeppelin/antrl4/.

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?

@Reamer
Copy link
Contributor

Reamer commented May 11, 2023

I have created zhugezifang#1 for you. Please look over it. The compilation works. I can't make any statement about the functionality.

@zhugezifang
Copy link
Contributor Author

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

Copy link
Contributor

@Reamer Reamer left a 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.

@zhugezifang
Copy link
Contributor Author

We need also an integration in the new UI zeppelin-web-angular.

yes,it also need

@zhugezifang
Copy link
Contributor Author

We need also an integration in the new UI zeppelin-web-angular.

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?

@zhugezifang
Copy link
Contributor Author

We need also an integration in the new UI zeppelin-web-angular.

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?

We need also an integration in the new UI zeppelin-web-angular.

i try to completed it

Copy link
Contributor

@Reamer Reamer left a 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.

@zhugezifang zhugezifang force-pushed the sql_debug_dev branch 2 times, most recently from 57d11e4 to c023a55 Compare May 12, 2023 10:41
@zhugezifang
Copy link
Contributor Author

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.

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

@zhugezifang
Copy link
Contributor Author

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.

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?

@zhugezifang
Copy link
Contributor Author

zhugezifang commented May 16, 2023

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.

@Reamer hi, could you help to review it again? is this pr can be merged?

Copy link
Contributor

@Reamer Reamer left a 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.

@jongyoul
Copy link
Member

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?

@zhugezifang
Copy link
Contributor Author

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

@zhugezifang
Copy link
Contributor Author

I have added a few comments. Please remember to include images of both front ends in the PullRequest description.

hi @Reamer ,i not do the new ui ,You see, okay? i am really not familiar with the angular

@zhugezifang zhugezifang force-pushed the sql_debug_dev branch 3 times, most recently from d7934c5 to 79f53db Compare May 17, 2023 09:24
Copy link
Contributor

@Reamer Reamer left a 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++;
Copy link
Contributor

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="";
Copy link
Contributor

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";
Copy link
Contributor

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);
Copy link
Contributor

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
Copy link
Contributor

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.

@zhugezifang
Copy link
Contributor Author

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.

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

@zhugezifang
Copy link
Contributor Author

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.

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

@zhugezifang
Copy link
Contributor Author

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?

hi @jongyoul could you help me to review this pr?

@zhugezifang
Copy link
Contributor Author

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?

hi @jongyoul could you help me to review this pr?

@jongyoul hi

@jongyoul
Copy link
Member

@zhugezifang Hello, sorry for the late reply. I glance at your PR and suggest you make a child interpreter like jdbc.debug instead of adding a menu. The debug paragraph is currently only for JDBC, but the menu would be exposed for all kinds of paragraphs. zeppelin-interpreter package and NotebookServer class affect all of interpreters. If you want to make an interpreter-specific feature, I recommend adding a new sub-interpreter. WDYT?

@zhugezifang
Copy link
Contributor Author

zhugezifang commented Jul 4, 2023

@zhugezifang Hello, sorry for the late reply. I glance at your PR and suggest you make a child interpreter like jdbc.debug instead of adding a menu. The debug paragraph is currently only for JDBC, but the menu would be exposed for all kinds of paragraphs. zeppelin-interpreter package and NotebookServer class affect all of interpreters. If you want to make an interpreter-specific feature, I recommend adding a new sub-interpreter. WDYT?

@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

@zhugezifang
Copy link
Contributor Author

@zhugezifang Hello, sorry for the late reply. I glance at your PR and suggest you make a child interpreter like jdbc.debug instead of adding a menu. The debug paragraph is currently only for JDBC, but the menu would be exposed for all kinds of paragraphs. zeppelin-interpreter package and NotebookServer class affect all of interpreters. If you want to make an interpreter-specific feature, I recommend adding a new sub-interpreter. WDYT?

@zhugezifang Hello, sorry for the late reply. I glance at your PR and suggest you make a child interpreter like jdbc.debug instead of adding a menu. The debug paragraph is currently only for JDBC, but the menu would be exposed for all kinds of paragraphs. zeppelin-interpreter package and NotebookServer class affect all of interpreters. If you want to make an interpreter-specific feature, I recommend adding a new sub-interpreter. WDYT?

@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,
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants