Details
Description
getMaxLength is not returning the correct length for char/varchar datatypes.
I see that getMaxLength is returning 255 for CHAR type and 65535 for VARCHAR type.
When I checked the same file using orcfiledump utility, I could see the correct lengths.
Here is the snippet of the code:
Reader _reader = OrcFile.createReader(new Path(_fileName),OrcFile.readerOptions(conf).filesystem(fs)) ;
TypeDescription metarec = _reader.getSchema() ;
List <TypeDescription> cols = metarec.getChildren();
List <String> colNames = metarec.getFieldNames();
for (int i=0; i < cols.size(); i++)
{
TypeDescription fieldSchema = cols.get;
switch (fieldSchema.getCategory())
{ case CHAR: header += "char(" + fieldSchema.getMaxLength() + ")" ; break; ---------- ---------- }}
Please let me know your pointers please.