Hi,
I am working on the project to count the record in the protobuf file
but I get the exception

Exception in thread "main" java.lang.NoSuchMethodError: 
com.google.protobuf.CodedInputStream.shouldDiscardUnknownFields()Z

at 
com.google.protobuf.GeneratedMessageV3.parseUnknownField(GeneratedMessageV3.java:290)


This only happens on some of the protobuf files, not all of them has the 
issue.

Same code is working for files with different schema.


My protobuf file is gzipped.


//Here is the code 

Configuration conf = new Configuration();

FileSystem fs = FileSystem.get(conf);

Path path = new Path(<HDFS path to file>);

InputStream input = new GZIPInputStream(fs.open(path));

Message m;

while ((m = defaultMsg.getParserForType().parseDelimitedFrom(input)) != 
null) {

                recordCount++;

}


Does anyone have idea?


Thanks

David






-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to