alamb opened a new pull request, #4497:
URL: https://github.com/apache/arrow-datafusion/pull/4497
# Which issue does this PR close?
re https://github.com/apache/arrow-datafusion/issues/4460
# Rationale for this change
While debugging a sqllogictest I would like to run a single file at a time
rather than all in the directory. I would also like the ability to see debug
logts, etc
# What changes are included in this PR?
1. Initialize `env_logger` so setting `RUST_LOG` is respted
2. Add ability to specify files on the command line,
3. Documentation
Note, I did not bring in Clap or some other full featured command line
parser. I figured if/when we need the ability to add more flags, we could bring
it in.
Also I tried to avoid making changes that would conflict with
https://github.com/apache/arrow-datafusion/pull/4496 from @xudong963
# Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are
they covered by existing tests)?
-->
# Are there any user-facing changes?
No
# Examples
Example running with just one file:
```shell
cargo test -p datafusion --test sqllogictests -- information_schema.slt
Running: tests/sqllogictests/test_files/information_schema.slt
Enabling information schema
[information_schema.slt] Running query: "SHOW ALL"
[information_schema.slt] Running query: "SHOW
datafusion.execution.batch_size"
[information_schema.slt] Running query: "SHOW TIME ZONE"
[information_schema.slt] Running query: "SHOW TIMEZONE"
```
Example with logging:
```shell
RUST_LOG=debug cargo test -p datafusion --test sqllogictests --
information_schema.slt
[2022-12-04T12:30:03Z INFO sqllogictests] Test directory:
tests/sqllogictests/test_files
[2022-12-04T12:30:03Z INFO sqllogictests] Running test files
["tests/sqllogictests/test_files/information_schema.slt"]
Running: tests/sqllogictests/test_files/information_schema.slt
Enabling information schema
[2022-12-04T12:30:03Z DEBUG datafusion::execution::memory_manager] Creating
memory manager with initial size 11744051.2 TB
[information_schema.slt] Running query: "SHOW ALL"
[2022-12-04T12:30:03Z DEBUG sqlparser::parser] parsing expr
[2022-12-04T12:30:03Z DEBUG sqlparser::parser] prefix: Identifier(Ident {
value: "name", quote_style: None })
[2022-12-04T12:30:03Z DEBUG sqlparser::parser] get_next_precedence() Comma
[2022-12-04T12:30:03Z DEBUG sqlparser::parser] 0: , 1: setting 2: FROM
....
```
--
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]