[ 
https://issues.apache.org/jira/browse/IGNITE-27515?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksandr updated IGNITE-27515:
-------------------------------
    Description: 
Implement column truncation in SQL REPL to prevent tables from exceeding 
terminal width.

_Problem:_
Wide tables with many columns or long cell values break terminal formatting. 
Horizontal scrolling is not available, and tables become unreadable.

_Solution:_
Detect terminal width using JLine's terminal.getWidth() and truncate/distribute 
column widths to fit.

_New config keys:_
* ignite.cli.output.truncate (boolean, default: true)
* ignite.cli.output.max-column-width (integer, default: 50)

_Command-line flags:_
* --max-col-width N - override default max column width
* --no-truncate - disable truncation (show full content)

_Considerations:_
* Priority columns (e.g., primary key, ID) may need more width
* Numeric columns should not be truncated mid-number
* Consider smart truncation for different data types

  was:
Implement column truncation in SQL REPL to prevent tables from exceeding 
terminal width.

_Problem:_
Wide tables with many columns or long cell values break terminal formatting. 
Horizontal scrolling is not available, and tables become unreadable.

_Solution:_
Detect terminal width using JLine's terminal.getWidth() and truncate/distribute 
column widths to fit.

_Implementation approach:_
* Get terminal width from JLine terminal
* Calculate available width after borders/padding
* Distribute width across columns (proportional or equal)
* Truncate cells exceeding allocated width with "..." suffix
* Preserve column headers

_New config keys:_
* ignite.cli.output.truncate (boolean, default: true)
* ignite.cli.output.max-column-width (integer, default: 50)

_Command-line flags:_
* --max-col-width N - override default max column width
* --no-truncate - disable truncation (show full content)

_Key files to modify:_
* TableDecorator.java - table rendering logic
* PlainTableRenderer.java - plain text output
* CliConfigKeys.java - config keys

_Considerations:_
* Priority columns (e.g., primary key, ID) may need more width
* Numeric columns should not be truncated mid-number
* Consider smart truncation for different data types


> CLI: Truncate table columns to fit terminal width
> -------------------------------------------------
>
>                 Key: IGNITE-27515
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27515
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Aleksandr
>            Priority: Major
>              Labels: ignite-3
>
> Implement column truncation in SQL REPL to prevent tables from exceeding 
> terminal width.
> _Problem:_
> Wide tables with many columns or long cell values break terminal formatting. 
> Horizontal scrolling is not available, and tables become unreadable.
> _Solution:_
> Detect terminal width using JLine's terminal.getWidth() and 
> truncate/distribute column widths to fit.
> _New config keys:_
> * ignite.cli.output.truncate (boolean, default: true)
> * ignite.cli.output.max-column-width (integer, default: 50)
> _Command-line flags:_
> * --max-col-width N - override default max column width
> * --no-truncate - disable truncation (show full content)
> _Considerations:_
> * Priority columns (e.g., primary key, ID) may need more width
> * Numeric columns should not be truncated mid-number
> * Consider smart truncation for different data types



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to