You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/03/31 18:30:23 UTC

[GitHub] [incubator-pinot] mqliang opened a new pull request #6735: Throw exception and give error message when creating schema with spaces in column name

mqliang opened a new pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735


   
   ## Description
   
   Throw exception and give error message when creating schema with spaces in column name
   
   ## Upgrade Notes
   Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
   * [ ] Yes (Please label as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR fix a zero-downtime upgrade introduced earlier?
   * [ ] Yes (Please label this as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR otherwise need attention when creating release notes? Things to consider:
   - New configuration options
   - Deprecation of configurations
   - Signature changes to public methods/interfaces
   - New plugins added or old plugins removed
   * [ ] Yes (Please label this PR as **<code>release-notes</code>** and complete the section on Release Notes)
   ## Release Notes
   If you have tagged this as either backward-incompat or release-notes,
   you MUST add text here that you would like to see appear in release notes of the
   next release.
   
   If you have a series of commits adding or enabling a feature, then
   add this section only in final commit that marks the feature completed.
   Refer to earlier release notes to see examples of text
   
   ## Documentation
   If you have introduced a new feature or configuration, please add it to the documentation as well.
   See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document
   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] siddharthteotia merged pull request #6735: Throw exception and give error message when creating schema with spaces in column name

Posted by GitBox <gi...@apache.org>.
siddharthteotia merged pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735


   


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] siddharthteotia commented on a change in pull request #6735: Throw exception and give error message when creating schema with spaces in column name

Posted by GitBox <gi...@apache.org>.
siddharthteotia commented on a change in pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735#discussion_r605205074



##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/SchemaUtils.java
##########
@@ -79,6 +81,8 @@ public static void validate(Schema schema) {
     for (FieldSpec fieldSpec : schema.getAllFieldSpecs()) {
       if (!fieldSpec.isVirtualColumn()) {
         String column = fieldSpec.getName();
+        Preconditions.checkState(!StringUtils.containsWhitespace(column),
+            "The column name \"%s\" should not" + " contain blank space.", column);

Review comment:
       (nit) Can be "should not contain blank space" instead of "should not" + " contain ...."




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] siddharthteotia commented on a change in pull request #6735: Throw exception and give error message when creating schema with spaces in column name

Posted by GitBox <gi...@apache.org>.
siddharthteotia commented on a change in pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735#discussion_r605221551



##########
File path: pinot-core/src/test/java/org/apache/pinot/core/util/SchemaUtilsTest.java
##########
@@ -313,6 +315,42 @@ public void testDateTimeFieldSpec()
     SchemaUtils.validate(pinotSchema);
   }
 
+  /**
+   * Testcases for testing column name validation logic.
+   * Currently column name validation only checks no blank space in column names. Should we add more validation on column
+   * names later on, we can corresponding tests here.

Review comment:
       (nit) we can add




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] siddharthteotia commented on a change in pull request #6735: Throw exception and give error message when creating schema with spaces in column name

Posted by GitBox <gi...@apache.org>.
siddharthteotia commented on a change in pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735#discussion_r605206152



##########
File path: pinot-core/src/test/java/org/apache/pinot/core/util/SchemaUtilsTest.java
##########
@@ -313,6 +315,24 @@ public void testDateTimeFieldSpec()
     SchemaUtils.validate(pinotSchema);
   }
 
+  @Test
+  public void testColumnNameValidation()

Review comment:
       Also please add a comment stating that currently the test is only for checking whitespaces. Later on if we add more validation on column names, we can corresponding tests here.




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] mqliang commented on pull request #6735: Throw exception and give error message when creating schema with spaces in column name

Posted by GitBox <gi...@apache.org>.
mqliang commented on pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735#issuecomment-811313963


   cc @fx19880617 


-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] siddharthteotia commented on a change in pull request #6735: Throw exception and give error message when creating schema with spaces in column name

Posted by GitBox <gi...@apache.org>.
siddharthteotia commented on a change in pull request #6735:
URL: https://github.com/apache/incubator-pinot/pull/6735#discussion_r605203813



##########
File path: pinot-core/src/test/java/org/apache/pinot/core/util/SchemaUtilsTest.java
##########
@@ -313,6 +315,24 @@ public void testDateTimeFieldSpec()
     SchemaUtils.validate(pinotSchema);
   }
 
+  @Test
+  public void testColumnNameValidation()

Review comment:
       Let's add test for trailing and leading whitespace as well 
   




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org