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/11/18 21:35:12 UTC

[GitHub] [pinot] Jackie-Jiang commented on a change in pull request #7792: Nicer error message if you have a typo in your schema file

Jackie-Jiang commented on a change in pull request #7792:
URL: https://github.com/apache/pinot/pull/7792#discussion_r752639890



##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/data/Schema.java
##########
@@ -213,6 +213,10 @@ public void addField(FieldSpec fieldSpec) {
         throw new UnsupportedOperationException("Unsupported field type: " + fieldType);
     }
 
+    if (fieldSpec.getDataType() == null) {
+      throw new UnsupportedOperationException(String.format("'%s' field is missing 'dataType' property", columnName));

Review comment:
       Suggest modeling it as `IllegalArgumentException`. We can also use the `Preconditions` to simplify the check
   ```suggestion
         Preconditions.checkArgument(fieldSpec.getDataType() != null, "'%s' field is missing 'dataType' property", columnName);
   ```

##########
File path: pinot-common/src/test/java/org/apache/pinot/common/data/SchemaTest.java
##########
@@ -253,11 +254,27 @@ public void testSchemaBuilderAddTime() {
     Assert.assertEquals(schema11, schema12);
   }
 
+  @Test(expectedExceptions = com.fasterxml.jackson.databind.JsonMappingException.class,

Review comment:
       Import this class




-- 
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: commits-unsubscribe@pinot.apache.org

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