Source:
<code>static AggregateMetadata build(KeyspaceMetadata ksm, Row row, VersionNumber version, Cluster cluster) { CodecRegistry codecRegistry = cluster.getConfiguration().getCodecRegistry(); ProtocolVersion protocolVersion = cluster.getConfiguration().getProtocolOptions().getProtocolVersion(); String simpleName = row.getString("aggregate_name"); List<DataType> argumentTypes = parseTypes(ksm, row.getList("argument_types", String.class), version, cluster); String fullName = Metadata.fullFunctionName(simpleName, argumentTypes); String finalFuncSimpleName = row.getString("final_func"); DataType returnType; if(version.getMajor() >= 3) { returnType = DataTypeParser.parse(row.getString("return_type"), cluster, ksm.getName(), ksm.userTypes, false); } else { returnType = CassandraTypeParser.parseOne(row.getString("return_type"), protocolVersion, codecRegistry); } String stateFuncSimpleName = row.getString("state_func"); String stateTypeName = row.getString("state_type"); DataType stateType; Object initCond; if(version.getMajor() >= 3) { stateType = DataTypeParser.parse(stateTypeName, cluster, ksm.getName(), ksm.userTypes, false); String rawInitCond = row.getString("initcond"); <START> initCond = rawInitCond == null ? null : codecRegistry.codecFor(stateType).parse(rawInitCond); <END> } else { stateType = CassandraTypeParser.parseOne(stateTypeName, protocolVersion, codecRegistry); ByteBuffer rawInitCond = row.getBytes("initcond"); initCond = rawInitCond == null ? null : codecRegistry.codecFor(stateType).deserialize(rawInitCond, protocolVersion); } String finalFuncFullName = finalFuncSimpleName == null ? null : String.format("%s(%s)", finalFuncSimpleName, stateType); String stateFuncFullName = makeStateFuncFullName(stateFuncSimpleName, stateType, argumentTypes); return new AggregateMetadata(ksm, fullName, simpleName, argumentTypes, finalFuncSimpleName, finalFuncFullName, initCond, returnType, stateFuncSimpleName, stateFuncFullName, stateType, codecRegistry.codecFor(stateType)); }</code><technical_language>handle case stateType is UnresolvedUserType</technical_language>

Target:
static AggregateMetadata build(KeyspaceMetadata ksm, Row row, VersionNumber version, Cluster cluster) { CodecRegistry codecRegistry = cluster.getConfiguration().getCodecRegistry(); ProtocolVersion protocolVersion = cluster.getConfiguration().getProtocolOptions().getProtocolVersion(); String simpleName = row.getString("aggregate_name"); List<DataType> argumentTypes = parseTypes(ksm, row.getList("argument_types", String.class), version, cluster); String fullName = Metadata.fullFunctionName(simpleName, argumentTypes); String finalFuncSimpleName = row.getString("final_func"); DataType returnType; if(version.getMajor() >= 3) { returnType = DataTypeCqlNameParser.parse(row.getString("return_type"), cluster, ksm.getName(), ksm.userTypes, null, false, false); } else { returnType = DataTypeClassNameParser.parseOne(row.getString("return_type"), protocolVersion, codecRegistry); } String stateFuncSimpleName = row.getString("state_func"); String stateTypeName = row.getString("state_type"); DataType stateType; Object initCond; if(version.getMajor() >= 3) { stateType = DataTypeCqlNameParser.parse(stateTypeName, cluster, ksm.getName(), ksm.userTypes, null, false, false); String rawInitCond = row.getString("initcond"); initCond = rawInitCond == null ? null : codecRegistry.codecFor(stateType).parse(rawInitCond); } else { stateType = DataTypeClassNameParser.parseOne(stateTypeName, protocolVersion, codecRegistry); ByteBuffer rawInitCond = row.getBytes("initcond"); initCond = rawInitCond == null ? null : codecRegistry.codecFor(stateType).deserialize(rawInitCond, protocolVersion); } String finalFuncFullName = finalFuncSimpleName == null ? null : String.format("%s(%s)", finalFuncSimpleName, stateType); String stateFuncFullName = makeStateFuncFullName(stateFuncSimpleName, stateType, argumentTypes); return new AggregateMetadata(ksm, fullName, simpleName, argumentTypes, finalFuncSimpleName, finalFuncFullName, initCond, returnType, stateFuncSimpleName, stateFuncFullName, stateType, codecRegistry.codecFor(stateType)); }