Skip to content

Instantly share code, notes, and snippets.

@spullara
Created October 2, 2010 01:00
Show Gist options
  • Select an option

  • Save spullara/607125 to your computer and use it in GitHub Desktop.

Select an option

Save spullara/607125 to your computer and use it in GitHub Desktop.
KeyValue[] raw = result.raw();
for (KeyValue kv : raw) {
byte[] buffer = kv.getBuffer();
int offset = kv.getValueOffset();
int length = kv.getValueLength();
switch(buffer[kv.getQualifierOffset()]) {
case DATA_COLUMN_BYTE:
value = readValue(buffer, schema, format, offset, length);
break;
case VERSION_COLUMN_BYTE:
version = Bytes.toLong(buffer, offset, length);
break;
case FORMAT_COLUMN_BYTE:
format = AvroFormat.values()[Bytes.toInt(buffer, offset, length)];
break;
case SCHEMA_COLUMN_BYTE:
schema = loadSchema(row, schemaBytes, offset, length);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment