You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "zhangwl9 (via GitHub)" <gi...@apache.org> on 2025/07/17 01:50:27 UTC

[PR] Display comment on Table page. [amoro]

zhangwl9 opened a new pull request, #3672:
URL: https://github.com/apache/amoro/pull/3672

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://amoro.apache.org/how-to-contribute/
     2. If the PR is related to an issue in https://github.com/apache/amoro/issues, add '[AMORO-XXXX]' in your PR title, e.g., '[AMORO-XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][AMORO-XXXX] Your PR title ...'.
   -->
   
   ## Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about its use case.
     2. If you fix a bug, you can clarify why it is a bug.
     3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related issue
   -->
   
   Close #3245
   
   ## Brief change log
   <!--
   Clearly describe the changes made in modules, classes, methods, etc.
   -->
   
   Display table comment on Table page
   
   ## How was this patch tested?
   
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [x] Add screenshots for manual tests if appropriate
   
   - [x] Run test locally before making a pull request
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3672:
URL: https://github.com/apache/amoro/pull/3672#issuecomment-3116568903

   ## [Codecov](https://app.codecov.io/gh/apache/amoro/pull/3672?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `0%` with `7 lines` in your changes missing coverage. Please review.
   > Project coverage is 21.77%. Comparing base [(`5b28138`)](https://app.codecov.io/gh/apache/amoro/commit/5b281385a38679a22b5b96f3b0972234d487be21?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`e1554d2`)](https://app.codecov.io/gh/apache/amoro/commit/e1554d2c476d20101f607e50fc69a575e8c70f40?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 11 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/amoro/pull/3672?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...apache/amoro/table/descriptor/ServerTableMeta.java](https://app.codecov.io/gh/apache/amoro/pull/3672?src=pr&el=tree&filepath=amoro-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Famoro%2Ftable%2Fdescriptor%2FServerTableMeta.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-YW1vcm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9hbW9yby90YWJsZS9kZXNjcmlwdG9yL1NlcnZlclRhYmxlTWV0YS5qYXZh) | 0.00% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/amoro/pull/3672?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   > :exclamation:  There is a different number of reports uploaded between BASE (5b28138) and HEAD (e1554d2). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (5b28138) | HEAD (e1554d2) |
   >|------|------|------|
   >|core|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3672      +/-   ##
   ============================================
   - Coverage     28.30%   21.77%   -6.54%     
   + Complexity     3713     2392    -1321     
   ============================================
     Files           617      436     -181     
     Lines         49825    40507    -9318     
     Branches       6437     5745     -692     
   ============================================
   - Hits          14104     8819    -5285     
   + Misses        34713    30940    -3773     
   + Partials       1008      748     -260     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/amoro/pull/3672/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [core](https://app.codecov.io/gh/apache/amoro/pull/3672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [trino](https://app.codecov.io/gh/apache/amoro/pull/3672/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `21.77% <0.00%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/amoro/pull/3672?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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@amoro.apache.org

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


Re: [PR] Display comment on Table page. [amoro]

Posted by "zhongqishang (via GitHub)" <gi...@apache.org>.
zhongqishang commented on PR #3672:
URL: https://github.com/apache/amoro/pull/3672#issuecomment-3086599694

   > @zhongqishang The hudi table's comments are not stored in the Table's metadata, so I haven't been able to get them yet.
   
   @zhangwl9 I found in the HoodieCatalog of flink and spark that it is also fetched from properties, can you confirm again?
   https://github.com/apache/hudi/blob/master/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieCatalog.java#L278
   
   https://github.com/apache/hudi/blob/master/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala#L287
   
   


-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on PR #3672:
URL: https://github.com/apache/amoro/pull/3672#issuecomment-3126728972

   @zhongqishang  Now, if the table comment is not configured, no comment information will be displayed on the table page.The result is shown in the above figure


-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhoujinsong (via GitHub)" <gi...@apache.org>.
zhoujinsong merged PR #3672:
URL: https://github.com/apache/amoro/pull/3672


-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhongqishang (via GitHub)" <gi...@apache.org>.
zhongqishang commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2235078775


##########
amoro-web/src/views/tables/index.vue:
##########
@@ -142,6 +143,9 @@ export default defineComponent({
           <div class="g-flex">
             <span :title="baseInfo.tableName" class="table-name g-text-nowrap">{{ baseInfo.tableName }}</span>
           </div>
+          <div class="table-info g-flex-ac">

Review Comment:
   Add `v-if="baseInfo.comment"`, and it will be more friendly not to display comment when there is no value. WDYT?



-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on PR #3672:
URL: https://github.com/apache/amoro/pull/3672#issuecomment-3116694010

   > > @zhongqishang The hudi table's comments are not stored in the Table's metadata, so I haven't been able to get them yet.
   > 
   > @zhangwl9 I found in the HoodieCatalog of flink and spark that it is also fetched from properties, can you confirm again? https://github.com/apache/hudi/blob/master/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/catalog/HoodieCatalog.java#L278
   > 
   > https://github.com/apache/hudi/blob/master/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala#L287
   
   @zhongqishang Thank you very much, in the current pr, I added the display of the comment of the hudi table and the result is shown in the above figure


-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhongqishang (via GitHub)" <gi...@apache.org>.
zhongqishang commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2238326457


##########
amoro-format-hudi/src/main/java/org/apache/amoro/formats/hudi/HudiTableDescriptor.java:
##########
@@ -97,6 +97,8 @@ public class HudiTableDescriptor implements FormatTableDescriptor {
   private static final Logger LOG = LoggerFactory.getLogger(HudiTableDescriptor.class);
   private static final String COMPACTION = "compaction";
   private static final String CLUSTERING = "clustering";
+  // table comment
+  private static final String COMMENT = "comment";

Review Comment:
   Get.



-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2235366339


##########
amoro-web/src/views/tables/index.vue:
##########
@@ -142,6 +143,9 @@ export default defineComponent({
           <div class="g-flex">
             <span :title="baseInfo.tableName" class="table-name g-text-nowrap">{{ baseInfo.tableName }}</span>
           </div>
+          <div class="table-info g-flex-ac">

Review Comment:
   Yes,I will fix it



-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2238505929


##########
amoro-web/src/views/tables/components/Details.vue:
##########
@@ -128,7 +130,10 @@ async function getTableDetails() {
   }
 
   function setBaseDetailInfo() {
-    emit('setBaseDetailInfo', state.baseDetailInfo)
+    emit('setBaseDetailInfo',  {
+                                    ...state.baseDetailInfo,
+                                    comment:state.comment
+                                  })

Review Comment:
   I have fixed it



-- 
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@amoro.apache.org

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


Re: [PR] Display comment on Table page. [amoro]

Posted by "zhongqishang (via GitHub)" <gi...@apache.org>.
zhongqishang commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2214827342


##########
amoro-format-iceberg/src/main/java/org/apache/amoro/table/TableProperties.java:
##########
@@ -42,6 +42,11 @@ private TableProperties() {}
   public static final String TABLE_CREATE_TIME = "table.create-timestamp";
   public static final long TABLE_CREATE_TIME_DEFAULT = 0L;
 
+  /** table comment related properties */
+  public static final String COMMENT = "comment";
+
+  public static final String COMMENT_DEFAULT = "";

Review Comment:
   I suggest that don't need a default value, and that it would be more user-friendly if the page doesn't show anything without comment. WDYT?



##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java:
##########
@@ -171,9 +171,16 @@ public ServerTableMeta getTableDetail(AmoroTable<?> amoroTable) {
     }
     String averageFileSize = AmsUtil.byteToXB(tableFileCnt == 0 ? 0 : tableSize / tableFileCnt);
     long records = getRecordsOfTable(table);
+    String comment =
+        table.properties().getOrDefault(TableProperties.COMMENT, TableProperties.COMMENT_DEFAULT);
     TableSummary tableSummary =
         new TableSummary(
-            tableFileCnt, AmsUtil.byteToXB(tableSize), averageFileSize, records, tableFormat);
+            tableFileCnt,
+            AmsUtil.byteToXB(tableSize),
+            averageFileSize,
+            records,
+            tableFormat,
+            comment);

Review Comment:
   Maybe we can add comment to `org.apache.amoro.table.descriptor.ServerTableMeta`.



-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhoujinsong (via GitHub)" <gi...@apache.org>.
zhoujinsong commented on PR #3672:
URL: https://github.com/apache/amoro/pull/3672#issuecomment-3139827641

   Thanks for the great work! @zhangwl9 


-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhongqishang (via GitHub)" <gi...@apache.org>.
zhongqishang commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2238143089


##########
amoro-format-hudi/src/main/java/org/apache/amoro/formats/hudi/HudiTableDescriptor.java:
##########
@@ -97,6 +97,8 @@ public class HudiTableDescriptor implements FormatTableDescriptor {
   private static final Logger LOG = LoggerFactory.getLogger(HudiTableDescriptor.class);
   private static final String COMPACTION = "compaction";
   private static final String CLUSTERING = "clustering";
+  // table comment
+  private static final String COMMENT = "comment";

Review Comment:
   Can be used `org.apache.amoro.table.TableProperties#COMMENT`.



##########
amoro-web/src/views/tables/components/Details.vue:
##########
@@ -128,7 +130,10 @@ async function getTableDetails() {
   }
 
   function setBaseDetailInfo() {
-    emit('setBaseDetailInfo', state.baseDetailInfo)
+    emit('setBaseDetailInfo',  {
+                                    ...state.baseDetailInfo,
+                                    comment:state.comment
+                                  })

Review Comment:
   The code format seems to be abnormal.



-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2238302332


##########
amoro-format-hudi/src/main/java/org/apache/amoro/formats/hudi/HudiTableDescriptor.java:
##########
@@ -97,6 +97,8 @@ public class HudiTableDescriptor implements FormatTableDescriptor {
   private static final Logger LOG = LoggerFactory.getLogger(HudiTableDescriptor.class);
   private static final String COMPACTION = "compaction";
   private static final String CLUSTERING = "clustering";
+  // table comment
+  private static final String COMMENT = "comment";

Review Comment:
   This parameter comes from the 'amoro-format-iceberg' module, and if I call it here, I need to introduce a dependency on 'amoro-format-iceberg;, but at the moment 'amoro-format-iceberg' and 'amoro-format-hudi' are separate modules.
   
   



-- 
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@amoro.apache.org

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


Re: [PR] [AMORO-3245] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on code in PR #3672:
URL: https://github.com/apache/amoro/pull/3672#discussion_r2230341773


##########
amoro-ams/src/main/java/org/apache/amoro/server/dashboard/MixedAndIcebergTableDescriptor.java:
##########
@@ -171,9 +171,16 @@ public ServerTableMeta getTableDetail(AmoroTable<?> amoroTable) {
     }
     String averageFileSize = AmsUtil.byteToXB(tableFileCnt == 0 ? 0 : tableSize / tableFileCnt);
     long records = getRecordsOfTable(table);
+    String comment =
+        table.properties().getOrDefault(TableProperties.COMMENT, TableProperties.COMMENT_DEFAULT);
     TableSummary tableSummary =
         new TableSummary(
-            tableFileCnt, AmsUtil.byteToXB(tableSize), averageFileSize, records, tableFormat);
+            tableFileCnt,
+            AmsUtil.byteToXB(tableSize),
+            averageFileSize,
+            records,
+            tableFormat,
+            comment);

Review Comment:
   fixup



##########
amoro-format-iceberg/src/main/java/org/apache/amoro/table/TableProperties.java:
##########
@@ -42,6 +42,11 @@ private TableProperties() {}
   public static final String TABLE_CREATE_TIME = "table.create-timestamp";
   public static final long TABLE_CREATE_TIME_DEFAULT = 0L;
 
+  /** table comment related properties */
+  public static final String COMMENT = "comment";
+
+  public static final String COMMENT_DEFAULT = "";

Review Comment:
   fixup



-- 
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@amoro.apache.org

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


Re: [PR] Display comment on Table page. [amoro]

Posted by "zhangwl9 (via GitHub)" <gi...@apache.org>.
zhangwl9 commented on PR #3672:
URL: https://github.com/apache/amoro/pull/3672#issuecomment-3082276162

   @zhongqishang The hudi table's comments are not stored in the Table's metadata, so I haven't been able to get them yet.


-- 
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@amoro.apache.org

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