private void writeFieldTag()

in odps-sdk/odps-sdk-core/src/main/java/com/aliyun/odps/commons/proto/ProtobufRecordStreamWriter.java [166:205]


  private void writeFieldTag(int pbIdx, TypeInfo typeInfo) throws IOException {
    switch (typeInfo.getOdpsType()) {
      case DATETIME:
      case BOOLEAN:
      case BIGINT:
      case TINYINT:
      case SMALLINT:
      case INT:
      case DATE:
      case INTERVAL_YEAR_MONTH: {
        out.writeTag(pbIdx, WireFormat.WIRETYPE_VARINT);
        break;
      }
      case DOUBLE: {
        out.writeTag(pbIdx, WireFormat.WIRETYPE_FIXED64);
        break;
      }
      case FLOAT: {
        out.writeTag(pbIdx, WireFormat.WIRETYPE_FIXED32);
        break;
      }
      case JSON:
      case INTERVAL_DAY_TIME:
      case TIMESTAMP:
      case TIMESTAMP_NTZ:
      case STRING:
      case CHAR:
      case VARCHAR:
      case BINARY:
      case DECIMAL:
      case ARRAY:
      case MAP:
      case STRUCT:{
        out.writeTag(pbIdx, com.google.protobuf.WireFormat.WIRETYPE_LENGTH_DELIMITED);
        break;
      }
      default:
        throw new IOException("Invalid data type: " + typeInfo);
    }
  }