Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-22940

Make SQL client column max width configurable

    XMLWordPrintableJSON

Details

    Description

      When displaying results interactively with the Flink SQL client, each column is currently truncated based on its content type, up to a maximum of 30 characters, which is controlled by the java constant [1].

      In case some result to be displayed is too wide, a ~ is  appended a the end to indicate the truncation (actually happening in practice at position 25), as visible below:
       
       

       SELECT
         metadata.true_as_of_timestamp_millis,
         member_user_id
       FROM some_table
        
       true_as_of_timestamp_mil~            member_user_id             
                    1622811665919 45ca821f-c0fc-4114-bef8-~            
                    1622811665919 45ca821f-c0fc-4114-bef8-~            
                    1622118951005 b4734391-d3e1-417c-ad92-~            
       

       
      I suggest to make this max width configurable, by adding a parameter that can be `SET` to [2].
       
      I also suggest to make the default width wide enough s.t. 36 usable characters can be displayed, since UUID (which are 36 character longs when represented in text) are very
      commonly used as identifiers, and therefore as column values.
      This seems like a easy code update, if it's useful I'm happy to work on the implementation.

      [1] https://github.com/apache/flink/blob/6d8c02f90a5a3054015f2f1ee83be821d925ccd1/flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/PrintUtils.java#L74

      [2] https://github.com/apache/flink/blob/master/flink-table/flink-sql-client/src/main/java/org/apache/flink/table/client/config/SqlClientOptions.java

       

      Attachments

        Issue Links

          Activity

            People

              svend Svend Vanderveken
              svend Svend Vanderveken
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: