Uploaded image for project: 'Hue (READ ONLY)'
  1. Hue (READ ONLY)
  2. HUE-2696

Download as XLS Feature Should Disable with > 256 Columns

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.7.0
    • Fix Version/s: None
    • Component/s: con.impala
    • Labels:
      None

      Description

      When you run a query in the query editor that returns more than 256 columns and try to download as XLS you get an error like this:

      Traceback (most recent call last):
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/desktop/core/src/desktop/lib/wsgiserver.py", line 1198, in communicate
          req.respond()
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/desktop/core/src/desktop/lib/wsgiserver.py", line 568, in respond
          self._respond()
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/desktop/core/src/desktop/lib/wsgiserver.py", line 582, in _respond
          for chunk in response:
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/utils/six.py", line 535, in next
          return type(self).__next__(self)
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/http/response.py", line 292, in __next__
          return self.make_bytes(next(self._iterator))
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/desktop/core/src/desktop/lib/export_csvxls.py", line 73, in create_generator
          yield dataset(headers, data, encoding).xls
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/tablib-0.9.11-py2.6.egg/tablib/formats/_xls.py", line 44, in export_set
          dset_sheet(dataset, ws)
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/tablib-0.9.11-py2.6.egg/tablib/formats/_xls.py", line 116, in dset_sheet
          ws.write(i, j, col, bold)
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/tablib-0.9.11-py2.6.egg/tablib/packages/xlwt/Worksheet.py", line 1003, in write
          self.row(r).write(c, label, style)
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/tablib-0.9.11-py2.6.egg/tablib/packages/xlwt/Row.py", line 226, in write
          self.__adjust_bound_col_idx(col)
        File "/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.23/lib/hue/build/env/lib/python2.6/site-packages/tablib-0.9.11-py2.6.egg/tablib/packages/xlwt/Row.py", line 76, in __adjust_bound_col_idx
          raise ValueError("column index (%r) not an int in range(256)" % arg)
      ValueError: column index (256) not an int in range(256)
      

      My quick research suggests that XLS can never have 256+ columns. We should not even offer the download as XLS feature when there are too many columns to return.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                alanj Alan Jackoway
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: