Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-23963

Queries on text-based Hive tables grow disproportionately slower as the number of columns increase

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.2.2, 2.3.1, 2.4.0
    • Component/s: SQL
    • Labels:
      None

      Description

      TableReader gets disproportionately slower as the number of columns in the query increase.

      For example, reading a table with 6000 columns is 4 times more expensive per record than reading a table with 3000 columns, rather than twice as expensive.

      The increase in processing time is due to several Lists (fieldRefs, fieldOrdinals, and unwrappers), each of which the reader accesses by column number for each column in a record. Because each List has O(n) time for lookup by column number, these lookups grow increasingly expensive as the column count increases.

      When I patched the code to change those 3 Lists to Arrays, the query times became proportional.

       

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              bersprockets Bruce Robbins
              Reporter:
              bersprockets Bruce Robbins
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: