This is an automated email from the ASF dual-hosted git repository.

yuqi4733 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new e46888191 [#4605] Handle NPE in Doris table operation prop append 
(#5125)
e46888191 is described below

commit e468881917c225a4717802b6f5f08cf489c0375f
Author: Avin <[email protected]>
AuthorDate: Tue Oct 15 06:39:17 2024 +0530

    [#4605] Handle NPE in Doris table operation prop append (#5125)
    
    <!--
    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?
    
    In `DorisTableOperations`, handled a possible Null Pointer Exception
    scenario
    
    ### Why are the changes needed?
    
    Fix: (#4605)
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Local Test Run - Passed
    
    ---------
    
    Co-authored-by: Avinash <[email protected]>
---
 .../apache/gravitino/catalog/doris/operation/DorisTableOperations.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java
 
b/catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java
index 479e3e5dc..ebd7027b1 100644
--- 
a/catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java
+++ 
b/catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java
@@ -179,7 +179,7 @@ public class DorisTableOperations extends 
JdbcTableOperations {
 
     // If the backend server is less than 
DEFAULT_REPLICATION_FACTOR_IN_SERVER_SIDE (3), we need to
     // set the property 'replication_num' to 1 explicitly.
-    if (!properties.containsKey(REPLICATION_FACTOR)) {
+    if (!resultMap.containsKey(REPLICATION_FACTOR)) {
       // Try to check the number of backend servers.
       String query = "select count(*) from information_schema.backends where 
Alive = 'true'";
 

Reply via email to