Class ParseResult

java.lang.Object
com.palantir.transforms.excel.ParseResult

@Immutable public abstract class ParseResult extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Optional<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>
    Get the result dataframe associated with a key, as configured when creating the TransformsExcelParser object using the methods ImmutableTransformsExcelParser.Builder.putKeyToParser(String, Parser).
    abstract org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>
    Details about successful and failed attempts to open password-protected files, if a PasswordProvider was included as part of the configuration of the TransformsExcelParser that generated this ParseResult.
    abstract org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>
    A Dataset<Row> containing information about errors that occurred during parsing.
    protected abstract Map<String,org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>
     
    final Optional<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>
    A convenience method for when only one parser is passed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParseResult

      public ParseResult()
  • Method Details

    • keyToDataframe

      protected abstract Map<String,org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>> keyToDataframe()
    • errorDataframe

      public abstract org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> errorDataframe()
      A Dataset<Row> containing information about errors that occurred during parsing. The dataset will contain columns file_path, error, and parser_key. It will additionally contain a file_modified_timestamp column if the TransformsExcelParser.includeFileModifiedTimestamp() setting is true. parser_key will be null if the error happened when trying to load the file into Apache POI and is therefore not specific to a single parser. Checking the contents of the dataset returned from this method is the only way to detect errors during parsing, and conversely, ignoring the contents of the dataset returned from this method results in silently dropping data that has errors.
    • decryptionResultDataframe

      public abstract org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> decryptionResultDataframe()
      Details about successful and failed attempts to open password-protected files, if a PasswordProvider was included as part of the configuration of the TransformsExcelParser that generated this ParseResult. It will contain columns file_path (string), succeeded (boolean) attempted_passwords (an array of strings), and successful_password (string). It will additionally contain a file_modified_timestamp column if the TransformsExcelParser.includeFileModifiedTimestamp() setting is true.
    • singleResult

      public final Optional<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>> singleResult()
      A convenience method for when only one parser is passed. It returns Empty when no rows were extracted.
    • dataframeForKey

      public final Optional<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>> dataframeForKey(String key)
      Get the result dataframe associated with a key, as configured when creating the TransformsExcelParser object using the methods ImmutableTransformsExcelParser.Builder.putKeyToParser(String, Parser). If you created the TransformsExcelParser using TransformsExcelParser.of(Parser) or TransformsExcelParser.of(Parser, PasswordProvider), ignore this method in favor of singleResult().