[ 
https://issues.apache.org/jira/browse/HIVE-11207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Svetozar Ivanov updated HIVE-11207:
-----------------------------------
    Description: 
{code}
    kvs.add(new KeyValue(rowKey, cfa, qualByte, Bytes.toBytes("123")));
    kvs.add(new KeyValue(rowKey, cfb, qualShort, Bytes.toBytes("456")));
    kvs.add(new KeyValue(rowKey, cfc, qualInt, Bytes.toBytes("789")));
    kvs.add(new KeyValue(rowKey, cfa, qualLong, Bytes.toBytes("1000")));
    kvs.add(new KeyValue(rowKey, cfb, qualFloat, Bytes.toBytes("-0.01")));
    kvs.add(new KeyValue(rowKey, cfc, qualDouble, Bytes.toBytes("5.3")));
    kvs.add(new KeyValue(rowKey, cfa, qualString, Bytes.toBytes("Hadoop, HBase, 
and Hive")));
    kvs.add(new KeyValue(rowKey, cfb, qualBool, Bytes.toBytes("true")));
    Collections.sort(kvs, KeyValue.COMPARATOR);

    Result r = new Result(kvs);

    Put p = new Put(rowKey);

    p.add(cfa, qualByte, Bytes.toBytes("123"));
    p.add(cfb, qualShort, Bytes.toBytes("456"));
    p.add(cfc, qualInt, Bytes.toBytes("789"));
    p.add(cfa, qualLong, Bytes.toBytes("1000"));
    p.add(cfb, qualFloat, Bytes.toBytes("-0.01"));
    p.add(cfc, qualDouble, Bytes.toBytes("5.3"));
    p.add(cfa, qualString, Bytes.toBytes("Hadoop, HBase, and Hive"));
    p.add(cfb, qualBool, Bytes.toBytes("true"));

{code}

should be 

{code}
    List<KeyValue> kvs = new ArrayList<KeyValue>();

    kvs.add(new KeyValue(rowKey, cfa, qualByte, new byte[]{123}));
    kvs.add(new KeyValue(rowKey, cfb, qualShort, Bytes.toBytes((short) 456)));
    kvs.add(new KeyValue(rowKey, cfc, qualInt, Bytes.toBytes(789)));
    kvs.add(new KeyValue(rowKey, cfa, qualLong, Bytes.toBytes(1000L)));
    kvs.add(new KeyValue(rowKey, cfb, qualFloat, Bytes.toBytes(-0.01f)));
    kvs.add(new KeyValue(rowKey, cfc, qualDouble, Bytes.toBytes(5.3)));
    kvs.add(new KeyValue(rowKey, cfa, qualString, Bytes.toBytes("Hadoop, HBase, 
and Hive")));
    kvs.add(new KeyValue(rowKey, cfb, qualBool, Bytes.toBytes(true)));
    Collections.sort(kvs, KeyValue.COMPARATOR);

    Result r = new Result(kvs);

    Put p = new Put(rowKey,putTimestamp);

    p.add(cfa, qualByte, new byte[]{123});
    p.add(cfb, qualShort, Bytes.toBytes((short) 456));
    p.add(cfc, qualInt, Bytes.toBytes(789));
    p.add(cfa, qualLong, Bytes.toBytes(1000L));
    p.add(cfb, qualFloat, Bytes.toBytes(-0.01f));
    p.add(cfc, qualDouble, Bytes.toBytes(5.3));
    p.add(cfa, qualString, Bytes.toBytes("Hadoop, HBase, and Hive"));
    p.add(cfb, qualBool, Bytes.toBytes(true));
{code}


  was:
{code}

byte [] cfa = "cola".getBytes();
    byte [] cfb = "colb".getBytes();
    byte [] cfc = "colc".getBytes();

    byte [] qualByte = "byte".getBytes();
    byte [] qualShort = "short".getBytes();
    byte [] qualInt = "int".getBytes();
    byte [] qualLong = "long".getBytes();
    byte [] qualFloat = "float".getBytes();
    byte [] qualDouble = "double".getBytes();
    byte [] qualString = "string".getBytes();
    byte [] qualBool = "boolean".getBytes();

    byte [] rowKey = Bytes.toBytes("test-row1");

    // Data
    List<KeyValue> kvs = new ArrayList<KeyValue>();

    kvs.add(new KeyValue(rowKey, cfa, qualByte, Bytes.toBytes("123")));
    kvs.add(new KeyValue(rowKey, cfb, qualShort, Bytes.toBytes("456")));
    kvs.add(new KeyValue(rowKey, cfc, qualInt, Bytes.toBytes("789")));
    kvs.add(new KeyValue(rowKey, cfa, qualLong, Bytes.toBytes("1000")));
    kvs.add(new KeyValue(rowKey, cfb, qualFloat, Bytes.toBytes("-0.01")));
    kvs.add(new KeyValue(rowKey, cfc, qualDouble, Bytes.toBytes("5.3")));
    kvs.add(new KeyValue(rowKey, cfa, qualString, Bytes.toBytes("Hadoop, HBase, 
and Hive")));
    kvs.add(new KeyValue(rowKey, cfb, qualBool, Bytes.toBytes("true")));
    Collections.sort(kvs, KeyValue.COMPARATOR);

    Result r = new Result(kvs);

    Put p = new Put(rowKey);

    p.add(cfa, qualByte, Bytes.toBytes("123"));
    p.add(cfb, qualShort, Bytes.toBytes("456"));
    p.add(cfc, qualInt, Bytes.toBytes("789"));
    p.add(cfa, qualLong, Bytes.toBytes("1000"));
    p.add(cfb, qualFloat, Bytes.toBytes("-0.01"));
    p.add(cfc, qualDouble, Bytes.toBytes("5.3"));
    p.add(cfa, qualString, Bytes.toBytes("Hadoop, HBase, and Hive"));
    p.add(cfb, qualBool, Bytes.toBytes("true"));

{code}


> org.apache.hadoop.hive.hbase.TestHBaseSerDe should use numeric data types 
> instead strings 
> ------------------------------------------------------------------------------------------
>
>                 Key: HIVE-11207
>                 URL: https://issues.apache.org/jira/browse/HIVE-11207
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Svetozar Ivanov
>            Assignee: Svetozar Ivanov
>            Priority: Minor
>
> {code}
>     kvs.add(new KeyValue(rowKey, cfa, qualByte, Bytes.toBytes("123")));
>     kvs.add(new KeyValue(rowKey, cfb, qualShort, Bytes.toBytes("456")));
>     kvs.add(new KeyValue(rowKey, cfc, qualInt, Bytes.toBytes("789")));
>     kvs.add(new KeyValue(rowKey, cfa, qualLong, Bytes.toBytes("1000")));
>     kvs.add(new KeyValue(rowKey, cfb, qualFloat, Bytes.toBytes("-0.01")));
>     kvs.add(new KeyValue(rowKey, cfc, qualDouble, Bytes.toBytes("5.3")));
>     kvs.add(new KeyValue(rowKey, cfa, qualString, Bytes.toBytes("Hadoop, 
> HBase, and Hive")));
>     kvs.add(new KeyValue(rowKey, cfb, qualBool, Bytes.toBytes("true")));
>     Collections.sort(kvs, KeyValue.COMPARATOR);
>     Result r = new Result(kvs);
>     Put p = new Put(rowKey);
>     p.add(cfa, qualByte, Bytes.toBytes("123"));
>     p.add(cfb, qualShort, Bytes.toBytes("456"));
>     p.add(cfc, qualInt, Bytes.toBytes("789"));
>     p.add(cfa, qualLong, Bytes.toBytes("1000"));
>     p.add(cfb, qualFloat, Bytes.toBytes("-0.01"));
>     p.add(cfc, qualDouble, Bytes.toBytes("5.3"));
>     p.add(cfa, qualString, Bytes.toBytes("Hadoop, HBase, and Hive"));
>     p.add(cfb, qualBool, Bytes.toBytes("true"));
> {code}
> should be 
> {code}
>     List<KeyValue> kvs = new ArrayList<KeyValue>();
>     kvs.add(new KeyValue(rowKey, cfa, qualByte, new byte[]{123}));
>     kvs.add(new KeyValue(rowKey, cfb, qualShort, Bytes.toBytes((short) 456)));
>     kvs.add(new KeyValue(rowKey, cfc, qualInt, Bytes.toBytes(789)));
>     kvs.add(new KeyValue(rowKey, cfa, qualLong, Bytes.toBytes(1000L)));
>     kvs.add(new KeyValue(rowKey, cfb, qualFloat, Bytes.toBytes(-0.01f)));
>     kvs.add(new KeyValue(rowKey, cfc, qualDouble, Bytes.toBytes(5.3)));
>     kvs.add(new KeyValue(rowKey, cfa, qualString, Bytes.toBytes("Hadoop, 
> HBase, and Hive")));
>     kvs.add(new KeyValue(rowKey, cfb, qualBool, Bytes.toBytes(true)));
>     Collections.sort(kvs, KeyValue.COMPARATOR);
>     Result r = new Result(kvs);
>     Put p = new Put(rowKey,putTimestamp);
>     p.add(cfa, qualByte, new byte[]{123});
>     p.add(cfb, qualShort, Bytes.toBytes((short) 456));
>     p.add(cfc, qualInt, Bytes.toBytes(789));
>     p.add(cfa, qualLong, Bytes.toBytes(1000L));
>     p.add(cfb, qualFloat, Bytes.toBytes(-0.01f));
>     p.add(cfc, qualDouble, Bytes.toBytes(5.3));
>     p.add(cfa, qualString, Bytes.toBytes("Hadoop, HBase, and Hive"));
>     p.add(cfb, qualBool, Bytes.toBytes(true));
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to