deemoliu commented on a change in pull request #6112: URL: https://github.com/apache/incubator-pinot/pull/6112#discussion_r502022511
########## File path: pinot-common/src/test/java/org/apache/pinot/common/data/FieldSpecTest.java ########## @@ -80,6 +80,18 @@ public void testFieldSpec() { Assert.assertEquals(fieldSpec1.hashCode(), fieldSpec2.hashCode()); Assert.assertEquals(fieldSpec1.getDefaultNullValue(), "false"); + // Single-value boolean type dimension field with max length and default null value. + fieldSpec1 = new DimensionFieldSpec(); + fieldSpec1.setName("svDimension"); + fieldSpec1.setDataType(BOOLEAN); + fieldSpec1.setDefaultNullValue(false); + fieldSpec1.setMaxLength(20000); Review comment: Thanks @mayankshriv @Jackie-Jiang for review. I will fix this test. Additional to that, do you suggest me to enforce configurable maxLength on String fields only? Is it possible that Pinot will support maxLength on other variable length data types in the future? In our use case, we only allow user to set maxLength on String columns. ########## File path: pinot-spi/src/main/java/org/apache/pinot/spi/data/Schema.java ########## @@ -508,13 +517,22 @@ public SchemaBuilder addMultiValueDimension(String dimensionName, DataType dataT } /** - * Add single value dimensionFieldSpec with defaultNullValue + * Add multi value dimensionFieldSpec with defaultNullValue */ public SchemaBuilder addMultiValueDimension(String dimensionName, DataType dataType, Object defaultNullValue) { _schema.addField(new DimensionFieldSpec(dimensionName, dataType, false, defaultNullValue)); return this; } + /** + * Add multi value dimensionFieldSpec with maxLength and a defaultNullValue + */ + public SchemaBuilder addMultiValueDimension(String dimensionName, DataType dataType, int maxLength, + Object defaultNullValue) { Review comment: Gotcha, thanks for code review. ########## File path: pinot-spi/src/main/java/org/apache/pinot/spi/data/Schema.java ########## @@ -499,6 +499,15 @@ public SchemaBuilder addSingleValueDimension(String dimensionName, DataType data return this; } + /** + * Add single value dimensionFieldSpec with maxLength and a defaultNullValue + */ + public SchemaBuilder addSingleValueDimension(String dimensionName, DataType dataType, int maxLength, + Object defaultNullValue) { Review comment: Gotcha, thanks @Jackie-Jiang for code 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org