static int encodingBytesLength(String fieldName) {
    Preconditions.checkArgument(fieldName.length() > 0);
    for (int i = 0; i < fieldName.length(); i++) {
      char c = fieldName.charAt(i);
      if (c < 48) {
        return 8;
      }
      if (c > 57 && c < 65) {
        return 8;
      }
      if (c > 90 && c < 97) {
        return 8;
      }
      if (c > 122) {
        return 8;
      }
    }
    // Every char range: 10 + 26 * 2 = 62, which can be represented by 6 bits(0~63(0b111111))
    return (int) Math.ceil(fieldName.length() * 6.0 / 8);
  }
@Test
  public void testEncodingBytesLength() {
    Assert.assertEquals(encodingBytesLength("abc"), 3);
    Assert.assertEquals(encodingBytesLength("abcd12345"), 7);
    Assert.assertEquals(encodingBytesLength("abcd1234abcd"), 9);
  }