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

deduplicate bug in Spark in case of a null column. #814

Closed
1 of 5 tasks
clintf1982 opened this issue Jul 20, 2023 · 4 comments · May be fixed by #815
Closed
1 of 5 tasks

deduplicate bug in Spark in case of a null column. #814

clintf1982 opened this issue Jul 20, 2023 · 4 comments · May be fixed by #815
Labels
bug Something isn't working Stale triage

Comments

@clintf1982
Copy link

clintf1982 commented Jul 20, 2023

Describe the bug

Same bug as #713 however for Spark
When there is a null column(Unrelated to the partition by or order by columns), Spark doesn't return the expected rows in the deduplicate default function.

Steps to reproduce

*** This is python code where the deduplication code was copied to in order to reproduce the bug.

  sql = """
  with relation as (
  select * from ( values (1, 3, null), (1, 2, null), (1, 1, null)) 
  ), row_numbered as (
      select
          _inner.*,
          row_number() over (
              partition by col1
              order by col2
          ) as rn
      from relation as _inner
  )

  select
      distinct data.*
  from relation as data
  natural join row_numbered
  where row_numbered.rn = 1
  """
  df = session.sql(sql)
  df.show()

Expected results

+----+----+----+
|col1|col2|col3|
+----+----+----+
| 1| 1| null |
+----+----+----+

Actual results

+----+----+----+
|col1|col2|col3|
+----+----+----+
+----+----+----+

Screenshots and log output

System information

The contents of your packages.yml file:

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: Spark)

The output of dbt --version:

Core:
  - installed: 1.6.0-b8
  - latest:    1.5.3    - Ahead of latest version!

Plugins:

Additional context

Are you interested in contributing the fix?

Copy link

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 17, 2024
Copy link

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2024
@dbeatty10 dbeatty10 removed the Stale label Apr 18, 2024
@dbeatty10 dbeatty10 reopened this Apr 18, 2024
Copy link

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 16, 2024
Copy link

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants