wu-sheng commented on code in PR #12047: URL: https://github.com/apache/skywalking/pull/12047#discussion_r1533785182
########## oap-server/server-storage-plugin/storage-banyandb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/banyandb/BanyanDBConverter.java: ########## @@ -272,5 +281,26 @@ public byte[] getBytes(String fieldName) { // TODO: double may be a field? return dataPoint.getFieldValue(fieldName); } + + private Object defaultValue(Class<?> clazz) { + if (int.class.equals(clazz) || Integer.class.equals(clazz)) { + return 0; + } else if (Long.class.equals(clazz) || long.class.equals(clazz)) { + return 0L; + } else if (String.class.equals(clazz)) { + return ""; + } else if (Double.class.equals(clazz) || double.class.equals(clazz)) { + return 0D; + } else if (StorageDataComplexObject.class.isAssignableFrom(clazz)) { + return ""; + } else if (clazz.isEnum()) { + return 0L; Review Comment: Enum is not a supported persistent type. Please skip this and throw the exception. Please refer to `ColumnTypeEsMapping`, and match the types. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org