public static GenericRowData decorateRowWithMetaData(
            GenericRowData physicalRowData,
            InLongMsgHead head,
            List<String> metadataKeys) {
        final int physicalArity = physicalRowData.getArity();
        final GenericRowData producedRow = new GenericRowData(
                physicalRowData.getRowKind(),
                physicalArity + metadataKeys.size());

        for (int i = 0; i < physicalArity; i++) {
            producedRow.setField(i, physicalRowData.getField(i));
        }

        for (int j = 0; j < metadataKeys.size(); j++) {
            if (metadataKeys.get(j).equals(STREAMID.getKey())) {
                producedRow.setField(physicalArity + j, StringData.fromString(head.getStreamId()));
            }
        }

        return producedRow;
    }
Creates the row with the given head fields and data row.

@param timeFieldName       The name of the time field. Null if the time field is not required.
@param attributesFieldName The name of the attributes field. Null if the attributes field is
                           not required.
@param time                The time of the inLongMsg.
@param attributes          The attributes of the inLongMsg.
@param dataRow             The data row.
@return The row decorated with head fields.
inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/InLongMsgUtils.java