public LocationKind getLocationKindsFromOperateKind()

in amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/amoro/hive/io/writer/AdaptHiveOperateToTableRelation.java [35:77]


  public LocationKind getLocationKindsFromOperateKind(
      MixedTable mixedTable, WriteOperationKind writeOperationKind) {
    if (mixedTable.isKeyedTable()) {
      if (TableTypeUtil.isHive(mixedTable)) {
        switch (writeOperationKind) {
          case APPEND:
            return ChangeLocationKind.INSTANT;
          case MINOR_OPTIMIZE:
          case MAJOR_OPTIMIZE:
            return BaseLocationKind.INSTANT;
          case OVERWRITE:
          case FULL_OPTIMIZE:
            return HiveLocationKind.INSTANT;
        }
      } else {
        switch (writeOperationKind) {
          case APPEND:
            return ChangeLocationKind.INSTANT;
          case MINOR_OPTIMIZE:
          case MAJOR_OPTIMIZE:
          case OVERWRITE:
          case FULL_OPTIMIZE:
            return BaseLocationKind.INSTANT;
        }
      }
    } else {
      if (TableTypeUtil.isHive(mixedTable)) {
        switch (writeOperationKind) {
          case APPEND:
          case MAJOR_OPTIMIZE:
            return BaseLocationKind.INSTANT;
          case OVERWRITE:
          case FULL_OPTIMIZE:
            return HiveLocationKind.INSTANT;
          case MINOR_OPTIMIZE:
            throw new IllegalArgumentException("UnKeyed table don't support minor optimize");
        }
      } else {
        return BaseLocationKind.INSTANT;
      }
    }
    return null;
  }