https://bz.apache.org/bugzilla/show_bug.cgi?id=61841

            Bug ID: 61841
           Summary: Unnecessary long computation when evaluating VLOOKUP
                    on all column reference
           Product: POI
           Version: 3.15-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: SS Common
          Assignee: dev@poi.apache.org
          Reporter: lucamart...@tagetik.com
  Target Milestone: ---

Created attachment 35573
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35573&action=edit
Simple testcase

Hi all,
I spotted a problem in the evaluation of VLOOKUP function when the table area
is defined as all column reference.

Basically, when a "all column" reference is used, the evaluation code treats
the reference as if it's applied to the maximum number of rows available for
the workbook version.

In practice every reference as a $C:$D is translated as a $C$1:$D$1048576.
When such references are used a table argument for a VLOOKUP (exact match) and
the value to be searched is not found, the evaluation code loops for 2^20
times.

A proposed fix could be to translate the "all column" reference to a reference
that goes from row 1 to the maximum row of the considered sheet.

I attached a simple xlsx workbook that takes a *very long* time to evaluate
about 300 VLOOKUPs.

A fix could be to enhance the logic of
OperationEvaluationContext.getDynamicReference to translate the reference to a
narrow area.
I am available for any clarification.

Best regards,
    Luca

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to