Merging Parquet Files - Pandas Meta in Schema Mismatch
up vote
0
down vote
favorite
I am trying to merge multiple parquet files into one. Their schemas are identical field-wise but my ParquetWriter
is complaining that they are not. After some investigation I found that the pandas meta in the schemas are different, causing this error.
Is it possible to ignore/merge/delete pandas meta? Do I even need pandas meta?
import pyarrow.parquet as pq
pq_tables=
for file_ in files:
pq_table = pq.read_table(f'{MESS_DIR}/{file_}')
pq_tables.append(pq_table)
if writer is None:
writer = pq.ParquetWriter(COMPRESSED_FILE, schema=pq_table.schema, use_deprecated_int96_timestamps=True)
writer.write_table(table=pq_table)
The exact error-
Traceback (most recent call last):
File "{PATH_TO}/main.py", line 68, in lambda_handler
writer.write_table(table=pq_table)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyarrow/parquet.py", line 335, in write_table
raise ValueError(msg)
ValueError: Table schema does not match schema used to create file:
python pandas parquet pyarrow
|
show 1 more comment
up vote
0
down vote
favorite
I am trying to merge multiple parquet files into one. Their schemas are identical field-wise but my ParquetWriter
is complaining that they are not. After some investigation I found that the pandas meta in the schemas are different, causing this error.
Is it possible to ignore/merge/delete pandas meta? Do I even need pandas meta?
import pyarrow.parquet as pq
pq_tables=
for file_ in files:
pq_table = pq.read_table(f'{MESS_DIR}/{file_}')
pq_tables.append(pq_table)
if writer is None:
writer = pq.ParquetWriter(COMPRESSED_FILE, schema=pq_table.schema, use_deprecated_int96_timestamps=True)
writer.write_table(table=pq_table)
The exact error-
Traceback (most recent call last):
File "{PATH_TO}/main.py", line 68, in lambda_handler
writer.write_table(table=pq_table)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyarrow/parquet.py", line 335, in write_table
raise ValueError(msg)
ValueError: Table schema does not match schema used to create file:
python pandas parquet pyarrow
1
Can you open an issue on the Apache Arrow JIRA instance about this?
– Wes McKinney
Nov 8 at 19:11
Sure. Created at issues.apache.org/jira/browse/ARROW-3728
– micah
Nov 8 at 19:27
@WesMcKinney Do you know of anything I can do in the meantime? No idea how long it will take for AA to solve this. Is it possible to remove the pandas meta and will that cause any problems?
– micah
Nov 8 at 19:44
1
It is possible but perhaps not obvious how to do it. Not very many Arrow people look at StackOverflow so I would suggest asking about this on the mailing list
– Wes McKinney
Nov 8 at 19:58
1
Yes that should work
– Wes McKinney
Nov 9 at 20:07
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to merge multiple parquet files into one. Their schemas are identical field-wise but my ParquetWriter
is complaining that they are not. After some investigation I found that the pandas meta in the schemas are different, causing this error.
Is it possible to ignore/merge/delete pandas meta? Do I even need pandas meta?
import pyarrow.parquet as pq
pq_tables=
for file_ in files:
pq_table = pq.read_table(f'{MESS_DIR}/{file_}')
pq_tables.append(pq_table)
if writer is None:
writer = pq.ParquetWriter(COMPRESSED_FILE, schema=pq_table.schema, use_deprecated_int96_timestamps=True)
writer.write_table(table=pq_table)
The exact error-
Traceback (most recent call last):
File "{PATH_TO}/main.py", line 68, in lambda_handler
writer.write_table(table=pq_table)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyarrow/parquet.py", line 335, in write_table
raise ValueError(msg)
ValueError: Table schema does not match schema used to create file:
python pandas parquet pyarrow
I am trying to merge multiple parquet files into one. Their schemas are identical field-wise but my ParquetWriter
is complaining that they are not. After some investigation I found that the pandas meta in the schemas are different, causing this error.
Is it possible to ignore/merge/delete pandas meta? Do I even need pandas meta?
import pyarrow.parquet as pq
pq_tables=
for file_ in files:
pq_table = pq.read_table(f'{MESS_DIR}/{file_}')
pq_tables.append(pq_table)
if writer is None:
writer = pq.ParquetWriter(COMPRESSED_FILE, schema=pq_table.schema, use_deprecated_int96_timestamps=True)
writer.write_table(table=pq_table)
The exact error-
Traceback (most recent call last):
File "{PATH_TO}/main.py", line 68, in lambda_handler
writer.write_table(table=pq_table)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pyarrow/parquet.py", line 335, in write_table
raise ValueError(msg)
ValueError: Table schema does not match schema used to create file:
python pandas parquet pyarrow
python pandas parquet pyarrow
asked Nov 8 at 18:49
micah
3,56112346
3,56112346
1
Can you open an issue on the Apache Arrow JIRA instance about this?
– Wes McKinney
Nov 8 at 19:11
Sure. Created at issues.apache.org/jira/browse/ARROW-3728
– micah
Nov 8 at 19:27
@WesMcKinney Do you know of anything I can do in the meantime? No idea how long it will take for AA to solve this. Is it possible to remove the pandas meta and will that cause any problems?
– micah
Nov 8 at 19:44
1
It is possible but perhaps not obvious how to do it. Not very many Arrow people look at StackOverflow so I would suggest asking about this on the mailing list
– Wes McKinney
Nov 8 at 19:58
1
Yes that should work
– Wes McKinney
Nov 9 at 20:07
|
show 1 more comment
1
Can you open an issue on the Apache Arrow JIRA instance about this?
– Wes McKinney
Nov 8 at 19:11
Sure. Created at issues.apache.org/jira/browse/ARROW-3728
– micah
Nov 8 at 19:27
@WesMcKinney Do you know of anything I can do in the meantime? No idea how long it will take for AA to solve this. Is it possible to remove the pandas meta and will that cause any problems?
– micah
Nov 8 at 19:44
1
It is possible but perhaps not obvious how to do it. Not very many Arrow people look at StackOverflow so I would suggest asking about this on the mailing list
– Wes McKinney
Nov 8 at 19:58
1
Yes that should work
– Wes McKinney
Nov 9 at 20:07
1
1
Can you open an issue on the Apache Arrow JIRA instance about this?
– Wes McKinney
Nov 8 at 19:11
Can you open an issue on the Apache Arrow JIRA instance about this?
– Wes McKinney
Nov 8 at 19:11
Sure. Created at issues.apache.org/jira/browse/ARROW-3728
– micah
Nov 8 at 19:27
Sure. Created at issues.apache.org/jira/browse/ARROW-3728
– micah
Nov 8 at 19:27
@WesMcKinney Do you know of anything I can do in the meantime? No idea how long it will take for AA to solve this. Is it possible to remove the pandas meta and will that cause any problems?
– micah
Nov 8 at 19:44
@WesMcKinney Do you know of anything I can do in the meantime? No idea how long it will take for AA to solve this. Is it possible to remove the pandas meta and will that cause any problems?
– micah
Nov 8 at 19:44
1
1
It is possible but perhaps not obvious how to do it. Not very many Arrow people look at StackOverflow so I would suggest asking about this on the mailing list
– Wes McKinney
Nov 8 at 19:58
It is possible but perhaps not obvious how to do it. Not very many Arrow people look at StackOverflow so I would suggest asking about this on the mailing list
– Wes McKinney
Nov 8 at 19:58
1
1
Yes that should work
– Wes McKinney
Nov 9 at 20:07
Yes that should work
– Wes McKinney
Nov 9 at 20:07
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214288%2fmerging-parquet-files-pandas-meta-in-schema-mismatch%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you open an issue on the Apache Arrow JIRA instance about this?
– Wes McKinney
Nov 8 at 19:11
Sure. Created at issues.apache.org/jira/browse/ARROW-3728
– micah
Nov 8 at 19:27
@WesMcKinney Do you know of anything I can do in the meantime? No idea how long it will take for AA to solve this. Is it possible to remove the pandas meta and will that cause any problems?
– micah
Nov 8 at 19:44
1
It is possible but perhaps not obvious how to do it. Not very many Arrow people look at StackOverflow so I would suggest asking about this on the mailing list
– Wes McKinney
Nov 8 at 19:58
1
Yes that should work
– Wes McKinney
Nov 9 at 20:07