-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-1109] ParseException - mismatch input table #446
Comments
Hi there, sorry for the delay. I'd like to reproduce the issue but I'm not sure I understand your setup. You have a single model, based of a source, generated on the delta format. I can't make sense of that error message: I checked the macro versus what was in 1.2.
I'm a bit lost. More info may help ;) |
Closing for now. Please let me know if it needs to be revisited, I'll happily re-open. |
Hello there, {{
config(
materialized='table',
file_format='delta',
unique_key='id',
location_root='<S3_LOCATION>',
incremental_strategy='merge'
)
}}
with source as (
select
*,
row_number() over (
partition by id
order by id desc, updated_at desc
) as rn
from {{ source('<schema>', '<table>') }}
{% if is_incremental() %}
-- this filter will only be applied on an incremental run
and updated_at > (select max(updated_at) from {{ this }})
{% endif %}
)
select
*
from source
where rn = 1 which is compiled to create or replace table <schema>.<table>
using delta
location '<S3_LOCATION>'
as
with source as (
select
*,
row_number() over (
partition by id
order by id desc, updated_at desc
) as rn
from <schema>.<table>
)
select
*
from source
where rn = 1 and got the following error It seems the Spark engine expects for it to be a view, even when it does not exist yet. The profile used: dbt_sg_hub:
outputs:
dev:
host: <host_address>
method: thrift
port: 10000
schema: <schema>
threads: 4
type: spark
user: hadoop
target: dev Environment
|
As it seems the EMR will, sometimes, not alert if the Thrift server fails to start. |
Describe the bug
A clear and concise description of what the bug is. What command did you run? What happened?
I am running dbt-spark 1.2.0 and submitting to an AWS EMR Spark Cluster using Thrift. The cluster uses Spark 3.1.2.
Ran dbt run
Error:
Error while compiling statement: FAILED: ParseException line 3:24 mismatched input 'table' expecting KW_VIEW near 'replace' in create view statement
The SQL Statement generated was:
Steps To Reproduce
In as much detail as possible, please provide steps to reproduce the issue. Sample data that triggers the issue, example model code, etc is all very helpful here.
Expected behavior
A clear and concise description of what you expected to happen.
I expected a new table to be created in a new database that is a copy of the source table
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
System information
The output of
dbt --version
:The operating system you're using:
macOS
The output of
python --version
:local computer - Python 3.9.1
EMR Spark Cluster is 3.7
Additional context
Add any other context about the problem here.
I pasted the generated SQL into spark.sql("") on the cluster and it worked fined
I added this macro I found on an older issue that solved an issue I was seeing
The text was updated successfully, but these errors were encountered: