|
5 | 5 | - [Environment Variables](#environment-variables) |
6 | 6 | - [Adapter Plugin Tests](#adapter-plugin-tests) |
7 | 7 | - [Testing for different Python versions](#different-python-versions) |
8 | | -- [Jaffle Shop Test Project](#jaffle-shop-test-project) |
9 | 8 |
|
10 | 9 |
|
11 | 10 | ## Environment variables <a name='environment-variables'></a> |
@@ -109,181 +108,3 @@ For each environment, you can also see the test runtime as summary |
109 | 108 | py39 - 24 passed in 755.18s (0:12:35) |
110 | 109 | py310 - 24 passed in 764.96s (0:12:44) |
111 | 110 | ``` |
112 | | - |
113 | | -## Jaffle Shop Test Project <a name='jaffle-shop-test-project'></a> |
114 | | - |
115 | | -[Jaffle Shop test project](https://github.com/dbt-labs/jaffle_shop) is a self-contained dbt project which can be used for testing the adapter. |
116 | | - |
117 | | -### Profile |
118 | | - |
119 | | -Setup a `jaffle_shop` profile to connect to the Oracle Database |
120 | | - |
121 | | -```yaml |
122 | | -# ~/.dbt/profiles.yml |
123 | | -jaffle_shop: |
124 | | - target: dev |
125 | | - outputs: |
126 | | - dev: |
127 | | - type: oracle |
128 | | - user: "{{ env_var('DBT_ORACLE_USER') }}" |
129 | | - pass: "{{ env_var('DBT_ORACLE_PASSWORD') }}" |
130 | | - protocol: "tcps" |
131 | | - host: "{{ env_var('DBT_ORACLE_HOST') }}" |
132 | | - port: 1522 |
133 | | - service: "{{ env_var('DBT_ORACLE_SERVICE') }}" |
134 | | - database: "{{ env_var('DBT_ORACLE_DATABASE') }}" |
135 | | - schema: "{{ env_var('DBT_ORACLE_SCHEMA') }}" |
136 | | - threads: 4 |
137 | | - |
138 | | -``` |
139 | | - |
140 | | -### dbt debug |
141 | | - |
142 | | -To test connection, run the `dbt debug` command from the `jaffle_shop` project directory |
143 | | - |
144 | | -```text |
145 | | -Connection: |
146 | | - user: <...> |
147 | | - database: <...> |
148 | | - schema: <...> |
149 | | - protocol: tcps |
150 | | - host: <...> |
151 | | - port: 1522 |
152 | | - service: <...> |
153 | | - connection_string: None |
154 | | - Connection test: [OK connection ok] |
155 | | -
|
156 | | -All checks passed! |
157 | | -``` |
158 | | - |
159 | | - |
160 | | -### Seed `quote_columns` config |
161 | | - |
162 | | -By default, seed configuration `quote_columns` is expected to be False as explained here https://docs.getdbt.com/reference/resource-configs/quote_columns |
163 | | - |
164 | | -However, seed column names are quoted when `dbt seed` command is run. |
165 | | - |
166 | | -This raises `ORA-00904: "AMOUNT": invalid identifier` errors in the subsequent `dbt run` command. |
167 | | - |
168 | | -```text |
169 | | -19:12:11.145108 [error] [MainThread]: Database Error in model stg_payments (models/staging/stg_payments.sql) |
170 | | -19:12:11.145796 [error] [MainThread]: ORA-00904: "AMOUNT": invalid identifier |
171 | | -19:12:11.146445 [error] [MainThread]: compiled SQL at target/run/jaffle_shop/models/staging/stg_payments.sql |
172 | | -19:12:11.147094 [info ] [MainThread]: |
173 | | -19:12:11.147972 [error] [MainThread]: Database Error in model stg_orders (models/staging/stg_orders.sql) |
174 | | -19:12:11.148769 [error] [MainThread]: ORA-00904: "STATUS": invalid identifier |
175 | | -19:12:11.149495 [error] [MainThread]: compiled SQL at target/run/jaffle_shop/models/staging/stg_orders.sql |
176 | | -19:12:11.150168 [info ] [MainThread]: |
177 | | -19:12:11.150703 [error] [MainThread]: Database Error in model stg_customers (models/staging/stg_customers.sql) |
178 | | -19:12:11.151226 [error] [MainThread]: ORA-00904: "LAST_NAME": invalid identifier |
179 | | -19:12:11.151734 [error] [MainThread]: compiled SQL at target/run/jaffle_shop/models/staging/stg_customers.sql |
180 | | -
|
181 | | -``` |
182 | | - |
183 | | -Disable `quote_columns` in `dbt_project.yml`. |
184 | | - |
185 | | -```yaml |
186 | | -name: 'jaffle_shop' |
187 | | -version: '0.1' |
188 | | -profile: 'jaffle_shop' |
189 | | -config-version: 2 |
190 | | - |
191 | | -source-paths: ["models"] |
192 | | -analysis-paths: ["analysis"] |
193 | | -test-paths: ["tests"] |
194 | | -data-paths: ["data"] |
195 | | -macro-paths: ["macros"] |
196 | | - |
197 | | -target-path: "target" |
198 | | -clean-targets: |
199 | | - - "target" |
200 | | - - "dbt_modules" |
201 | | - - "logs" |
202 | | - |
203 | | -models: |
204 | | - jaffle_shop: |
205 | | - materialized: table |
206 | | - staging: |
207 | | - materialized: view |
208 | | - |
209 | | -# Disable seed config quote_columns |
210 | | -seeds: |
211 | | - jaffle_shop: |
212 | | - quote_columns: false |
213 | | -``` |
214 | | -
|
215 | | -### dbt seed |
216 | | -
|
217 | | -```text |
218 | | - |
219 | | -21:20:43 Running with dbt=1.0.1 |
220 | | -21:20:44 Found 5 models, 20 tests, 0 snapshots, 0 analyses, 193 macros, 0 operations, 3 seed files, 0 sources, 0 exposures, 0 metrics |
221 | | -21:20:44 |
222 | | -21:20:51 Concurrency: 4 threads (target='dev') |
223 | | -21:20:51 |
224 | | -21:20:51 1 of 3 START seed file dbt_test.raw_customers................................... [RUN] |
225 | | -21:20:51 2 of 3 START seed file dbt_test.raw_orders...................................... [RUN] |
226 | | -21:20:51 3 of 3 START seed file dbt_test.raw_payments.................................... [RUN] |
227 | | -21:20:54 2 of 3 OK loaded seed file dbt_test.raw_orders.................................. [INSERT 99 in 3.56s] |
228 | | -21:20:54 1 of 3 OK loaded seed file dbt_test.raw_customers............................... [INSERT 100 in 3.56s] |
229 | | -21:20:55 3 of 3 OK loaded seed file dbt_test.raw_payments................................ [INSERT 113 in 4.20s] |
230 | | -21:20:57 |
231 | | -21:20:57 Finished running 3 seeds in 13.23s. |
232 | | -21:20:57 |
233 | | -21:20:57 Completed successfully |
234 | | -21:20:57 |
235 | | -21:20:57 Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 |
236 | | - |
237 | | -``` |
238 | | - |
239 | | - |
240 | | -### dbt run |
241 | | - |
242 | | -```text |
243 | | -21:21:28 Running with dbt=1.0.1 |
244 | | -21:21:28 Found 5 models, 20 tests, 0 snapshots, 0 analyses, 193 macros, 0 operations, 3 seed files, 0 sources, 0 exposures, 0 metrics |
245 | | -21:21:28 |
246 | | -21:21:35 Concurrency: 4 threads (target='dev') |
247 | | -21:21:35 |
248 | | -21:21:35 1 of 5 START view model dbt_test.stg_customers.................................. [RUN] |
249 | | -21:21:35 2 of 5 START view model dbt_test.stg_orders..................................... [RUN] |
250 | | -21:21:35 3 of 5 START view model dbt_test.stg_payments................................... [RUN] |
251 | | -21:21:38 2 of 5 OK created view model dbt_test.stg_orders................................ [OK in 3.07s] |
252 | | -21:21:38 3 of 5 OK created view model dbt_test.stg_payments.............................. [OK in 3.07s] |
253 | | -21:21:38 1 of 5 OK created view model dbt_test.stg_customers............................. [OK in 3.07s] |
254 | | -21:21:38 4 of 5 START table model dbt_test.orders........................................ [RUN] |
255 | | -21:21:38 5 of 5 START table model dbt_test.customers..................................... [RUN] |
256 | | -21:21:41 4 of 5 OK created table model dbt_test.orders................................... [OK in 3.63s] |
257 | | -21:21:41 5 of 5 OK created table model dbt_test.customers................................ [OK in 3.61s] |
258 | | -21:21:43 |
259 | | -21:21:43 Finished running 3 view models, 2 table models in 15.27s. |
260 | | -21:21:43 |
261 | | -21:21:43 Completed successfully |
262 | | -21:21:43 |
263 | | -21:21:43 Done. PASS=5 WARN=0 ERROR=0 SKIP=0 TOTAL=5 |
264 | | -
|
265 | | -``` |
266 | | - |
267 | | -### dbt test |
268 | | - |
269 | | -```text |
270 | | -21:23:10 Running with dbt=1.0.1 |
271 | | -21:23:10 Found 5 models, 20 tests, 0 snapshots, 0 analyses, 193 macros, 0 operations, 3 seed files, 0 sources, 0 exposures, 0 metrics |
272 | | -21:23:10 |
273 | | -21:23:16 Concurrency: 4 threads (target='dev') |
274 | | -21:23:16 |
275 | | -.... |
276 | | -.... |
277 | | -.... |
278 | | -.... |
279 | | -21:23:34 17 of 20 PASS unique_orders_order_id............................................ [PASS in 2.78s] |
280 | | -21:23:35 20 of 20 PASS unique_stg_payments_payment_id.................................... [PASS in 2.08s] |
281 | | -21:23:35 19 of 20 PASS unique_stg_orders_order_id........................................ [PASS in 2.40s] |
282 | | -21:23:37 |
283 | | -21:23:37 Finished running 20 tests in 27.14s. |
284 | | -21:23:37 |
285 | | -21:23:37 Completed successfully |
286 | | -21:23:37 |
287 | | -21:23:37 Done. PASS=20 WARN=0 ERROR=0 SKIP=0 TOTAL=20 |
288 | | -
|
289 | | -``` |
0 commit comments