This is an automated email from the ASF dual-hosted git repository.

mattyb149 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 44ae874032 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
44ae874032 is described below

commit 44ae87403226482719583ac9fc13699ac6f5c202
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]>
    
    This closes #9326
---
 .../main/java/org/apache/nifi/processors/excel/SplitExcel.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/processors/excel/SplitExcel.java
 
b/nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/processors/excel/SplitExcel.java
index 62ac79fd14..727440b921 100644
--- 
a/nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/processors/excel/SplitExcel.java
+++ 
b/nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/processors/excel/SplitExcel.java
@@ -60,8 +60,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"),
@@ -110,7 +112,7 @@ public class SplitExcel extends AbstractProcessor {
     private static final Set<Relationship> RELATIONSHIPS = 
Set.of(REL_ORIGINAL, REL_FAILURE, REL_SPLIT);
     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)

Reply via email to