You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "TamimEhsan (via GitHub)" <gi...@apache.org> on 2025/08/14 03:33:44 UTC

[PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

TamimEhsan opened a new pull request, #8079:
URL: https://github.com/apache/gravitino/pull/8079

   <!--
   1. Title: [#<issue>] <type>(<scope>): <subject>
      Examples:
        - "[#123] feat(operator): support xxx"
        - "[#233] fix: check null before access result in xxx"
        - "[MINOR] refactor: fix typo in variable name"
        - "[MINOR] docs: fix typo in README"
        - "[#255] test: fix flaky test NameOfTheTest"
      Reference: https://www.conventionalcommits.org/en/v1.0.0/
   2. If the PR is unfinished, please mark this PR as draft.
   -->
   
   ### What changes were proposed in this pull request?
   
   Fix the coumn update logic in `updateColumnPOsFromTableDiff` of `TableMetaService`
   
   ### Why are the changes needed?
   
   The previous version didn't handle CREATE column. Instead, used to handle both the CREATE and UPDATE as UPDATE
   
   Fix: #8054 
   
   ### Does this PR introduce _any_ user-facing change?
   
   No
   
   ### How was this patch tested?
   
   
   


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "TamimEhsan (via GitHub)" <gi...@apache.org>.
TamimEhsan commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187254704

   @jerryshao I have written some tests for the changes. But yes, it only makes sure the requested fix works provided that the updated logics are correct. 


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187580428

   @tamimEhan Please add your tests. However, I do think the logic is rather apparent, i.e. if the column didn't exist before, it's a creation, if it did exist before, it's an update. If this is by design, for whatever reason, then there should be a comment explaining why it was done in a way that looks like an error.


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187774340

   There are lot of hidden things in every project that cannot be figured out by a static code scanner. If there's a bug, we should fix it. If not, we'd better leave it as it is. Because no one remembers why it should be like this, especially those that are not apparent as you saw.


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao closed pull request #8079: [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns
URL: https://github.com/apache/gravitino/pull/8079


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187220741

   Modification in the core part will introduce unknown issues if you don't know the history. Not to say you don't have a test to cover the changes.


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#discussion_r2276587350


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/TableColumnMetaService.java:
##########
@@ -143,8 +143,12 @@ void updateColumnPOsFromTableDiff(
     List<ColumnPO> columnPOsToInsert = Lists.newArrayList();
     for (ColumnEntity newColumn : newColumns.values()) {
       ColumnEntity oldColumn = oldColumns.get(newColumn.id());
-      // If the column is not existed in old columns, or if the column is updated, mark it as UPDATE
-      if (oldColumn == null || !oldColumn.equals(newColumn)) {

Review Comment:
   This depends on the real definition of `ColumnPO.ColumnOpType.CREATE` and `ColumnPO.ColumnOpType.UPDATE`.
   Based on previous code, changes introduced by `JDBCBackend#update` will be marked as `UPDATE`, and `JDBCBackend#insert` will be viewed as `CREATE` operation.



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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187213946

   How do you make sure the logic is correct without a test? If there's no bug, I'm against modifying the code with no reason. It might be by design (I forgot the reason).


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "TamimEhsan (via GitHub)" <gi...@apache.org>.
TamimEhsan commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3193378718

   found this conversation from the original commit https://github.com/apache/gravitino/pull/5078/files#r1794721831
   
   


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "TamimEhsan (via GitHub)" <gi...@apache.org>.
TamimEhsan commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187174526

   @justinmclean should I add any tests for the change?


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3187924183

   I didn't use a static code scanner to find this. I looked at the code, and I believe there is a bug.


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

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


Re: [PR] [#8054] fix(TableColumnMetaService): Correct column update logic to handle new columns [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #8079:
URL: https://github.com/apache/gravitino/pull/8079#issuecomment-3194894687

   Thanks @TamimEhsan for working on this. I'm going to close this PR as it is by design. You can work on other bugs or issues if you'd like to. Greatly appreciated!


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

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