Package com.palantir.transforms.excel
Class ParseResult
java.lang.Object
com.palantir.transforms.excel.ParseResult
The return value from
TransformsExcelParser.parse(Dataset)
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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 theTransformsExcelParser
object using the methodsImmutableTransformsExcelParser.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 aPasswordProvider
was included as part of the configuration of theTransformsExcelParser
that generated thisParseResult
.abstract org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>
ADataset<Row>
containing information about errors that occurred during parsing.final Optional<org.apache.spark.sql.Dataset<org.apache.spark.sql.Row>>
A convenience method for when only one parser is passed.
-
Constructor Details
-
ParseResult
public ParseResult()
-
-
Method Details
-
keyToDataframe
-
errorDataframe
public abstract org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> errorDataframe()ADataset<Row>
containing information about errors that occurred during parsing. The dataset will contain columnsfile_path
,error
, andparser_key
. It will additionally contain afile_modified_timestamp
column if theTransformsExcelParser.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 aPasswordProvider
was included as part of the configuration of theTransformsExcelParser
that generated thisParseResult
. It will contain columnsfile_path
(string),succeeded
(boolean)attempted_passwords
(an array of strings), andsuccessful_password
(string). It will additionally contain afile_modified_timestamp
column if theTransformsExcelParser.includeFileModifiedTimestamp()
setting is true. -
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 theTransformsExcelParser
object using the methodsImmutableTransformsExcelParser.Builder.putKeyToParser(String, Parser)
. If you created theTransformsExcelParser
usingTransformsExcelParser.of(Parser)
orTransformsExcelParser.of(Parser, PasswordProvider)
, ignore this method in favor ofsingleResult()
.
-