Running your dbt project with Hive or Impala

This task guides you through testing your dbt connection and executing various commands within your dbt project for Hive or Impala.

After configuring your dbt profiles, you can verify your connection and then run common dbt commands for seeding data, running models, executing tests, and generating documentation for your warehouse-connected project. The example project provides a structured way to understand dbt capabilities.

  • Your environment and dbt profiles for Cloudera Data Warehouse Hive or Impala must be configured.
  • You must be in your dbt project directory.
  1. Run a connection test using the dbt debug command to ensure your profiles are configured correctly.
    % dbt debug
    Running with dbt=1.8.8
    dbt version: 1.8.8
    python version: 3.11.9
    python path:
    ...
    adapter type: hive
    adapter version: 1.8.0
    Configuration:
      profiles.yml file [OK found and valid]
      dbt_project.yml file [OK found and valid]
    Required dependencies:
      - git [OK found]
    Connection:
      host: hs2-dbt-hive.xxxx.xxx
      schema: explain_merge
      user: test_user
    Registered adapter: hive=1.8.0
      Connection test: [OK connection ok]
    All checks passed!
    
    % dbt debug
    Running with dbt=1.9.8
    dbt version: 1.9.8
    python version: 3.11.9
    python path: 
    ...
    adapter type: impala
    adapter version: 1.9.0
    Configuration:
      profiles.yml file [OK found and valid]
      dbt_project.yml file [OK found and valid]
    Required dependencies:
      - git [OK found]
    Connection:
      host: coordinator-impala-xxxxxx.xxx
      port: 443
      schema: impala_demo
      username: test_user
    Registered adapter: impala=1.9.0
      Connection test: [OK connection ok]
    All checks passed!
    
  2. Load data by using the dbt seed command.
    % dbt seed
    Running with dbt=1.8.8
    Registered adapter: hive=1.8.0
    Unable to do partial parsing because saved manifest not found. Starting full parse.
    Found 2 models, 4 seeds, 13 data tests, 2 sources, 449 macros
    Concurrency: 4 threads (target='dev_hive')
    ...
    ...
    Finished running 4 seeds in 0 hours 5 minutes and 58.35 seconds (358.35s).
    Completed successfully
    Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4
    
    % dbt seed
    Running with dbt=1.9.8
    Registered adapter: impala=1.9.0
    Found 2 models, 4 seeds, 13 data tests, 2 sources, 445 macros
    Concurrency: 1 threads (target='dev_cdp')
    ...
    ...
    Finished running 4 seeds in 0 hours 3 minutes and 37.81 seconds (217.81s).
    Completed successfully
    Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4
    
  3. Run models by using the dbt run command.
    % dbt run
    Running with dbt=1.8.8
    Registered adapter: hive=1.8.0
    ...
    Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2
    
    % dbt run
    Running with dbt=1.9.8
    Registered adapter: impala=1.9.0
    ...
    Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2
  4. Generate documents by using the dbt docs generate command.
    % dbt docs generate
    Running with dbt=1.8.8
    Registered adapter: hive=1.8.0
    Found 4 seeds, 13 data tests, 2 models, 2 sources, 449 macros
    Concurrency: 4 threads (target='dev_hive')
    Building catalog
    Catalog written to /dbt_hive_demo/target/catalog.json
    % dbt docs generate
    Running with dbt=1.9.8
    Registered adapter: impala=1.9.0
    Found 2 models, 4 seeds, 13 data tests, 2 sources, 445 macros
    Concurrency: 1 threads (target='dev_cdp')
    Building catalog
    Catalog written to /dbt-impala-example/dbt_impala_demo/target/catalog.json
    
    You can view the documentation locally by running the dbt docs serve command in your terminal. This starts a web server and opens the documentation website in your default browser. For more information, see dbt docs commands.
You have successfully tested your dbt connection and executed various dbt commands, including seeding data, running tests, building models, and generating documentation within your warehouse-connected dbt project. You can review the database and table in Hue UI.