code: public static boolean exportSupported(@NonNull JavaSparkContext sc) {
          try {
              return exportSupported(sc.master(), FileSystem.get(sc.hadoopConfiguration()));
          } catch (IOException ex) {
              throw new RuntimeException(ex);
          }
      }
docs: Check if exporting data is supported in the current environment. Exporting is possible in two cases:
  - The master is set to local. In this case any file system, including local FS, will work for exporting.
  - The file system is not local. Local file systems do not work in cluster modes.
  
  @param sc the Spark context
  @return if export is supported