spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/boundary/BoundaryInputFormat.java [60:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public List<InputSplit> getSplits(JobContext job) throws IOException {
    // get original combine split.
    CombineFileSplit combineSplit = (CombineFileSplit) super.getSplits(job).get(0);
    Path[] paths = combineSplit.getPaths();

    // get indexes of all .shp file
    List<Integer> shpIds = new ArrayList<>();
    for (int i = 0; i < paths.length; ++i) {
      if (FilenameUtils.getExtension(paths[i].toString()).equalsIgnoreCase("shp")) {
        shpIds.add(i);
      }
    }

    // prepare parameters for constructing new combine split
    Path[] shpPaths = new Path[shpIds.size()];
    long[] shpStarts = new long[shpIds.size()];
    long[] shpLengths = new long[shpIds.size()];

    for (int i = 0; i < shpIds.size(); ++i) {
      int id = shpIds.get(i);
      shpPaths[i] = combineSplit.getPath(id);
      shpStarts[i] = combineSplit.getOffset(id);
      shpLengths[i] = combineSplit.getLength(id);
    }

    // combine all .shp splits as one split.
    CombineFileSplit shpSplit =
        new CombineFileSplit(shpPaths, shpStarts, shpLengths, combineSplit.getLocations());
    List<InputSplit> shpSplits = new ArrayList<>();
    shpSplits.add(shpSplit);
    return shpSplits;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



spark/common/src/main/java/org/apache/sedona/core/formatMapper/shapefileParser/fieldname/FieldnameInputFormat.java [60:91]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public List<InputSplit> getSplits(JobContext job) throws IOException {
    // get original combine split.
    CombineFileSplit combineSplit = (CombineFileSplit) super.getSplits(job).get(0);
    Path[] paths = combineSplit.getPaths();

    // get indexes of all .shp file
    List<Integer> shpIds = new ArrayList<>();
    for (int i = 0; i < paths.length; ++i) {
      if (FilenameUtils.getExtension(paths[i].toString()).equalsIgnoreCase("dbf")) {
        shpIds.add(i);
      }
    }

    // prepare parameters for constructing new combine split
    Path[] shpPaths = new Path[shpIds.size()];
    long[] shpStarts = new long[shpIds.size()];
    long[] shpLengths = new long[shpIds.size()];

    for (int i = 0; i < shpIds.size(); ++i) {
      int id = shpIds.get(i);
      shpPaths[i] = combineSplit.getPath(id);
      shpStarts[i] = combineSplit.getOffset(id);
      shpLengths[i] = combineSplit.getLength(id);
    }

    // combine all .shp splits as one split.
    CombineFileSplit shpSplit =
        new CombineFileSplit(shpPaths, shpStarts, shpLengths, combineSplit.getLocations());
    List<InputSplit> shpSplits = new ArrayList<>();
    shpSplits.add(shpSplit);
    return shpSplits;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



