code: public static String generateCreateDuplicateTableDDL(
        String inputDbName,
        String inputTblName,
        String tblName,
        String tblLocation,
        Optional<String> optionalDbName) {
  
      Preconditions.checkArgument(StringUtils.isNotBlank(tblName));
      Preconditions.checkArgument(StringUtils.isNotBlank(tblLocation));
  
      String dbName = optionalDbName.isPresent() ? optionalDbName.get() : "default";
  
      return String.format("CREATE EXTERNAL TABLE IF NOT EXISTS `%s`.`%s` LIKE `%s`.`%s` LOCATION %n  '%s' %n",
          dbName, tblName, inputDbName, inputTblName, tblLocation);
    }
docs: *
  Generate DDL query to create a duplicate Hive table
  @param inputDbName source DB name
  @param inputTblName source table name
  @param tblName New Hive table name
  @param tblLocation New hive table location
  @param optionalDbName Optional DB name, if not specified it defaults to 'default'