Skip to content

Commit 0ef674b

Browse files
authored
GH-48834 [C++][FlightRPC][Doc] Add instructions to run ODBC tests in README (#48835)
### Rationale for this change #48834 ODBC layer tests are not run in the CI due to [blockers](#48019 (comment)), contributors have the option to follow this guide to run ODBC tests on their local machines. ### What changes are included in this PR? - Add instructions to run ODBC tests in `README`, includes guides to set up Dremio oss docker instance ### Are these changes tested? Markdown changes tested in CI ### Are there any user-facing changes? N/A * GitHub Issue: #48834 Lead-authored-by: Alina (Xi) Li <[email protected]> Co-authored-by: Alina (Xi) Li <[email protected]> Signed-off-by: David Li <[email protected]>
1 parent fed23f3 commit 0ef674b

File tree

1 file changed

+62
-3
lines changed

1 file changed

+62
-3
lines changed

cpp/src/arrow/flight/sql/odbc/README.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ After the build succeeds, the ODBC DLL will be located in
2727
2. Register your ODBC DLL:
2828

2929
Need to replace `<path\to\repo>` with actual path to repository in the commands.
30-
1. `cd to repo.`
31-
2. `cd <path\to\repo>`
32-
3. Run script to register your ODBC DLL as Apache Arrow Flight SQL ODBC Driver
30+
31+
1. `cd <path\to\repo>`
32+
2. Run script to register your ODBC DLL as Apache Arrow Flight SQL ODBC Driver
3333
```
3434
.\cpp\src\arrow\flight\sql\odbc\tests\install_odbc.cmd <path\to\repo>\cpp\build\< release | debug >\< Release | Debug>\arrow_flight_sql_odbc.dll
3535
```
@@ -65,3 +65,62 @@ The characters are case-insensitive.
6565
The Windows ODBC driver currently does not support writing log files. `ARROW_USE_GLOG` is required to write log files, and `ARROW_USE_GLOG` is disabled on Windows platform since plasma using `glog` is not fully tested on windows.
6666
6767
Note: GH-47670 running more than 1 tests with logging enabled is not fully supported.
68+
69+
## Steps to Run the ODBC tests
70+
After ODBC has been registered, you can run the ODBC tests. It is recommended to run the ODBC tests locally first.
71+
72+
1. Run ODBC unit test:
73+
74+
```
75+
.\cpp\build\< release | debug >\< Release | Debug>\arrow-odbc-spi-impl-test.exe
76+
```
77+
2. Set up and run ODBC remote test:
78+
79+
1. Set up a Dremio open source docker instance:
80+
81+
1. Run this command inside the docker terminal to create a Dremio open source docker.
82+
```
83+
docker run -p 9047:9047 -p 31010:31010 -p 45678:45678 -p 32010:32010 -e DREMIO_JAVA_SERVER_EXTRA_OPTS=-Dpaths.dist=file:///opt/dremio/data/dist dremio/dremio-oss
84+
```
85+
86+
2. Enable unicode support in Docker:
87+
88+
1. Open `dremio-env` in an editor. The file is located in the `/opt/dremio/conf` directory.
89+
2. Set the `DREMIO_JAVA_SERVER_EXTRA_OPTS` property to the following value:
90+
```
91+
DREMIO_JAVA_SERVER_EXTRA_OPTS='-Dsaffron.default.charset=UTF-8 -Dsaffron.default.nationalcharset=UTF-8 -Dsaffron.default.collation.name=UTF-8$en_US'
92+
```
93+
3. Navigate to: http://localhost:9047 and create an user account. The account credentials will be used for remote testing.
94+
95+
4. Create test table:
96+
97+
Run this query inside Dremio
98+
```
99+
Create Table $scratch.ODBCTest As
100+
SELECT
101+
CAST(2147483647 AS INTEGER) AS sinteger_max,
102+
103+
CAST(9223372036854775807 AS BIGINT) AS sbigint_max,
104+
105+
CAST(999999999 AS DECIMAL(38, 0)) AS decimal_positive,
106+
107+
CAST(3.40282347E38 AS FLOAT) AS float_max,
108+
109+
CAST(1.7976931348623157E308 AS DOUBLE) AS double_max,
110+
111+
CAST(true AS BOOLEAN) AS bit_true,
112+
113+
CAST(DATE '9999-12-31' AS DATE) AS date_max,
114+
CAST(TIME '23:59:59' AS TIME) AS time_max,
115+
CAST(TIMESTAMP '9999-12-31 23:59:59' AS TIMESTAMP) AS timestamp_max;
116+
```
117+
5. The docker instance only needs to be set up once, and can be re-used for running the tests.
118+
2. Replace `REDACTED` with actual Dremio docker credentials in the command. Set environment variable `ARROW_FLIGHT_SQL_ODBC_CONN` to
119+
```
120+
driver={Apache Arrow Flight SQL ODBC Driver};HOST=localhost;port=32010;pwd=REDACTED;uid=REDACTED;useEncryption=false;useWideChar=true;
121+
```
122+
3. Run ODBC remote test:
123+
124+
```
125+
.\cpp\build\< release | debug >\< Release | Debug>\arrow-flight-sql-odbc-test.exe
126+
```

0 commit comments

Comments
 (0)