echauchot commented on a change in pull request #15725:
URL: https://github.com/apache/flink/pull/15725#discussion_r648470072
##########
File path:
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetInputFormat.java
##########
@@ -97,7 +97,15 @@
*/
protected ParquetInputFormat(Path path, MessageType messageType) {
super(path);
- this.expectedFileSchema = checkNotNull(messageType, "messageType");
+ if (messageType == null) {
+ try {
+ this.expectedFileSchema = readParquetSchemaFromFile(path);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ this.expectedFileSchema = messageType;
+ }
Review comment:
"The constructor is not meant to do any I/O operations"
=> thank for the hint! Agreed
"I propose to simply leave the expectedFileSchema at null.
#open would then simply use reader schema = writer schema, which was
probably you intention."
=> Fair enough. Yes that was my intention indeed
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]