[MDBF-79] Decide on basic output formatting Created: 2020-05-25 Updated: 2022-02-01 Due: 2020-06-03 |
|
| Status: | Closed |
| Project: | MariaDB Foundation Development |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Kaj Arnö | Assignee: | Robert Bindar |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | jupyter | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Decide how to counter Robert’s observation that “the mariadb client does some weird stuff to make the output look better” |
| Comments |
| Comment by Vicențiu Ciorbaru [ 2020-06-01 ] |
|
This will be problematic! Parsing output from mariadb client is tricky as the data itself can look like column separators. For example, what if the table contains values like |. This looks rather messy and there is no clear way to fix this. Looking at mariadb client docs, --raw and --batch flags sent to mariadb client might be the key to distinguish between column data and column separators. |
| Comment by Kaj Arnö [ 2020-06-03 ] |
|
That is why my preference would be to avoid the need for parsing, and instead write the contents via a CSV file using a pandas DataFrame. Then, no need to parse. Robert? |
| Comment by Robert Bindar [ 2020-06-03 ] |
|
Indeed it is problematic, I can't see all the edge cases now, I guess we'll encounter more as we move forward with the project. But for the case cvicentiu mentioned above, --batch is probably not necessarily needed and --raw only disables escaping of special characters. With --silent, you get rid of special bytes used for beautifying text in the terminal and also get escaping enabled for chars such as \n \t. But indeed, the arbitrary data that can reside in some of our fields might give us headaches. |
| Comment by Kaj Arnö [ 2020-06-03 ] |
|
My suggestion: Let's avoid even trying to do parsing of --raw (due to issues mentioned by Vicentiu). I think all the three other options you list – CSV, XML, HTML – sound safer and better. Feel free to experiment! |
| Comment by Robert Bindar [ 2020-10-28 ] |
|
`--silent --html` seemed like the best choice. Issue to be reopened if at some point we realize there are better options available. |