I have exported the azure cost data to the storage account in parquet format. while parsing that file getting data output as GenericData$Fixed in bytes. I don’t know how to get the original value from this.
I tried toString() that also returns the same. Tried BigInteger that also not works
The data type is org.apache.avro.generic.GenericData$Fixed
My code is
ParquetReader<GenericRecord> reader = null;
InputStream in = null;
try
{
in = new FileInputStream(new File("part_1_0001.parquet"));
ParquetStream parquetStream = new ParquetStream(String.valueOf(System.currentTimeMillis()), in);
ParquetConfiguration conf = new PlainParquetConfiguration();
conf.set(org.apache.parquet.avro.AvroReadSupport.READ_INT96_AS_FIXED, "true");
reader = AvroParquetReader
.<GenericRecord>builder(parquetStream,conf)
.build();
GenericRecord record;
while ((record = reader.read()) != null)
{
Object fieldValue = record.get(42);
// fieldValueOutput - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 121, -61, -40, 0]
}
}
catch(Exception e)
{
...
}
finally
{
if(reader != null)
{
try
{
reader.close();
}
catch(Exception e)
{
...
}
}
if(in!=null)
{
try
{
in.close();
}
catch(Exception e)
{
...
}
}
}
```
Anyone guide me to get the original value from this.