Skip to content

Commit

Permalink
improve nit (#603)
Browse files Browse the repository at this point in the history
Co-authored-by: Yingjian Wu <[email protected]>
  • Loading branch information
stevie9868 and Yingjian Wu authored Jul 9, 2024
1 parent b585cda commit 93b2c57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public Set<ChildInfoDto> getChildren(
}

/**
* Return the list of children for a given table.
* Return the list of parent for a given table.
* @param catalogName catalogName
* @param databaseName databaseName
* @param tableName tableName
* @return list of childInfoDto
* @return list of parentInfoDto
*/
@RequestMapping(method = RequestMethod.GET,
path = "/parents/catalog/{catalog-name}/database/{database-name}/table/{table-name}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void validateMaxAllow(final QualifiedName parentName,
true
);

// Then check if the parent have configured max allowed on the db config
// Then check if the parent has a configured max allowed setting on the db config
if (maxAllow == null) {
maxAllow = getMaxAllowedFromNestedMap(
parentName,
Expand All @@ -127,7 +127,7 @@ private void validateMaxAllow(final QualifiedName parentName,
);
}

// If not specified in maxAllowPerDBPerRelType,check the default max Allow based on relationType
// If not specified in maxAllowPerDBPerRelType,check the default maxAllow based on relationType
if (maxAllow == null) {
final Integer count = props.getDefaultMaxAllowPerRelType().get(type);
if (count != null) {
Expand All @@ -140,7 +140,7 @@ private void validateMaxAllow(final QualifiedName parentName,
maxAllow = props.getMaxAllow();
}

// if maxAllow < 0, this means we can create as many child table under the parent
// if maxAllow < 0, this means we can create unlimited child tables under the parent
if (maxAllow < 0) {
return;
}
Expand All @@ -164,15 +164,15 @@ private void validateCreate(final QualifiedName parentName,
if (!childParents.isEmpty()) {
throw new ParentChildRelServiceException("Cannot have a child table having more than one parent "
+ "- Child Table: " + childName
+ " already have a parent Table=" + childParents.stream().findFirst().get());
+ " already have a parent Table=" + childParents.stream().findFirst().get().getName());
}

// Validation to prevent creating a child table as a parent of another child table
final Set<ParentInfo> parentParents = getParents(parentName);
if (!parentParents.isEmpty()) {
throw new ParentChildRelServiceException("Cannot create a child table as parent "
+ "- parent table: " + parentName
+ " already have a parent table = " + parentParents.stream().findFirst().get());
+ " already have a parent table = " + parentParents.stream().findFirst().get().getName());
}

// Validation to prevent creating a parent on top of a table that have children
Expand Down

0 comments on commit 93b2c57

Please sign in to comment.