Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't add newlines and indentation when deparsing query (#173)
Without this change our query deparsing logic adds newlines and indentation to the query it sends to DuckDB. While you might expect this to be a nice thing for debugging it actually makes debugging harder in many common cases. A major one is that it results in very little context being provided by DuckDB if a query fails, because it only shows the failing line of the query and even very simple queries are split into multiple lines by `PRETTYFLAG_INDENT`. See the changed tests for the improvement in this area. Also in EXPLAIN ANALYZE the query actually gets more unreadable because DuckDB seems to strip newlines from the query there, but still keeps indentation. So now there's a bunch of weird whitespace being added. Before: ``` > explain analyze select b, b, b from a; QUERY PLAN ────────────────────────────────────────────────────────────────────────────────────────────────────── Custom Scan (DuckDBScan) (cost=0.00..0.00 rows=0 width=0) (actual time=2.033..2.102 rows=1 loops=1) DuckDB Execution Plan: ┌─────────────────────────────────────┐ │┌───────────────────────────────────┐│ ││ Query Profiling Information ││ │└───────────────────────────────────┘│ └─────────────────────────────────────┘ EXPLAIN ANALYZE SELECT b, b, b FROM a ``` After: ``` > explain analyze select b, b, b from a; QUERY PLAN ────────────────────────────────────────────────────────────────────────────────────────────────────── Custom Scan (DuckDBScan) (cost=0.00..0.00 rows=0 width=0) (actual time=2.047..2.115 rows=1 loops=1) DuckDB Execution Plan: ┌─────────────────────────────────────┐ │┌───────────────────────────────────┐│ ││ Query Profiling Information ││ │└───────────────────────────────────┘│ └─────────────────────────────────────┘ EXPLAIN ANALYZE SELECT b, b, b FROM a ```
- Loading branch information