docs: private void addColumnValue(Object value, VoltType columnType, int col) {
          // schema checking code that is used for some tests
          boolean allowNulls = true;
          int maxColSize = VoltType.MAX_VALUE_LENGTH;
          if (m_extraMetadata != null) {
              allowNulls = m_extraMetadata.originalColumnInfos[col].nullable;
              maxColSize = m_extraMetadata.originalColumnInfos[col].size;
          }
  
          if (VoltType.isVoltNullValue(value)) {
              // schema checking code that is used for some tests
              // allowNulls should always be true in production
              if (allowNulls == false) {
                  throw new IllegalArgumentException(
                          String.format("Column %s at index %d doesn't allow NULL values.",
                          getColumnName(col), col));
              }
  
              switch (columnType) {
              case TINYINT:
                  m_buffer.put(VoltType.NULL_TINYINT);
                  break;
              case SMALLINT:
                  m_buffer.putShort(VoltType.NULL_SMALLINT);
                  break;
              case INTEGER:
                  m_buffer.putInt(VoltType.NULL_INTEGER);
                  break;
              case TIMESTAMP:
                  m_buffer.putLong(VoltType.NULL_BIGINT);
                  break;
              case BIGINT:
                  m_buffer.putLong(VoltType.NULL_BIGINT);
                  break;
              case FLOAT:
                  m_buffer.putDouble(VoltType.NULL_FLOAT);
                  break;
              case STRING:
              case GEOGRAPHY:
              case VARBINARY:
                  m_buffer.putInt(NULL_STRING_INDICATOR);
                  break;
              case GEOGRAPHY_POINT:
                  GeographyPointValue.serializeNull(m_buffer);
                  break;
              case DECIMAL:
                  VoltDecimalHelper.serializeNull(m_buffer);
                  break;
  
              default:
                  throw new VoltTypeException("Unsupported type: " +
                          columnType);
              }
          }
          else {
  
              // Allow implicit conversions across all numeric types
              // except BigDecimal and anything else. Require BigDecimal
              // and reject Long128. Convert byte[] to VoltType.STRING.
              // Allow longs to be converted to VoltType.TIMESTAMPS.
  
              // In all error paths, catch ClassCastException
              // and VoltTypeException to restore
              // the correct table state.
              // XXX consider adding a fast path that checks for
              // equivalent types of input and column
  
              try {
                  switch (columnType) {
                  case TINYINT:
                      if (value instanceof BigDecimal) {
                          throw new ClassCastException();
                      }
                      final Number n1 = (Number) value;
                      if (columnType.wouldCastOverflow(n1)) {
                          throw new VoltTypeException("Cast of " +
                                  n1.doubleValue() +
                                  " to " +
                                  columnType.toString() +
                                  " would overflow");
                      }
                      m_buffer.put(n1.byteValue());
                      break;
                  case SMALLINT:
                      if (value instanceof BigDecimal) {
                          throw new ClassCastException();
                      }
                      final Number n2 = (Number) value;
                      if (columnType.wouldCastOverflow(n2)) {
                          throw new VoltTypeException("Cast to " +
                                  columnType.toString() +
                                  " would overflow");
                      }
                      m_buffer.putShort(n2.shortValue());
                      break;
                  case INTEGER:
                      if (value instanceof BigDecimal) {
                          throw new ClassCastException();
                      }
                      final Number n3 = (Number) value;
                      if (columnType.wouldCastOverflow(n3)) {
                          throw new VoltTypeException("Cast to " +
                                  columnType.toString() +
                                  " would overflow");
                      }
                      m_buffer.putInt(n3.intValue());
                      break;
                  case BIGINT:
                      if (value instanceof BigDecimal) {
                          throw new ClassCastException();
                      }
                      final Number n4 = (Number) value;
                      if (columnType.wouldCastOverflow(n4)) {
                          throw new VoltTypeException("Cast to " +
                                  columnType.toString() +
                                  " would overflow");
                      }
                      m_buffer.putLong(n4.longValue());
                      break;
  
                  case FLOAT:
                      if (value instanceof BigDecimal) {
                          throw new ClassCastException();
                      }
                      final Number n5 = (Number) value;
                      if (columnType.wouldCastOverflow(n5)) {
                          throw new VoltTypeException("Cast to " +
                                  columnType.toString() +
                                  " would overflow");
                      }
                      m_buffer.putDouble(n5.doubleValue());
                      break;
  
                  case STRING: {
                      // Accept byte[] and String
                      if (value instanceof byte[]) {
                          if (((byte[]) value).length > maxColSize) {
                              throw new VoltOverflowException(
                                      "Value in VoltTable.addRow(...) larger than allowed max " +
                                              VoltType.humanReadableSize(maxColSize));
                          }
  
                          // bytes MUST be a UTF-8 encoded string.
                          assert(testForUTF8Encoding((byte[]) value));
                          writeStringOrVarbinaryToBuffer((byte[]) value, m_buffer);
                      }
                      else {
                          if (((String) value).length() > maxColSize) {
                              throw new VoltOverflowException(
                                      "Value in VoltTable.addRow(...) larger than allowed max " +
                                              VoltType.humanReadableSize(maxColSize));
                          }
  
                          writeStringToBuffer((String) value, ROWDATA_ENCODING, m_buffer);
                      }
                      break;
                  }
  
                  case VARBINARY: {
                      // Accept byte[] and String (hex-encoded)
                      if (value instanceof String) {
                          value = Encoder.hexDecode((String) value);
                      }
                      if (value instanceof byte[]) {
                          if (((byte[]) value).length > maxColSize) {
                              throw new VoltOverflowException(
                                      "Value in VoltTable.addRow(...) larger than allowed max " +
                                              VoltType.humanReadableSize(maxColSize));
                          }
                          writeStringOrVarbinaryToBuffer((byte[]) value, m_buffer);
                      }
                      else {
                          throw new ClassCastException();
                      }
                      break;
                  }
  
                  case GEOGRAPHY: {
                      GeographyValue gv = (GeographyValue)value;
                      m_buffer.putInt(gv.getLengthInBytes());
                      gv.flattenToBuffer(m_buffer);
                      break;
                  }
  
                  case GEOGRAPHY_POINT: {
                      GeographyPointValue pt = (GeographyPointValue)value;
                      pt.flattenToBuffer(m_buffer);
                      break;
                  }
  
                  case TIMESTAMP: {
                      if (value instanceof BigDecimal) {
                          throw new ClassCastException();
                      }
                      long micros;
                      // Accept long and TimestampType and any kind of Date
                      if (value instanceof java.util.Date ||
                              value instanceof TimestampType) {
                           micros = ParameterSet.timestampToMicroseconds(value);
                      }
                      else {
                          micros = ((Number) value).longValue();
                      }
                      m_buffer.putLong(micros);
                      break;
                  }
  
                  case DECIMAL: {
                      // Only accept BigDecimal; rely on class cast exception for error path
                      VoltDecimalHelper.serializeBigDecimal( (BigDecimal)value, m_buffer);
                      break;
                  }
  
                  default:
                      throw new VoltTypeException("Unsupported type: " + columnType);
                  }
              }
              catch (ClassCastException cce) {
                  throw new VoltTypeException("Value for column " + col + " (" +
                          getColumnName(col) + ") is type " +
                          value.getClass().getSimpleName() + " when type " + columnType +
                          " was expected.");
              }
          }
      }