class HiveDataSource extends BaseDataSource {

  @Override
  protected String filterOther(String otherParams) {
    if (StringUtils.isBlank(otherParams)) {
      return "";
    }

    StringBuilder hiveConfListSb = new StringBuilder();
    hiveConfListSb.append("?");
    StringBuilder sessionVarListSb = new StringBuilder();

    String[] otherArray = otherParams.split(";", -1);

    // get the default hive conf var name
    Set<String> hiveConfSet = Stream.of(ConfVars.values()).map(confVars -> confVars.varname)
        .collect(Collectors.toSet());

    for (String conf : otherArray) {
      if (hiveConfSet.contains(conf.split("=")[0])) {
        hiveConfListSb.append(conf).append(";");
      } else {
        sessionVarListSb.append(conf).append(";");
      }
    }

    // remove the last ";"
    if (sessionVarListSb.length() > 0) {
      sessionVarListSb.deleteCharAt(sessionVarListSb.length() - 1);
    }

    if (hiveConfListSb.length() > 0) {
      hiveConfListSb.deleteCharAt(hiveConfListSb.length() - 1);
    }

    return sessionVarListSb.toString() + hiveConfListSb.toString();
  }

}