Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-3884

Better align columns in DESCRIBE table_name output to make more human-readable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.0
    • 0.11.0
    • CLI
    • None
    • Reviewed
    • Introduces new DESCRIBE PRETTY table_name command and hive.cli.pretty.output.num.cols conf parameter.

    Description

      If a table contains very long comments or very long column names, the output of DESCRIBE table_name is not aligned nicely. The attached screenshot shows the following two problems:

      1. Rows with long column names do not align well with other columns.
      2. Rows with long comments wrap to the next line, and make it hard to read the output. The wrapping behavior depends on the width of the user's terminal width.

      It will be nice to have a DESCRIBE PRETTY table_name command that will produce nicely formatted output that avoids the two problems mentioned above. It is better to introduce a new DESCRIBE PRETTY command rather than change the behavior of the existing DESCRIBE or DESCRIBE FORMATTED commands, so that we avoid breaking any scripts that automatically parse the output.

      Since the pretty formatting depends on the current terminal width, we need a new hive conf parameter to tell the CLI to auto-detect the current terminal width or to use a fixed width (needed for unit tests).

      Attachments

        1. describe_test_table.png
          46 kB
          Dilip Joseph
        2. HIVE-3884.1.patch.txt
          32 kB
          Dilip Joseph
        3. HIVE-3884.2.patch.txt
          43 kB
          Dilip Joseph

        Activity

          People

            dilipjoseph Dilip Joseph
            dilipjoseph Dilip Joseph
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: