[ https://issues.apache.org/jira/browse/PARQUET-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17421639#comment-17421639 ]
ASF GitHub Bot commented on PARQUET-2094: ----------------------------------------- rdblue commented on a change in pull request #933: URL: https://github.com/apache/parquet-mr/pull/933#discussion_r716970875 ########## File path: parquet-format-structures/src/main/java/org/apache/parquet/format/MetadataValidator.java ########## @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.parquet.format; + +/** + * Utility class to validate different types of Parquet metadata (e.g. footer, page headers etc.). + */ +public class MetadataValidator { + + /** + * A specific RuntimeException thrown when invalid values are found in the Parquet file metadata (including the + * footer, page header etc.). + */ + public static class InvalidParquetMetadataException extends RuntimeException { Review comment: Minor: I'd prefer it if the exception weren't an inner class since that makes it harder to reference. But this isn't a blocker. ########## File path: parquet-format-structures/src/main/java/org/apache/parquet/format/InvalidParquetMetadataException.java ########## @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.parquet.format; + +/** + * A specific RuntimeException thrown when invalid values are found in the Parquet file metadata (including the footer, + * page header etc.). + */ +public class InvalidParquetMetadataException extends RuntimeException { + <T> InvalidParquetMetadataException(String message) { Review comment: What is the type parameter for? ########## File path: parquet-format-structures/src/test/java/org/apache/parquet/format/TestUtil.java ########## @@ -23,13 +23,16 @@ import static junit.framework.Assert.assertNull; import static org.apache.parquet.format.Util.readFileMetaData; import static org.apache.parquet.format.Util.writeFileMetaData; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.IOException; +import org.apache.parquet.format.Util.DefaultFileMetaDataConsumer; import org.junit.Test; -import org.apache.parquet.format.Util.DefaultFileMetaDataConsumer; Review comment: Nit: unnecessary change. -- 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: dev-unsubscr...@parquet.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Handle negative values in page headers > -------------------------------------- > > Key: PARQUET-2094 > URL: https://issues.apache.org/jira/browse/PARQUET-2094 > Project: Parquet > Issue Type: Bug > Reporter: Gabor Szadovszky > Assignee: Gabor Szadovszky > Priority: Major > > There are integer values in the page headers that should be always positive > (e.g. length). I am not sure if we properly handle the cases if they are not > positive. -- This message was sent by Atlassian Jira (v8.3.4#803005)