Github user traflm commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1532#discussion_r193922170
  
    --- Diff: core/sql/src/main/java/org/trafodion/sql/HBaseClient.java ---
    @@ -538,7 +564,21 @@ public boolean createk(String tblName, Object[] 
tableOptions,
                          admin.createTable(desc);
                       }
                    }
    -            admin.close();
    +
    +            if(setDescRet!= null)
    +            {
    +              if(setDescRet.storagePolicyChanged())
    +              {
    +                 Object tableOptionsStoragePolicy[] = new 
Object[HBASE_HDFS_STORAGE_POLICY+1];
    +                 for(int i=0; i<HBASE_HDFS_STORAGE_POLICY; i++)
    +                   tableOptionsStoragePolicy[i]="";
    +                 
tableOptionsStoragePolicy[HBASE_HDFS_STORAGE_POLICY]=(String)setDescRet.storagePolicy_
 ;
    +                 tableOptionsStoragePolicy[HBASE_NAME]=(String)tblName;
    +                 alter(tblName,tableOptionsStoragePolicy,transID);
    --- End diff --
    
    I am not farmiliar with DDL transaction, need some time to understand this 
and make changes here.
    But maybe we can make this work in different phases, in order to have it 
basically working.
    I don't think this action need to do rollback, since if the CREATE fail, 
the path will be removed, so no need to set the storage policy back and then 
remove.
    Removing the file should be part of the original CREATE TABLE process, but 
maybe I am misunderstanding here.


---

Reply via email to