The problem I’m having
I’m on my 2nd attempt to install dbt for sql-server on prem. I get through the installation and do dbt debug and it completes successfully.
When I go to open the provided models with the install I get a “Incorrect syntax near ‘materialed’. Expected ‘(’ or ‘SELECT’”
I can find no information online about why this is happening. In all instructions, video and CoPilot, at this point I should be able to create and use the models.
The context of why I’m trying to do this
New install - just getting started
What I’ve already tried
Removed and re-installed for python up
Some example code or error messages
This is the code that came with the install
Error Message: Incorrect syntax near ‘materialized’. Expecting ‘(’, or SELECT.
/*
Welcome to your first dbt model!
Did you know that you can also configure models directly within SQL files?
This will override configurations stated in dbt_project.yml
Try changing "table" to "view" below
*/
{{ config(materialized='table') }}
with source_data as (
select 1 as id
union all
select null as id
)
select *
from source_data
/*
Uncomment the line below to remove records with null `id` values
*/
-- where id is not null
What do you mean by “When I go to open the provided models” do you get this error after dbt run / dbt build or it’s a syntax error in the editor ?
I just open the file editor.
Note: @stefanie.culley
originally posted this reply in Slack. It might not have transferred perfectly.
Literally click the my first model file provided in the example folder
Note: @stefanie.culley
originally posted this reply in Slack. It might not have transferred perfectly.
As soon as it opens it gives the syntax erro
Note: @stefanie.culley
originally posted this reply in Slack. It might not have transferred perfectly.
So in the editor
Note: @stefanie.culley
originally posted this reply in Slack. It might not have transferred perfectly.
Playing with it more, I’ve done dbt deps, that works, did a dbt clean and dbt compile. When I compile or run I get this message:
01:41:56 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources.
There are 1 unused configuration paths:
- models.idi_datavault.automatedv.example
This is my file path C:\source\Python\idi_datavault\automatedv\models\example
This is my project yml
Name your project! Project names should contain only lowercase characters
and underscores. A good package name should reflect your organization’s
name or the intended use of these models
name: ‘automatedv’
version: ‘1.0.0’
This setting configures which “profile” dbt uses for this project.
profile: ‘automatedv’
These configurations specify where dbt should look for different types of files.
The model-paths
config, for example, states that models in this project can be
found in the “models/” directory. You probably won’t need to change these!
model-paths: [“models”]
analysis-paths: [“analyses”]
test-paths: [“tests”]
seed-paths: [“seeds”]
macro-paths: [“macros”]
snapshot-paths: [“snapshots”]
clean-targets: # directories to be removed by dbt clean
Configuring models
In this example config, we tell dbt to build all models in the example/
directory as views. These settings can be overridden in the individual model
files using the {{ config(...) }}
macro.
models:
idi_datavault:
automatedv:
example:
+enabled: true
+materialized: table