asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xikui Wang <xik...@uci.edu>
Subject Questions of building record in AsterixDB
Date Fri, 29 Apr 2016 21:06:11 GMT
Hi devs,

I came across several questions while I was constructing records in
AsterixDB.  Hope someone can help me clear the confusion. :)

1. Write directly to data output or use SerializerDeserializer
I am working with AbstractDataParser now. I see people using different ways
to append attributes to data output. Either use:
output.Write(typetag.serialize());
output.WriteInt(0);
to write into data output directly, or
use AInt8SerializerDeserializer.serialize(int8Serde) to serialize a AINT8
instance to output. *SerializerDeserializer uses writeByte to write output.

My feeling is SerializerDeserializer offers another level of abstraction
but with output I can write value directly without construct AType object.
I am wondering if there are any preferences over these two?

2. RecordType validation after parser but before add to frame?
My observation is after parser finish writing the output and pass it to
next level, there is no such validation that checks whether non-optional
field is null or not. In other words, parser has to guarantee that the
processed records has to match the dataset definition(non-optional
attribute cannot have null value). I tried to assign null value to non-null
attributes. It will be inserted successfully but read records will have
problem.

3. Set to null or skip
For optional(nullable) attributes, if I want to insert a record with null
value on that attribute. Should I assign null value or should I just skip
it? (Probably this is related to the missing attribute that Yingyi
mentioned today?)

Thanks for your help.

Best,
Xikui

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message