This is an automated email from the ASF dual-hosted git repository.
mattyb149 pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
new ed733176a3 NIFI-13726 Set cell style copy policy to false in order to
avoid exceeding the maximum number of cell styles (64000) in a .xlsx Workbook
ed733176a3 is described below
commit ed733176a33c90d09e9ecef5030e0850ec155c45
Author: dan-s1 <[email protected]>
AuthorDate: Fri Sep 27 13:10:26 2024 +0000
NIFI-13726 Set cell style copy policy to false in order to avoid exceeding
the maximum number of cell styles (64000) in a .xlsx Workbook
Signed-off-by: Matt Burgess <[email protected]>
---
.../src/main/java/org/apache/nifi/processors/poi/SplitExcel.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git
a/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-processors/src/main/java/org/apache/nifi/processors/poi/SplitExcel.java
b/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-processors/src/main/java/org/apache/nifi/processors/poi/SplitExcel.java
index c1a75b936f..602a1a486c 100644
---
a/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-processors/src/main/java/org/apache/nifi/processors/poi/SplitExcel.java
+++
b/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-processors/src/main/java/org/apache/nifi/processors/poi/SplitExcel.java
@@ -63,8 +63,10 @@ import static
org.apache.nifi.flowfile.attributes.FragmentAttributes.SEGMENT_ORI
@Tags({"split", "text"})
@InputRequirement(InputRequirement.Requirement.INPUT_REQUIRED)
@CapabilityDescription("Splits a multi sheet Microsoft Excel spreadsheet into
multiple Microsoft Excel spreadsheets where each sheet from the original" +
- " file is converted to an individual spreadsheet in its own flow file.
This processor is currently only capable of processing .xlsx "
- + "(XSSF 2007 OOXML file format) Excel documents and not older .xls
(HSSF '97(-2007) file format) documents.")
+ " file is converted to an individual spreadsheet in its own flow file.
This processor is currently only capable of processing .xlsx" +
+ " (XSSF 2007 OOXML file format) Excel documents and not older .xls
(HSSF '97(-2007) file format) documents." +
+ " NOTE: All original cell styles are dropped when splitting into
multiple Microsoft Excel spreadsheets."
+)
@WritesAttributes({
@WritesAttribute(attribute = "fragment.identifier", description = "All
split Excel FlowFiles produced from the same parent Excel FlowFile will have
the same randomly generated UUID added" +
" for this attribute"),
@@ -141,7 +143,7 @@ public class SplitExcel extends AbstractProcessor {
private static final Set<Relationship> RELATIONSHIPS;
private static final CellCopyPolicy CELL_COPY_POLICY = new
CellCopyPolicy.Builder()
.cellFormula(CellCopyPolicy.DEFAULT_COPY_CELL_FORMULA_POLICY)
- .cellStyle(CellCopyPolicy.DEFAULT_COPY_CELL_STYLE_POLICY)
+ .cellStyle(false) // NOTE: setting to false avoids exceeding the
maximum number of cell styles (64000) in a .xlsx Workbook.
.cellValue(CellCopyPolicy.DEFAULT_COPY_CELL_VALUE_POLICY)
.condenseRows(CellCopyPolicy.DEFAULT_CONDENSE_ROWS_POLICY)
.copyHyperlink(CellCopyPolicy.DEFAULT_COPY_HYPERLINK_POLICY)