Imported from previous forum
The specification seems oddly worded on how to apply the tail operator to a string field of varying length. For example if a field’s prior value were “A”, and “AB” is the field’s next value, then what tail value should be sent in the stream?
The main target of the tail operator is strings of equal length that often share a common prefix (like ISIN codes).
The tail operator happens to handle strings that grow, as in your example, but not strings that shrink.
The spec says in 6.3.8.1: “If the length of the tail value exceeds the length of the base value, the combined value becomes the tail value.”
Therefore the tail value sent in your example would be “AB”. This wouldn’t give you any compaction though.
In general, if the values of a string field varies in length, the delta operator is more suitable:
Since the string in your example is so short, the benefit would not be apparent, so I select two longer strings: “ABCDEFGH” and “ABCDEFGHI”:
Tail operator: the tail value is 9 bytes: “ABCDEFGHI”
Delta operator: the delta value is 2 bytes: 0"I"
/David
The specification seems oddly worded on how to apply the tail operator
to a string field of varying length. For example if a field’s prior
value were “A”, and “AB” is the field’s next value, then what tail value
should be sent in the stream?
[ original email was from John Cameron - john.cameron@orcsoftware.com ]
> The tail operator happens to handle strings that grow, as in your
example, but not strings that shrink.
Should a standard error be defined then for the case where the new String value is smaller than the previous value?
For example, prior value “AB”, next value “A” would result in an error?
You could, but I don’t think it is necessary. The errors defined in the spec tries to be decoder centric in general, that is, errors are defined for conditions that can be detected by inspecting an encoded FAST stream alone.
The case you describe is an issue for the communication between the application and your particular encoder so this could be regarded as an implementation issue.
/David
The tail operator happens to handle strings that grow, as in your
example, but not strings that shrink.Should a standard error be defined then for the case where the new
String value is smaller than the previous value?For example, prior value “AB”, next value “A” would result in an error?