shamim8888 / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

Serialization Issue #821

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am working on writing back Pregelix result graphs to Asterix. Therefore I 
need to do a type conversion before using a hyracks bulk load into a LSMBTree. 
Everything worked fine, the index was written, but Asterix could not read it 
correctly. I did some investigation on it and it seems like the serialization 
of ARecords is not working correctly.

I attached a testcase to show the issue.

It creates a record of the following type:
open {
  id: INT64,
  value: UNION(NULL, INT64),
  edges: {{ open {
  destVertexId: INT64,
  value: UNION(NULL, INT64)
}
 }}
}

with this values:
ARecord: { id: AInt64: {42}, value: AInt64: {0}, edges: AUnorderedList: [ 
ARecord: { destVertexId: AInt64: {0}, value: AInt64: {0} }, ARecord: { 
destVertexId: AInt64: {1}, value: AInt64: {0} }, ARecord: { destVertexId: 
AInt64: {2}, value: AInt64: {0} } ] }

I serialize it with the ARecordSerializerDeserializer and then read it back 
into an ARecordPointable. But the ARecordPointable is filled incorrectly and 
when I try to read the vertexId it throws an exception.

Original issue reported on code.google.com by holzemer...@googlemail.com on 13 Nov 2014 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago
in asterixdb, we didn't do const folding for a record, hence so far this bug 
does not cause query fails.  I remember there might be some inconsistencies 
between ARecordSerializerDeserializer and RecodBuilder/ARecordPointable.

Original comment by buyingyi@gmail.com on 13 Nov 2014 at 7:22

GoogleCodeExporter commented 9 years ago
It seems like the problem is the line recordBuilder.write(out, false) in 
ARecordSerializerDeserializer. 
I will prepare a patch to include a boolean writeTypeTag as a function 
parameter and also try to improve the performance of serialization.

Original comment by holzemer...@googlemail.com on 13 Nov 2014 at 9:07

GoogleCodeExporter commented 9 years ago

Original comment by buyingyi@gmail.com on 18 Nov 2014 at 4:50