Hive
  1. Hive
  2. HIVE-3868

Use Hive‘s serde to parse HBase’s byte Data in LazyHBaseRow

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0
    • Fix Version/s: None
    • Component/s: HBase Handler
    • Labels:
      None

      Description

      In LazyHBaseRow,

        private Object uncheckedGetField(int fieldID) {
                // it is a column i.e. a column-family with column-qualifier
                byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);
      
                if (res == null) {
                  return null;
                } else {
                  ref = new ByteArrayRef();
                  ref.setData(res);
                }
            if (ref != null) {
              fields[fieldID].init(ref, 0, ref.getData().length);
            }
        }
        For example, if the fields[fieldID] is Bigint, and ref stores HBase byte data (Long), 
        it will use LazyLong to parse this data and will return NULL value, 
        it should use Bytes.toLong(res.getData()) to parse this byte data
      

        Activity

        binlijin created issue -
        binlijin made changes -
        Field Original Value New Value
        Summary Use Hive‘s serde to parse HBase’s byte Data in LazyHBaseRow and Use Hive‘s serde to parse HBase’s byte Data in LazyHBaseRow
        binlijin made changes -
        Description In LazyHBaseRow,
        {code}
          private Object uncheckedGetField(int fieldID) {
                  // it is a column i.e. a column-family with column-qualifier
                  byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);

                  if (res == null) {
                    return null;
                  } else {
                    ref = new ByteArrayRef();
                    ref.setData(res);
                  }
              if (ref != null) {
                fields[fieldID].init(ref, 0, ref.getData().length);
              }
          }

        {code}
        In LazyHBaseRow,
        {code}
          private Object uncheckedGetField(int fieldID) {
                  // it is a column i.e. a column-family with column-qualifier
                  byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);

                  if (res == null) {
                    return null;
                  } else {
                    ref = new ByteArrayRef();
                    ref.setData(res);
                  }
              if (ref != null) {
                fields[fieldID].init(ref, 0, ref.getData().length);
              }
          }
          For example, if the fields[fieldID] is Bigint, and ref stores HBase byte data (Long), it will use LazyLong to parse this data and will return NULL value, it should use Bytes.toLong(res.getData()) to parse this byte data
        {code}
        binlijin made changes -
        Description In LazyHBaseRow,
        {code}
          private Object uncheckedGetField(int fieldID) {
                  // it is a column i.e. a column-family with column-qualifier
                  byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);

                  if (res == null) {
                    return null;
                  } else {
                    ref = new ByteArrayRef();
                    ref.setData(res);
                  }
              if (ref != null) {
                fields[fieldID].init(ref, 0, ref.getData().length);
              }
          }
          For example, if the fields[fieldID] is Bigint, and ref stores HBase byte data (Long), it will use LazyLong to parse this data and will return NULL value, it should use Bytes.toLong(res.getData()) to parse this byte data
        {code}
        In LazyHBaseRow,
        {code}
          private Object uncheckedGetField(int fieldID) {
                  // it is a column i.e. a column-family with column-qualifier
                  byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);

                  if (res == null) {
                    return null;
                  } else {
                    ref = new ByteArrayRef();
                    ref.setData(res);
                  }
              if (ref != null) {
                fields[fieldID].init(ref, 0, ref.getData().length);
              }
          }
          For example, if the fields[fieldID] is Bigint, and ref stores HBase byte data (Long),
          it will use LazyLong to parse this data and will return NULL value,
          it should use Bytes.toLong(res.getData()) to parse this byte data
        {code}

          People

          • Assignee:
            Unassigned
            Reporter:
            binlijin
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development