capkurmagati commented on pull request #1284:
URL: https://github.com/apache/arrow-datafusion/pull/1284#issuecomment-967157435
@Jimexist I took a look at the psql's formatting command. It looks like this.
```
Formatting
\a toggle between unaligned and aligned output mode
\C [STRING] set table title, or unset if none
\f [STRING] show or set field separator for unaligned query
output
\H toggle HTML output mode (currently on)
\pset [NAME [VALUE]] set table output option
(border|columns|csv_fieldsep|expanded|fieldsep|
```
```
postgres=# \pset format
Output format is aligned.
postgres=# select 1 as a, 2 as b;
a | b
---+---
1 | 2
(1 row)
postgres=# \pset format csv
Output format is csv.
postgres=# select 1 as a, 2 as b;
a,b
1,2
postgres=# \pset format html
Output format is html.
postgres=# select 1 as a, 2 as b;
<table border="1">
<tr>
<th align="center">a</th>
<th align="center">b</th>
</tr>
<tr valign="top">
<td align="right">1</td>
<td align="right">2</td>
</tr>
</table>
<p>(1 row)<br />
</p>
```
Current implementation doesn't support multiple arguments yet.
https://github.com/apache/arrow-datafusion/blob/master/datafusion-cli/src/command.rs#L110
One option is to use `\format` for this pr and create another issue to make
`\` command support multiple arguments.
But also given it's a breaking change to deprecate `\format` in favor of
`\pset format` later, to implement it at once seems reasonable.
WDYT.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]