You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ahmed-mez (via GitHub)" <gi...@apache.org> on 2025/10/24 08:01:56 UTC

[I] Cannot read Parquet files with multiple dictionary pages per column chunk [arrow-go]

ahmed-mez opened a new issue, #546:
URL: https://github.com/apache/arrow-go/issues/546

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   The `pqarrow.NewFileReader` API fails to read valid Parquet files that contain multiple dictionary pages within a single column chunk. This prevents reading files created by Apache DataFusion for instance.
   
   Error:
   ```
   parquet: column chunk cannot have more than one dictionary.
   ````
   
   ### Component(s)
   
   Parquet


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary columns [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3451833942

   Is there any way you can share the file so that I can try debugging this to figure out where the failure is?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary pages per column chunk [arrow-go]

Posted by "ahmed-mez (via GitHub)" <gi...@apache.org>.
ahmed-mez commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3451294277

   After analyzing the parquet file, it turned out it doesn't contain more than one dictionary per column chunk
   
   ```
   Column chunk details:
   
   Row group 0:
       #         Start..End       Length  Compr        Pages (Dict/Data/Data2)  Encoding  Column
       0         4..1703              1699  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  service
       1      1703..3823              2120  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  eventSource
       2      3823..646667          642844  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  userIdentity.accessKeyId
       3    646667..801759          155092  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  error.kind
       4    801759..1444201         642442  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  evt.name
       5   1444201..1474854          30653  ZSTD(ZstdLevel(1))  0/52/0                    PLAIN,RLE  readOnly
       6   1474854..2874322        1399468  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  requestParameters.bucketName
       7   2874322..2977916         103594  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  timestamp_15m
       8   2977916..3050896          72980  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  c
   
   Row group 1:
       #         Start..End       Length  Compr        Pages (Dict/Data/Data2)  Encoding  Column
       0   3050896..3052595           1699  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  service
       1   3052595..3054715           2120  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  eventSource
       2   3054715..3715634         660919  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  userIdentity.accessKeyId
       3   3715634..3874366         158732  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  error.kind
       4   3874366..4522725         648359  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  evt.name
       5   4522725..4553895          31170  ZSTD(ZstdLevel(1))  0/52/0                    PLAIN,RLE  readOnly
       6   4553895..6019977        1466082  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  requestParameters.bucketName
       7   6019977..6145346         125369  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  timestamp_15m
       8   6145346..6214264          68918  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  c
   
   Row group 2:
       #         Start..End       Length  Compr        Pages (Dict/Data/Data2)  Encoding  Column
       0   6214264..6215963           1699  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  service
       1   6215963..6218083           2120  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  eventSource
       2   6218083..6825052         606969  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  userIdentity.accessKeyId
       3   6825052..6988989         163937  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  error.kind
       4   6988989..7581128         592139  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  evt.name
       5   7581128..7608627          27499  ZSTD(ZstdLevel(1))  0/52/0                    PLAIN,RLE  readOnly
       6   7608627..9075469        1466842  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  requestParameters.bucketName
       7   9075469..9202434         126965  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  timestamp_15m
       8   9202434..9277896          75462  ZSTD(ZstdLevel(1))  1/52/0                    PLAIN,RLE,RLE_DICTIONARY  c
   
   Row group 3:
       #         Start..End       Length  Compr        Pages (Dict/Data/Data2)  Encoding  Column
       0   9277896..9278605            709  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  service
       1   9278605..9279488            883  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  eventSource
       2   9279488..9516621         237133  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  userIdentity.accessKeyId
       3   9516621..9575303          58682  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  error.kind
       4   9575303..9807613         232310  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  evt.name
       5   9807613..9818010          10397  ZSTD(ZstdLevel(1))  0/21/0                    PLAIN,RLE  readOnly
       6   9818010..10427902        609892  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  requestParameters.bucketName
       7  10427902..10482990         55088  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  timestamp_15m
       8  10482990..10510987         27997  ZSTD(ZstdLevel(1))  1/21/0                    PLAIN,RLE,RLE_DICTIONARY  c
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary pages per column chunk [arrow-go]

Posted by "ahmed-mez (via GitHub)" <gi...@apache.org>.
ahmed-mez commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3450548473

   Hi @zeroshade 
   
   In case it helps, I'm able to read the file using `pyarrow` and the `./parquet_reader` [Go CLI](https://github.com/apache/arrow-go/tree/main/parquet/cmd/parquet_reader). Which is a strong evidence that the file is valid.
   
   The following code fails to read the same file though with `parquet: column chunk cannot have more than one dictionary`
   ```golang
   	data, err := os.ReadFile("file.parquet")
   	if err != nil {	
   		panic(err)
   	}
   	mem := memory.DefaultAllocator
   	pf, err := pqfile.NewParquetReader(bytes.NewReader(data), pqfile.WithReadProps(parquet.NewReaderProperties(mem)))
   	if err != nil {
   		panic(err)
   	}
   
   	reader, err := pqarrow.NewFileReader(pf, pqarrow.ArrowReadProperties{Parallel: true, BatchSize: pf.NumRows()}, mem)
   	if err != nil {
   		panic(err)
   	}
   
   	rr, err := reader.GetRecordReader(context.Background(), nil, nil)
   	if err != nil {
   		panic(err)
   	}
   	defer rr.Release()
   
   	for {
   		rec, err := rr.Read()
   		if err == io.EOF {
   			break
   		}
   		if err != nil {
   			panic(err)
   		}
   	}
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary columns [arrow-go]

Posted by "freakyzoidberg (via GitHub)" <gi...@apache.org>.
freakyzoidberg commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3453483371

   Added a reproducer and what I think to be a fix https://github.com/apache/arrow-go/pull/551
   
   Also, here a parquet that'll trigger the issue @ahmed-mez on reproducer https://limewire.com/d/jdwKs#LqvOH2CBGT


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary columns [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade closed issue #546: Cannot read Parquet files with multiple dictionary columns
URL: https://github.com/apache/arrow-go/issues/546


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary pages per column chunk [arrow-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3443686856

   According to the Parquet spec, as far as I'm aware, a column chunk is only allowed to have a single dictionary page. Which means that containing multiple dictionary pages in a single column chunk is not a valid Parquet file and if DataFusion is creating a file like that, that's a bug in DataFusion.
   
   @pitrou @wgtmac can either of you confirm for me that I'm not misreading the format and spec?


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary columns [arrow-go]

Posted by "ahmed-mez (via GitHub)" <gi...@apache.org>.
ahmed-mez commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3455276658

   Thank you @freakyzoidberg !
   
   I'm hitting a different error ( `not implemented`) due to the lack of support for chunked arrays in `pqarrow` now but that's a separate topic. What would you recommend @zeroshade ? I can create a separate issue for that.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Cannot read Parquet files with multiple dictionary columns [arrow-go]

Posted by "ahmed-mez (via GitHub)" <gi...@apache.org>.
ahmed-mez commented on issue #546:
URL: https://github.com/apache/arrow-go/issues/546#issuecomment-3452264011

   @zeroshade I can't share the file as-is publicly given the sensitivity of the data. I wasn't able to create a synthetic reproducer for now, but I'll keep working on providing a clean reproducer.
   
   In the meantime, feel free to share any debug instructions. I can build and run arrow-go with additional debug logging for instance and report back my findings.
   
   Thanks for your patience!


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org