Skip to content

Commit

Permalink
Added tests for additional data types in SegmentPreProcessorTest.java (
Browse files Browse the repository at this point in the history
  • Loading branch information
aadilkhalifa authored Apr 5, 2024
1 parent 41cbd7f commit e477afa
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.attribute.FileTime;
Expand Down Expand Up @@ -1387,6 +1388,33 @@ public void testColumnMinMaxValue()
assertEquals(timeColumnMetadata.getMaxValue(), 1756015683);
assertEquals(dimensionColumnMetadata.getMinValue(), "AKXcXcIqsqOJFsdwxZ");
assertEquals(dimensionColumnMetadata.getMaxValue(), "yQkJTLOQoOqqhkAClgC");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column14");
assertEquals(dimensionColumnMetadata.getMaxValue(), -9223372036854775808L);
assertEquals(dimensionColumnMetadata.getMinValue(), -9223372036854775808L);
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column15");
assertEquals(dimensionColumnMetadata.getMaxValue(), Float.NEGATIVE_INFINITY);
assertEquals(dimensionColumnMetadata.getMinValue(), Float.NEGATIVE_INFINITY);
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column16");
assertEquals(dimensionColumnMetadata.getMaxValue(), Double.NEGATIVE_INFINITY);
assertEquals(dimensionColumnMetadata.getMinValue(), Double.NEGATIVE_INFINITY);
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column17");
assertEquals(dimensionColumnMetadata.getMaxValue(), new BigDecimal("0"));
assertEquals(dimensionColumnMetadata.getMinValue(), new BigDecimal("0"));
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column18");
assertEquals(dimensionColumnMetadata.getMaxValue(), 0);
assertEquals(dimensionColumnMetadata.getMinValue(), 0);
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column19");
assertEquals(dimensionColumnMetadata.getMaxValue().toString(), "0");
assertEquals(dimensionColumnMetadata.getMinValue().toString(), "0");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column20");
assertEquals(dimensionColumnMetadata.getMaxValue(), "null");
assertEquals(dimensionColumnMetadata.getMinValue(), "null");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column21");
assertEquals(dimensionColumnMetadata.getMaxValue(), "null");
assertEquals(dimensionColumnMetadata.getMinValue(), "null");
dimensionColumnMetadata = segmentMetadata.getColumnMetadataFor("column22");
assertEquals(dimensionColumnMetadata.getMaxValue().toString(), "");
assertEquals(dimensionColumnMetadata.getMinValue().toString(), "");
assertEquals(metricColumnMetadata.getMinValue(), 890662862);
assertEquals(metricColumnMetadata.getMaxValue(), 890662862);
}
Expand Down
36 changes: 36 additions & 0 deletions pinot-segment-local/src/test/resources/data/testDataMVSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,42 @@
"name": "column13",
"dataType": "INT"
},
{
"name": "column14",
"dataType": "LONG"
},
{
"name": "column15",
"dataType": "FLOAT"
},
{
"name": "column16",
"dataType": "DOUBLE"
},
{
"name": "column17",
"dataType": "BIG_DECIMAL"
},
{
"name": "column18",
"dataType": "BOOLEAN"
},
{
"name": "column19",
"dataType": "TIMESTAMP"
},
{
"name": "column20",
"dataType": "STRING"
},
{
"name": "column21",
"dataType": "JSON"
},
{
"name": "column22",
"dataType": "BYTES"
},
{
"name": "weeksSinceEpochSunday",
"dataType": "INT"
Expand Down

0 comments on commit e477afa

Please sign in to comment.