@@ -2099,7 +2099,7 @@ public void updateHiveTable(String projectName, Map<String, TableSchemaUpdateMap
2099
2099
if (prjInstance == null ) {
2100
2100
throw new BadRequestException ("Project " + projectName + " does not exist" );
2101
2101
}
2102
- // To deal with case sensitive issue for table resource path
2102
+ // To deal with case- sensitive issue for table resource path
2103
2103
final String project = prjInstance .getName ();
2104
2104
aclEvaluate .checkProjectWritePermission (project );
2105
2105
@@ -2118,15 +2118,16 @@ public void updateHiveTable(String projectName, Map<String, TableSchemaUpdateMap
2118
2118
ifAllModelUpdate = nModel == infModels .size ();
2119
2119
}
2120
2120
// Currently, only model with offline status is supported to update with mappings.
2121
- Set <NDataModel > readyModelSet = infModels .stream ().filter (model -> NDataflowManager .getInstance (kylinConfig , project )
2121
+ Set <NDataModel > offlineModelSet = infModels .stream ().filter (model -> NDataflowManager .getInstance (kylinConfig , project )
2122
2122
.getDataflowByModelAlias (model .getAlias ()).getStatus () == RealizationStatusEnum .OFFLINE )
2123
2123
.collect (Collectors .toSet ());
2124
- ifAllModelUpdate = (ifAllModelUpdate && readyModelSet .size () == infModels .size ());
2124
+ ifAllModelUpdate = (ifAllModelUpdate && offlineModelSet .size () == infModels .size ());
2125
2125
// At least 1 model should be update here, otherwise it will throw BadRequestException.
2126
- if (readyModelSet .isEmpty ()) {
2127
- throw new BadRequestException ("Influenced models " + infModels + " should be OFFLINE" );
2126
+ if (offlineModelSet .isEmpty ()) {
2127
+ throw new BadRequestException ("Affected models " + infModels + " should be OFFLINE" );
2128
2128
}
2129
- logger .info ("Influenced cubes {}" , readyModelSet );
2129
+ logger .info ("Should affected models {}" , infModels );
2130
+ logger .info ("Actually affected offline models {}" , offlineModelSet );
2130
2131
2131
2132
// Get influenced metadata and update the metadata
2132
2133
NTableMetadataManager tableManager = NTableMetadataManager .getInstance (kylinConfig , project );
@@ -2145,11 +2146,11 @@ public void updateHiveTable(String projectName, Map<String, TableSchemaUpdateMap
2145
2146
}
2146
2147
}
2147
2148
// -- 2. model
2148
- Map <String , NDataModel > newModels = readyModelSet .stream ().map (model -> TableSchemaUpdater
2149
+ Map <String , NDataModel > newModels = offlineModelSet .stream ().map (model -> TableSchemaUpdater
2149
2150
.dealWithMappingForModel (kylinConfig , project , model , mapping ))
2150
2151
.collect (Collectors .toMap (NDataModel ::getAlias , model -> model ));
2151
2152
// -- 3. dataflow
2152
- Map <String , NDataflow > newDataflow = readyModelSet .stream ()
2153
+ Map <String , NDataflow > newDataflow = offlineModelSet .stream ()
2153
2154
.map (model -> NDataflowManager .getInstance (kylinConfig , project ).getDataflowByModelAlias (model .getAlias ()))
2154
2155
.map (dataflow -> TableSchemaUpdater .dealWithMappingForDataFlow (kylinConfig , project , dataflow , mapping ))
2155
2156
.collect (Collectors .toMap (NDataflow ::resourceName , dataflow -> dataflow ));
0 commit comments