initialRelation = (relations) => {
  let sameTblRel = null;
  let parentRel = null;
  let childRel = null;
  for (const relation of relations) {
    switch (relation.type) {
      case RelationType.OWN:
        sameTblRel = relation;
        break;
      case RelationType.PARENT_SHOW:
        parentRel = relation;
        break;
      case RelationType.CHILD_LIST:
      case RelationType.ONE_TO_ONE_SHOW:
        childRel = relation;
        break;
    }
  }
  return sameTblRel || parentRel || childRel || relations[0];
}
@param {string[]} relations
@param {string} sourceTbl name of the topview table
@returns either a same table relation, a parent relation, a child relation, or the first relation