<commit_before>package com.splicemachine.derby.impl.sql.execute;

import com.gotometrics.orderly.*;
import com.splicemachine.derby.impl.store.access.hbase.HBaseRowLocation;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.io.StoredFormatIds;
import org.apache.derby.iapi.types.DataValueDescriptor;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.util.Bytes;

import java.io.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;

/**
 * @author <NAME>
 *         Created on: 2/25/13
 */
public class Serializer {
    private RowKey longRowKey;
    private RowKey intRowKey;
    private RowKey bytesRowKey;
    private RowKey decimalRowKey;
    private RowKey floatRowKey;
    private RowKey stringRowKey;

    public byte[] serialize(DataValueDescriptor descriptor) throws IOException, StandardException {
        if (descriptor.isNull()) {
            return new byte[] {};
        }
        if(descriptor instanceof HBaseRowLocation){
            return ((HBaseRowLocation)descriptor).getBytes();
        }

        if(descriptor instanceof LazyDataValueDescriptor){
            LazyDataValueDescriptor ldvd = (LazyDataValueDescriptor) descriptor;
            return ldvd.getBytes();<commit_msg>Removed one cast<commit_after>package com.splicemachine.derby.impl.sql.execute;

import com.gotometrics.orderly.*;
import com.splicemachine.derby.impl.store.access.hbase.HBaseRowLocation;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.services.io.StoredFormatIds;
import org.apache.derby.iapi.types.DataValueDescriptor;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.util.Bytes;

import java.io.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;

/**
 * @author <NAME>
 *         Created on: 2/25/13
 */
public class Serializer {
    private RowKey longRowKey;
    private RowKey intRowKey;
    private RowKey bytesRowKey;
    private RowKey decimalRowKey;
    private RowKey floatRowKey;
    private RowKey stringRowKey;

    public byte[] serialize(DataValueDescriptor descriptor) throws IOException, StandardException {
        if (descriptor.isNull()) {
            return new byte[] {};
        }
        if (descriptor.getTypeFormatId() == StoredFormatIds.ACCESS_HEAP_ROW_LOCATION_V1_ID)
            return descriptor.getBytes();

        if(descriptor instanceof LazyDataValueDescriptor){
            LazyDataValueDescriptor ldvd = (LazyDataValueDescriptor) descriptor;
            return ldvd.getBytes();
{'fraction_non_alphanumeric': 0.09734181954324223, 'fraction_numerical': 0.0041183077499064025, 'mean_word_length': 3.8318264014466545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6082404', 'n_tokens_mistral': 795, 'n_tokens_neox': 781, 'n_words': 157}