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:









share|improve this question


















  • 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















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:









share|improve this question


















  • 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













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:









share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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














  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini