You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Akash Shah (Jira)" <ji...@apache.org> on 2020/10/16 06:20:00 UTC
[jira] [Created] (ARROW-10324) function
read_parquet(*,as_data_frame=TRUE) fails when embedded nuls present.
Akash Shah created ARROW-10324:
----------------------------------
Summary: function read_parquet(*,as_data_frame=TRUE) fails when embedded nuls present.
Key: ARROW-10324
URL: https://issues.apache.org/jira/browse/ARROW-10324
Project: Apache Arrow
Issue Type: Bug
Components: R
Reporter: Akash Shah
For the following code snippet
{code:java}
// code placeholder
library(arrow)
download.file('https://github.com/akashshah59/embedded_nul_parquet/raw/main/CC-MAIN-20200702045758-20200702075758-00007.parquet','sample.parquet')
read_parquet(file = 'sample.parquet',as_data_frame = TRUE)
{code}
I get -
{code:java}
Error in Table__to_dataframe(x, use_threads = option_use_threads()) : embedded nul in string: '\0 at \0'
{code}
| |
So, I thought, what if I could read the file as binaries and replace the embedded nul character \0 myself.
| {code:java}
parquet <- read_parquet(file = 'sample.parquet',as_data_frame = FALSE)
raw <- write_to_raw(parquet,format = "file")
print(raw)
{code}
|
In this case, I get an indecipherable stream of characters and nuls, which makes it very difficult to remove '00' characters that are problematic in the stream.
| {code:java}
[1] 41 52 52 4f 57 31 00 00 ff ff ff ff d0 02 00 00 10 00 00 00 00 00 0a 00 0c 00 06 00
[29] 05 00 08 00 0a 00 00 00 00 01 04 00 0c 00 00 00 08 00 08 00 00 00 04 00 08 00 00 00
[57] 04 00 00 00 0d 00 00 00 70 02 00 00 38 02 00 00 10 02 00 00 d0 01 00 00 a4 01 00 00
[85] 74 01 00 00 34 01 00 00 04 01 00 00 cc 00 00 00 9c 00 00 00 64 00 00 00 34 00 00 00
[113] 04 00 00 00 d4 fd ff ff 00 00 01 05 14 00 00 00 0c 00 00 00 04 00 00 00 00 00 00 00
[141] c4 fd ff ff 0a 00 00 00 77 61 72 63 5f 6c 61 6e 67 73 00 00 00 fe ff ff 00 00 01 05
[169] 14 00 00 00 0c 00 00 00 04 00 00 00 00 00 00 00 f0 fd ff ff 0b 00 00 00 6c 61 6e 67
[197] 5f 64 65 74 65 63 74 00 2c fe ff ff 00 00 01 03 18 00 00 00 0c 00 00 00 04 00
{code}
|
Is there a way to handle this while reading Apache parquet?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)