You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/10/26 14:47:23 UTC

[GitHub] [iotdb] 23931017wu opened a new pull request, #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

23931017wu opened a new pull request, #7745:
URL: https://github.com/apache/iotdb/pull/7745

   ### When modifying a time series alias, if the alias is a real number, you need to add a back quote, otherwise an error should be reported. Now you can successfully modify the alias without adding a back quote, causing the alias to not be used normally.
   
   ### Before
   ![图片](https://user-images.githubusercontent.com/71131924/198056386-484fd287-505a-46dd-9a5f-4aada2a0c121.png)
   
   When an alias is used and a piece of data is written, a new time series will be created incorrectly.
   
   ![图片](https://user-images.githubusercontent.com/71131924/198057100-1c233beb-9713-4b69-99f6-5d496dd53e8d.png)
   
   ### After
   
   Create Time Series and modify alias without back quotes.
   ![图片](https://user-images.githubusercontent.com/71131924/198057827-f9019459-bcf7-4e5b-985c-c1e7d70d789a.png)
   
   
   Change alias with back quotes, write a piece of data
   ![图片](https://user-images.githubusercontent.com/71131924/198058039-68d88bac-65fc-45cc-aa83-06333f7137f7.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] 23931017wu commented on a diff in pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
23931017wu commented on code in PR #7745:
URL: https://github.com/apache/iotdb/pull/7745#discussion_r1012525272


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -1664,10 +1664,14 @@ private String parseNodeString(String nodeName) {
     }
     if (nodeName.startsWith(TsFileConstant.BACK_QUOTE_STRING)
         && nodeName.endsWith(TsFileConstant.BACK_QUOTE_STRING)) {
-      String unWrapped = nodeName.substring(1, nodeName.length() - 1);
+      String unWrapped =
+          nodeName
+              .substring(1, nodeName.length() - 1)
+              .replace(TsFileConstant.DOUBLE_BACK_QUOTE_STRING, TsFileConstant.BACK_QUOTE_STRING);
+      ;

Review Comment:
   I think the document also needs to be modified. Let me restore it here first, and then mention a new pr~
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] lancelly commented on a diff in pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
lancelly commented on code in PR #7745:
URL: https://github.com/apache/iotdb/pull/7745#discussion_r1012537528


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -1664,10 +1664,14 @@ private String parseNodeString(String nodeName) {
     }
     if (nodeName.startsWith(TsFileConstant.BACK_QUOTE_STRING)
         && nodeName.endsWith(TsFileConstant.BACK_QUOTE_STRING)) {
-      String unWrapped = nodeName.substring(1, nodeName.length() - 1);
+      String unWrapped =
+          nodeName
+              .substring(1, nodeName.length() - 1)
+              .replace(TsFileConstant.DOUBLE_BACK_QUOTE_STRING, TsFileConstant.BACK_QUOTE_STRING);
+      ;

Review Comment:
   You are right. LGTM~



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] 23931017wu commented on a diff in pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
23931017wu commented on code in PR #7745:
URL: https://github.com/apache/iotdb/pull/7745#discussion_r1012523815


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -1664,10 +1664,14 @@ private String parseNodeString(String nodeName) {
     }
     if (nodeName.startsWith(TsFileConstant.BACK_QUOTE_STRING)
         && nodeName.endsWith(TsFileConstant.BACK_QUOTE_STRING)) {
-      String unWrapped = nodeName.substring(1, nodeName.length() - 1);
+      String unWrapped =
+          nodeName
+              .substring(1, nodeName.length() - 1)
+              .replace(TsFileConstant.DOUBLE_BACK_QUOTE_STRING, TsFileConstant.BACK_QUOTE_STRING);
+      ;

Review Comment:
   This is to solve the problem that the double back quotes in the node path do not resolve to single quotes.
   
   ![图片](https://user-images.githubusercontent.com/71131924/199655789-afc53a07-741f-495d-878b-ae42b49c0395.png)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] 23931017wu commented on a diff in pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
23931017wu commented on code in PR #7745:
URL: https://github.com/apache/iotdb/pull/7745#discussion_r1012523815


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -1664,10 +1664,14 @@ private String parseNodeString(String nodeName) {
     }
     if (nodeName.startsWith(TsFileConstant.BACK_QUOTE_STRING)
         && nodeName.endsWith(TsFileConstant.BACK_QUOTE_STRING)) {
-      String unWrapped = nodeName.substring(1, nodeName.length() - 1);
+      String unWrapped =
+          nodeName
+              .substring(1, nodeName.length() - 1)
+              .replace(TsFileConstant.DOUBLE_BACK_QUOTE_STRING, TsFileConstant.BACK_QUOTE_STRING);
+      ;

Review Comment:
   This is to solve the problem that the double back quotes in the node path do not resolve to single quotes.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] 23931017wu commented on pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
23931017wu commented on PR #7745:
URL: https://github.com/apache/iotdb/pull/7745#issuecomment-1296432078

   @lancelly Hi, Please review!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] lancelly commented on a diff in pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
lancelly commented on code in PR #7745:
URL: https://github.com/apache/iotdb/pull/7745#discussion_r1012497032


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/parser/ASTVisitor.java:
##########
@@ -1664,10 +1664,14 @@ private String parseNodeString(String nodeName) {
     }
     if (nodeName.startsWith(TsFileConstant.BACK_QUOTE_STRING)
         && nodeName.endsWith(TsFileConstant.BACK_QUOTE_STRING)) {
-      String unWrapped = nodeName.substring(1, nodeName.length() - 1);
+      String unWrapped =
+          nodeName
+              .substring(1, nodeName.length() - 1)
+              .replace(TsFileConstant.DOUBLE_BACK_QUOTE_STRING, TsFileConstant.BACK_QUOTE_STRING);
+      ;

Review Comment:
   This method should stay the same~



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [iotdb] neuyilan merged pull request #7745: [IOTDB-4769] When modifying an alias, you need to add back quotes when the alias is a special character.

Posted by GitBox <gi...@apache.org>.
neuyilan merged PR #7745:
URL: https://github.com/apache/iotdb/pull/7745


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org