generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Current IonClobSerilaizer implementation:
public override string Deserialize(IIonReader reader)
{
byte[] clob = new byte[reader.GetLobByteSize()];
reader.GetBytes(clob);
return Encoding.UTF8.GetString(clob);
}
public override void Serialize(IIonWriter writer, string item)
{
writer.WriteClob(Encoding.UTF8.GetBytes(item));
}Problems in current implementation:
- The Ion clob specification allows arbitrary interpretation of the raw binary data but current implementation only allows UTF-8 encoding, which seems weird because
stringin C# actually uses UTF-16 encoding. - The C#
stringtype will map to Ion string by default. So there is no use case for theSerialize(IIonWriter writer, string item)method to serialize a C# string to Ion clob, only theDeserializemethod will be used when deserializing Ion clob data.
We should consider:
- Allow encoding format to be passed in for Ion clob serde
- What's the proper mapping between Ion clob type and C# type, probably the clob should map to C# byte array
byte[]instead of the currentstringtype.
Metadata
Metadata
Assignees
Labels
No labels