[ 
https://issues.apache.org/jira/browse/PARQUET-2094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17420552#comment-17420552
 ] 

ASF GitHub Bot commented on PARQUET-2094:
-----------------------------------------

gszadovszky commented on a change in pull request #933:
URL: https://github.com/apache/parquet-mr/pull/933#discussion_r716453533



##########
File path: 
parquet-format-structures/src/test/java/org/apache/parquet/format/TestUtil.java
##########
@@ -77,6 +81,21 @@ public void testReadFileMetadata() throws Exception {
     assertEquals(md, md6);
   }
 
+  @Test
+  public void testInvalidPageHeader() throws IOException {
+    PageHeader ph = new PageHeader(PageType.DATA_PAGE, 100, -50);
+    ByteArrayOutputStream out = new ByteArrayOutputStream();
+    Util.writePageHeader(ph, out);
+
+    try {
+      Util.readPageHeader(in(out));
+      fail("Expected exception but did not thrown");
+    } catch (InvalidParquetMetadataException e) {
+      assertTrue("Exception message does not contain the expected parts",
+          e.getMessage().contains("pageHeader.compressed_page_size"));

Review comment:
       Yes, there is something already implemented but in another module and I 
cannot use it here.




-- 
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)

Reply via email to