[storm] Should storm have separate String and Blob datatypes?

James Henstridge james at jamesh.id.au
Tue Jun 30 10:26:29 BST 2009


On Tue, Jun 30, 2009 at 6:17 AM, Jason Baker<jbaker at zeomega.com> wrote:
> As of right now, it looks like storm provides one datatype for
> VARCHAR2 and Binary data.  This makes sense for databases like MySQL
> and Postgres where you can essentially treat them as the same
> datatype.  So for instance, this will work under MySQL:
[snip]
> Would there be enough of a benefit for everybody to have separate
> classes for binary and ascii data, or is this something we should just
> use internally?

The recommended way to use Storm is to use the Unicode property type
for text columns (char, varchar, text, etc), and the RawStr property
type for binary data.  Storm will take care of encoding the unicode
strings in the queries.  The properties are designed so that you can't
assign a byte string directly  to a Unicode column and can't assign a
unicode string to a RawStr column.

There are tests for this which use the MySQL BLOB data type.  I'm not
sure how the rules for blobs compare with those for the BINARY type.

James.



More information about the storm mailing list