Skip to content

Commit c320656

Browse files
committed
Address feedback
- Move `dremio` to `compose.yaml` at project root - Move shebang to first line - add `set_up_dremio_instance.sh` to pre-commit hook - Fix format for variable `SQL_QUERY`
1 parent e09e2d1 commit c320656

5 files changed

Lines changed: 34 additions & 42 deletions

File tree

.github/workflows/cpp_extra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ jobs:
373373
run: docker network create odbc_net
374374
- name: Set Up Dremio Instance
375375
run: |
376-
docker compose -f cpp/src/arrow/flight/sql/odbc/tests/dremio/docker-compose.yml up -d
376+
docker compose up -d dremio
377377
cpp/src/arrow/flight/sql/odbc/tests/dremio/set_up_dremio_instance.sh
378378
- name: Cache Docker Volumes
379379
uses: actions/cache@v5

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ repos:
351351
?^cpp/examples/minimal_build/run\.sh$|
352352
?^cpp/examples/tutorial_examples/run\.sh$|
353353
?^cpp/src/arrow/flight/sql/odbc/install/unix/install_odbc\.sh$|
354+
?^cpp/src/arrow/flight/sql/odbc/tests/dremio/set_up_dremio_instance\.sh$|
354355
?^dev/release/05-binary-upload\.sh$|
355356
?^dev/release/08-binary-verify\.sh$|
356357
?^dev/release/binary-recover\.sh$|

compose.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,24 @@ services:
501501
volumes: *ubuntu-volumes
502502
command: *cpp-command
503503

504+
dremio:
505+
platform: linux/x86_64
506+
image: dremio/dremio-oss:latest
507+
ports:
508+
- 9047:9047 # REST API
509+
- 31010:31010 # JDBC/ODBC
510+
- 32010:32010
511+
container_name: dremio_container
512+
environment:
513+
- DREMIO_JAVA_SERVER_EXTRA_OPTS=-Dsaffron.default.charset=UTF-8 -Dsaffron.default.nationalcharset=UTF-8 -Dsaffron.default.collation.name=UTF-8$$en_US
514+
healthcheck:
515+
test: curl --fail http://localhost:9047 || exit 1
516+
interval: 10s
517+
timeout: 5s
518+
retries: 30
519+
networks:
520+
- odbc_net
521+
504522
ubuntu-cpp-odbc:
505523
# Arrow Flight SQL ODBC build with BUNDLED dependencies with downloaded dependencies.
506524
<<: *ubuntu-cpp-base

cpp/src/arrow/flight/sql/odbc/tests/dremio/docker-compose.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

cpp/src/arrow/flight/sql/odbc/tests/dremio/set_up_dremio_instance.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
#
13
# Licensed to the Apache Software Foundation (ASF) under one
24
# or more contributor license agreements. See the NOTICE file
35
# distributed with this work for additional information
@@ -15,7 +17,6 @@
1517
# specific language governing permissions and limitations
1618
# under the License.
1719

18-
#!/bin/bash
1920
set -e
2021

2122
HOST_URL="http://localhost:9047"
@@ -49,7 +50,18 @@ TOKEN=$(curl -s -X POST "$LOGIN_URL" \
4950
-d "{ \"userName\": \"$ADMIN_USER\", \"password\": \"$ADMIN_PASSWORD\" }" \
5051
| grep -oP '(?<="token":")[^"]+')
5152

52-
SQL_QUERY="Create Table \$scratch.ODBCTest As SELECT CAST(2147483647 AS INTEGER) AS sinteger_max, CAST(9223372036854775807 AS BIGINT) AS sbigint_max, CAST(999999999 AS DECIMAL(38,0)) AS decimal_positive, CAST(3.40282347E38 AS FLOAT) AS float_max, CAST(1.7976931348623157E308 AS DOUBLE) AS double_max, CAST(true AS BOOLEAN) AS bit_true, CAST(DATE '9999-12-31' AS DATE) AS date_max, CAST(TIME '23:59:59' AS TIME) AS time_max, CAST(TIMESTAMP '9999-12-31 23:59:59' AS TIMESTAMP) AS timestamp_max;"
53+
SQL_QUERY="
54+
Create Table \$scratch.ODBCTest As
55+
SELECT CAST(2147483647 AS INTEGER) AS sinteger_max,
56+
CAST(9223372036854775807 AS BIGINT) AS sbigint_max,
57+
CAST(999999999 AS DECIMAL(38,0)) AS decimal_positive,
58+
CAST(3.40282347E38 AS FLOAT) AS float_max,
59+
CAST(1.7976931348623157E308 AS DOUBLE) AS double_max,
60+
CAST(true AS BOOLEAN) AS bit_true,
61+
CAST(DATE '9999-12-31' AS DATE) AS date_max,
62+
CAST(TIME '23:59:59' AS TIME) AS time_max,
63+
CAST(TIMESTAMP '9999-12-31 23:59:59' AS TIMESTAMP) AS timestamp_max;
64+
"
5365
ESCAPED_QUERY=$(printf '%s' "$SQL_QUERY" | sed 's/"/\\"/g')
5466

5567
echo "Creating \$scratch.ODBCTest table."

0 commit comments

Comments
 (0)