alamb commented on code in PR #5015: URL: https://github.com/apache/arrow-datafusion/pull/5015#discussion_r1083509630
########## datafusion/core/tests/sqllogictests/README.md: ########## @@ -46,16 +46,33 @@ cargo test -p datafusion --test sqllogictests -- information #### Running tests: Postgres compatibility -Test files that start with prefix `pg_compat_` verify compatibility with Postgres. -Datafusion runs these test files during normal sqllogictest runs. +Test files that start with prefix `pg_compat_` verify compatibility +with Postgres by running the same script files both with DataFusion and with Posgres -In order to run sqllogictests with Postgres execute: +In order to run the sqllogictests running against a previously running Postgres instance, do: ```shell -PG_COMPAT=true cargo test -p datafusion --test sqllogictests +PG_COMPAT=true PG_DSN="postgresql://[email protected]/postgres" cargo test -p datafusion --test sqllogictests ``` -This command requires a docker binary. Check that docker is properly installed with `which docker`. +The environemnt variables: + +1. `PG_COMPAT` instructs sqllogictest to run against Postgres (not DataFusion) +2. `PG_DSN` contains a `libpq` style connection string, whose format is described in + [the docs](https://docs.rs/tokio-postgres/latest/tokio_postgres/config/struct.Config.html#url) + +One way to create a suitable a posgres container in docker is to use +the [Official Image](https://hub.docker.com/_/postgres) with a command +such as the following. Note the collation **must** be set to `C` otherwise +`ORDER BY` will not match DataFusion and the tests will diff. + +```shell +docker run \ Review Comment: I think `--rm` removes the container. I normally prefer to leave them around for debugging -- 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]
