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

Joris Van den Bossche commented on ARROW-11024:
-----------------------------------------------

Yes, it could also be reproduced using pyarrow 2.0 with the smaller dataset 
when limiting the size of the row groups:

{code}
In [47]: import pyarrow as pa
    ...: import pyarrow.parquet as pq
    ...: 
    ...: # Write small amount of data to parquet file, and read it back. In 
this case, both tables are equal.
    ...: data1 = [[{'x':'abc','y':'abc'}]]*100 + [[{'x':'abc','y':'gcb'}]]*100
    ...: array1 = pa.array(data1)
    ...: table1 = pa.table([array1],names=['column'])
    ...: pq.write_table(table1,'temp1.parquet', row_group_size=20)
    ...: table1_1 = pq.read_table('temp1.parquet')
    ...: print(table1_1.equals(table1))
False
{code}

So this was fixed by ARROW-10493. Adding an additional python test maybe can't 
hurt. Will quickly do that.

> [C++][Parquet] Writing List<Struct> to parquet sometimes writes wrong data
> --------------------------------------------------------------------------
>
>                 Key: ARROW-11024
>                 URL: https://issues.apache.org/jira/browse/ARROW-11024
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 2.0.0
>         Environment: macOS Catalina, Python 3.7.3, Pyarrow 2.0.0
>            Reporter: George Deamont
>            Priority: Major
>
>  Sometimes when writing tables that contain List<Struct> columns, the data is 
> written incorrectly. Here is a code sample that produces the error. There are 
> no exceptions raised here, but a simple equality check via equals() yields 
> False for the second test case... 
>  
> {code:java}
> import pyarrow as pa
> import pyarrow.parquet as pq
> # Write small amount of data to parquet file, and read it back. In this case, 
> both tables are equal.
> data1 = [[{'x':'abc','y':'abc'}]]*100 + [[{'x':'abc','y':'gcb'}]]*100
> array1 = pa.array(data1)
> table1 = pa.table([array1],names=['column'])
> pq.write_table(table1,'temp1.parquet')
> table1_1 = pq.read_table('temp1.parquet')
> print(table1_1.equals(table1))
> # Write larger amount of data to parquet file, and read it back. In this 
> case, the tables are not equal.
> data2 = data1*100
> array2 = pa.array(data2)
> table2 = pa.table([array2],names=['column'])
> pq.write_table(table2,'temp2.parquet')
> table2_1 = pq.read_table('temp2.parquet')
> print(table2_1.equals(table2))
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to