Skip to content
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

set tmp relation with proper schema #445

Merged
merged 2 commits into from
Aug 31, 2022

Conversation

ChenyuLInx
Copy link
Contributor

resolves #441

Description

Creating tmp relation with correct schema and database for both python and sql model upfront. Remove logic to handle relation in merge sql macros.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have run changie new to create a changelog entry

@ChenyuLInx ChenyuLInx requested a review from jtcohen6 August 30, 2022 20:40
@cla-bot cla-bot bot added the cla:yes label Aug 30, 2022
@github-actions
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-spark contributing guide.

@ChenyuLInx
Copy link
Contributor Author

This fixed the failed python model tests, and didn't fail any existing incremental model tests. Looked at the failed tests in the commit before adding change log and seems like it is failing the un-deterministic ones.

@ueshin
Copy link
Contributor

ueshin commented Aug 30, 2022

I like this change! dbt-databricks will be able to remove and share those macros conflicted with catalog support and python models.

@ChenyuLInx
Copy link
Contributor Author

@ueshin seems like there's one test failing regarding docs and delta format, tests/integration/persist_docs/test_persist_docs.py::TestPersistDocsDelta::test_delta_comments_databricks_cluster
. Are you familiar with it?

Here's the related log

DEBUG    configured_file:functions.py:231 22:15:00.930099 [debug] [Thread-25 ]: Spark adapter: Error while running:
/* {"app": "dbt", "dbt_version": "1.3.0b2", "profile_name": "test", "target_name": "cluster", "node_id": "model.test.incremental_delta_model"} */

    
        alter table test16618973907877385042_persist_docs_columns.incremental_delta_model change column
            name
            comment 'Some stuff here and then a call to
name Column description "with double quotes"
and with \'single  quotes\' as welll as other;
\'\'\'abc123\'\'\'
reserved -- characters
--
/* comment */
Some $lbl$ labeled $lbl$ and $$ unlabeled $$ dollar-quoting';

ERROR    configured_file:functions.py:237 22:15:18.519602 [error] [MainThread]:   ('42000', '[42000] [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query: org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: at least one column must be specified for the table\n\tat org.apache.spark.sql.hive.thriftserver.Hiv (80) (SQLExecDirectW)')

@ueshin
Copy link
Contributor

ueshin commented Aug 30, 2022

That seems similar to databricks/dbt-databricks#144. cc @allisonwang-db

@ChenyuLInx
Copy link
Contributor Author

@ueshin so it is un-deterministic? Just rerun the test so we will see

@ChenyuLInx
Copy link
Contributor Author

That failed test looks like a undeterministic one to me!

@ChenyuLInx ChenyuLInx merged commit ebd011e into main Aug 31, 2022
@ChenyuLInx ChenyuLInx deleted the fix/proper_tmp_relation_for_incremental branch August 31, 2022 14:21
ueshin added a commit to databricks/dbt-databricks that referenced this pull request Sep 21, 2022
### Description

Removes duplicated macros that became unnecessary after the `dbt-spark` change at dbt-labs/dbt-spark#445.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-1085] Integration tests fail due to schema for python models temp table is not correctly generated
3 participants