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

Tsql not equal workaround #3000

Merged

Conversation

dataders
Copy link
Contributor

@dataders dataders commented Jan 8, 2021

resolves #3001
@jtcohen6 @mikaelene

Description

per this conversation
microsoft/dbt-synapse#32 (comment)

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 updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot
Copy link

cla-bot bot commented Jan 8, 2021

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @swanderz

@cla-bot cla-bot bot added the cla:yes label Jan 8, 2021
@dataders dataders marked this pull request as ready for review January 8, 2021 21:17
@dataders
Copy link
Contributor Author

dataders commented Jan 8, 2021

strange redshift error.. perhaps it is transient?

=================================== FAILURES ===================================
_ IncrementalTestConcurrentTransaction.test__redshift__concurrent_transaction_incremental _
[gw3] linux -- Python 3.6.9 /home/dbt_test_user/project/.tox/integration-redshift-py36/bin/python

self = <test_concurrent_transaction.IncrementalTestConcurrentTransaction testMethod=test__redshift__concurrent_transaction_incremental>

    @use_profile("redshift")
    def test__redshift__concurrent_transaction_incremental(self):
        self.reset()
>       self.run_test()

test/integration/032_concurrent_transaction_test/test_concurrent_transaction.py:136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/integration/032_concurrent_transaction_test/test_concurrent_transaction.py:102: in run_test
    self.assertEqual(self.query_state['view_model'], 'good')
E   AssertionError: 'error: UDF working memory threshold excee[280 chars]\n\n' != 'good'
E   + good- error: UDF working memory threshold exceeded
E   - DETAIL:  
E   -   -----------------------------------------------
E   -   error:  UDF working memory threshold exceeded
E   -   code:      10002
E   -   context:   
E   -   query:     0
E   -   location:  stream.cpp:41
E   -   process:   padbmaster [pid=2255]
E   -   -----------------------------------------------
E   -

@dataders
Copy link
Contributor Author

dataders commented Jan 8, 2021

also git newb... but I made my two commits into a new branch directly after running git reset --hard upstream/dev/kiyoshi-kuromiya, so i'm confused why those 6 commits from two years ago are showing up...

Copy link
Contributor

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Ok, I'm up for sneaking this into v0.19.0, since we already have some eyes on snapshots (on account of invalidate_hard_deletes).

Copying from microsoft/dbt-synapse#32:

select

  scenario,
  (a is null) != (b is null) as previous_logic,
  ((a is null) and not (b is null)) or (not (a is null) and (b is null)) as proposed_logic

from (

  select 1 as scenario, null as a, null as b
  union all
  select 2 as scenario, 1 as a, 1 as b
  union all
  select 3 as scenario, null as a, 1 as b
  union all
  select 4 as scenario, 1 as a, null as b

) sbq
scenario previous_logic proposed_logic
1 false false
2 false false
3 true true
4 true true

This works on every database I can think to test: Postgres, Redshift, Snowflake, BigQuery, Spark, Presto.

Looks like the Redshift error was intermittent—sometimes the UDF memory is exhausted, we're not exactly sure why—so I reran the tests with success.

Tiny tiny requested changes re: changelog note + comments. As far as the extraneous git commit, I think those are hanging out on your fork's version of dev/kiyoshi-kuromiya (see diff). You could try:

  • Deleting your fork's branch and recreating from remote
  • Rebasing your branch against fishtown-analytics/dbt/dev/kiyoshi-kuromiya

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
dataders and others added 3 commits January 10, 2021 20:53
Co-authored-by: Jeremy Cohen <jtcohen6@gmail.com>
…ot/strategies.sql

Co-authored-by: Jeremy Cohen <jtcohen6@gmail.com>
Co-authored-by: Jeremy Cohen <jtcohen6@gmail.com>
@jtcohen6 jtcohen6 merged commit a4280d7 into dbt-labs:dev/kiyoshi-kuromiya Jan 11, 2021
@mikaelene
Copy link
Contributor

This is great! Will make dbt-sqlservers life much easier

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.

condA != condB not supported in TSQL
5 participants