You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/06/06 08:37:20 UTC

[GitHub] [incubator-inlong] healchow commented on a diff in pull request #4515: [INLONG-4513][Manager] Add Iceberg and HBase examples for the manager client

healchow commented on code in PR #4515:
URL: https://github.com/apache/incubator-inlong/pull/4515#discussion_r889938555


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/iceberg/IcebergSinkOperation.java:
##########
@@ -133,6 +136,26 @@ public void saveFieldOpt(SinkRequest request) {
         LOGGER.info("success to save iceberg field");
     }
 
+    private void checkFieldInfo(SinkField field) {
+        if (FieldType.forName(field.getFieldType()) == FieldType.DECIMAL) {
+            IcebergColumnInfo info = IcebergColumnInfo.getFromJson(field.getExtParams());
+            if (info.getPrecision() == null || info.getScale() == null) {
+                String errorMsg = String.format("precision or scale not specified for decimal field (%s)",
+                        field.getFieldName());
+                LOGGER.error("field info check error: {}", errorMsg);
+                throw new IllegalArgumentException(errorMsg);

Review Comment:
   Please change the exception to `BusinessException` which it can be recognized by the front end.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org