File tree Expand file tree Collapse file tree
main/java/org/apache/parquet
test/java/org/apache/parquet Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ public class ValidInt96Stats {
3434
3535 private static final Logger LOG = LoggerFactory .getLogger (ValidInt96Stats .class );
3636
37- // parquet-mr started emitting correct INT96 min/max statistics after 1.15 .0,
38- // so only releases strictly greater than 1.15.0 are trusted.
39- private static final SemanticVersion MINIMUM_PARQUET_MR_VERSION = new SemanticVersion (1 , 15 , 0 );
37+ // parquet-mr started emitting correct INT96 min/max statistics in 1.16 .0,
38+ // so only that release and later are trusted.
39+ private static final SemanticVersion MINIMUM_PARQUET_MR_VERSION = new SemanticVersion (1 , 16 , 0 );
4040
4141 /**
4242 * Decides if the statistics from a file created by createdBy (the created_by field from parquet format)
@@ -55,7 +55,7 @@ public static boolean hasValidInt96Stats(String createdBy) {
5555 ParsedVersion version = VersionParser .parse (createdBy );
5656 if ("parquet-mr" .equals (version .application )) {
5757 return version .hasSemanticVersion ()
58- && version .getSemanticVersion ().compareTo (MINIMUM_PARQUET_MR_VERSION ) > 0 ;
58+ && version .getSemanticVersion ().compareTo (MINIMUM_PARQUET_MR_VERSION ) >= 0 ;
5959 }
6060 if ("parquet-mr compatible Photon" .equals (version .application )) {
6161 return true ;
Original file line number Diff line number Diff line change @@ -33,18 +33,21 @@ public void testNullAndEmpty() {
3333
3434 @ Test
3535 public void testParquetMrValid () {
36- // Versions > 1.15 .0 should be valid
36+ // Versions >= 1.16 .0 should be valid
3737 assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.16.0" ));
38- assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.15 .1" ));
38+ assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.16 .1" ));
3939 assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 2.0.0" ));
4040 assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.16.0 (build abcd)" ));
41- assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.15 .1-SNAPSHOT" ));
41+ assertTrue (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.16 .1-SNAPSHOT" ));
4242 }
4343
4444 @ Test
4545 public void testParquetMrInvalid () {
46- // Versions <= 1.15 .0 should be invalid
46+ // Versions < 1.16 .0 should be invalid (including pre-releases of 1.16.0)
4747 assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.15.0" ));
48+ assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.15.1" ));
49+ assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.15.1-SNAPSHOT" ));
50+ assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.16.0-SNAPSHOT" ));
4851 assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.12.3" ));
4952 assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.14.0" ));
5053 assertFalse (ValidInt96Stats .hasValidInt96Stats ("parquet-mr version 1.12.3 (build abcd)" ));
You can’t perform that action at this time.
0 commit comments