public static Collection<DatasetDescriptor> findPotentialDatasets(
      FileSystem fs, Path path) throws IOException {
    List<DatasetDescriptor> descriptors = Lists.newArrayList();

    Result result = visit(new FindDatasets(), fs, path);
    if (result instanceof Result.Table) {
      descriptors.add(descriptor(fs, (Result.Table) result));
    } else if (result instanceof Result.Group) {
      for (Result.Table table : ((Result.Group) result).tables) {
        descriptors.add(descriptor(fs, table));
      }
    }

    return descriptors;
  }
public static Collection < DatasetDescriptor > findPotentialDatasets ( FileSystem fs , Path path ) throws IOException { List < DatasetDescriptor > descriptors = Lists . newArrayList ( ) ; Result result = visit ( new FindDatasets ( ) , fs , path ) ; if ( result instanceof Result . Table ) { descriptors . add ( descriptor ( fs , ( Result . Table ) result ) ) ; } else if ( result instanceof Result . Group ) { for ( Result . Table table : ( ( Result . Group ) result ) . tables ) { descriptors . add ( descriptor ( fs , table ) ) ; } } return descriptors ; }
Finds potential datasets by crawling a directory tree.
<p>
This method looks for any data files and directories appear to form a
dataset. This deliberately ignores information that may be stored in the
Hive metastore or .metadata folders.
<p>
Recognizes only Avro, Parquet, and JSON data files.

@param fs a FileSystem for the root path
@param path a root Path that will be searched
@return a Collection with a DatasetDescriptor for each potential dataset.
@throws IOException