Imported from previous forum
[ original email was from Darshan Khedekar - darshan.khedekar.ext@deutsche-boerse.com ]
Hi
Could a optional field without a FAST operator occupy a bit in the presence map?
Section 10.5.1
"An optional field with the constant operator will occupy a single bit. If the bit is set, the value is the initial value in the instruction context. If the bit is not set, the value is considered absent."
and
“If a field is optional and has no field operator, it is encoded with a nullable representation and the NULL is used to represent absence of a value. It will not occupy any bits in the presence map”
Could I have a data representation where a reserved bit in the presence map indicates whether the field occurs in the message sent? Or NULL representation is the only data representation allowed in this case?
Regards
Darshan
This was considered in earlier drafts of the specification but was dropped for consistency reasons before release.
The constant field case is an exception: since a constant field never has any extent in the stream a NULL value cannot be used and a bit in the presence map must be used instead.
If there will ever be a FAST 2.0 it will probably include a way to specify in the template if optionality should be encoded by NULL (as now) or by a bit in the presence map. The reason for wanting to do this configurable is that it depends on your input pattern which is the more space efficient approach.
Until then you can under some circumstances simulate this behavior by
using the operator without specifying an initial value, as in
This instruction will use a bit in the presence map. If it is set, the value is in the stream. If it is not set, the value is considered absent . You can think of it as if “NULL” is the default value.
The obvious limitation of this is that you cannot combine it with other operators.
/David
Hi
Could a optional field without a FAST operator occupy a bit in the
presence map?Section 10.5.1 “An optional field with the constant operator will
occupy a single bit. If the bit is set, the value is the initial value
in the instruction context. If the bit is not set, the value is
considered absent.”and
“If a field is optional and has no field operator, it is encoded with a
nullable representation and the NULL is used to represent absence of a
value. It will not occupy any bits in the presence map”Could I have a data representation where a reserved bit in the presence
map indicates whether the field occurs in the message sent? Or NULL
representation is the only data representation allowed in this case?Regards Darshan