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/04/19 03:22:34 UTC

[GitHub] [incubator-inlong] yunqingmoswu opened a new pull request, #3784: [INLONG-3778][Sort] FieldInfo enhanced to support transform in the future

yunqingmoswu opened a new pull request, #3784:
URL: https://github.com/apache/incubator-inlong/pull/3784

   ### Title Name:[INLONG-3778][Sort] FieldInfo enhanced to support transform in the future
   
   Fixes #3778
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve?*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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


[GitHub] [incubator-inlong] healchow commented on a diff in pull request #3784: [INLONG-3778][Sort] FieldInfo enhanced to support transform in the future

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #3784:
URL: https://github.com/apache/incubator-inlong/pull/3784#discussion_r852564063


##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/FieldInfo.java:
##########
@@ -35,34 +41,47 @@
         @JsonSubTypes.Type(value = FieldInfo.class, name = "base"),
         @JsonSubTypes.Type(value = BuiltInFieldInfo.class, name = "builtin")
 })
-public class FieldInfo implements Serializable {
+@Data
+public class FieldInfo implements FunctionParam, Serializable {
 
     private static final long serialVersionUID = 5871970550803344673L;
-
     @JsonProperty("name")
     private final String name;
-
+    @JsonInclude(Include.NON_NULL)
+    @JsonProperty("nodeId")
+    private String nodeId;
+    @JsonIgnore
+    private String tableNameAlias;
     @JsonProperty("format_info")
     private FormatInfo formatInfo;
 
-    @JsonCreator
     public FieldInfo(
             @JsonProperty("name") String name,
             @JsonProperty("format_info") FormatInfo formatInfo) {
         this.name = Preconditions.checkNotNull(name);
         this.formatInfo = Preconditions.checkNotNull(formatInfo);
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public FormatInfo getFormatInfo() {
-        return formatInfo;
+    @JsonCreator
+    public FieldInfo(
+            @JsonProperty("name") String name,
+            @JsonProperty("nodeId") String nodeId,
+            @JsonProperty("format_info") FormatInfo formatInfo) {
+        this.name = Preconditions.checkNotNull(name);
+        this.nodeId = nodeId;
+        this.formatInfo = Preconditions.checkNotNull(formatInfo);
     }
 
-    public void setFormatInfo(FormatInfo formatInfo) {
-        this.formatInfo = formatInfo;
+    @Override
+    public String format() {
+        String formatName = name.trim();
+        if (!formatName.startsWith("`")) {
+            formatName = String.format("`%s`", formatName);

Review Comment:
   Maybe the format name will end with "`", suggest adding a check.



##########
inlong-sort/sort-common/src/main/java/org/apache/inlong/sort/protocol/FieldInfo.java:
##########
@@ -35,34 +41,47 @@
         @JsonSubTypes.Type(value = FieldInfo.class, name = "base"),
         @JsonSubTypes.Type(value = BuiltInFieldInfo.class, name = "builtin")
 })
-public class FieldInfo implements Serializable {
+@Data
+public class FieldInfo implements FunctionParam, Serializable {
 
     private static final long serialVersionUID = 5871970550803344673L;
-
     @JsonProperty("name")
     private final String name;
-
+    @JsonInclude(Include.NON_NULL)
+    @JsonProperty("nodeId")
+    private String nodeId;
+    @JsonIgnore
+    private String tableNameAlias;
     @JsonProperty("format_info")
     private FormatInfo formatInfo;
 
-    @JsonCreator
     public FieldInfo(
             @JsonProperty("name") String name,
             @JsonProperty("format_info") FormatInfo formatInfo) {
         this.name = Preconditions.checkNotNull(name);
         this.formatInfo = Preconditions.checkNotNull(formatInfo);
     }
 
-    public String getName() {
-        return name;
-    }
-
-    public FormatInfo getFormatInfo() {
-        return formatInfo;
+    @JsonCreator
+    public FieldInfo(
+            @JsonProperty("name") String name,
+            @JsonProperty("nodeId") String nodeId,
+            @JsonProperty("format_info") FormatInfo formatInfo) {

Review Comment:
   Would it be better to name those variables with the Camel Case?



-- 
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


[GitHub] [incubator-inlong] EMsnap merged pull request #3784: [INLONG-3778][Sort] FieldInfo enhanced to support transform

Posted by GitBox <gi...@apache.org>.
EMsnap merged PR #3784:
URL: https://github.com/apache/incubator-inlong/pull/3784


-- 
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