Skip to content

Introduce HashMap and HashSet type aliases - #13236

Merged
Dandandan merged 6 commits into
apache:mainfrom
drauschenbach:hashmap-type-alias
Nov 5, 2024
Merged

Introduce HashMap and HashSet type aliases#13236
Dandandan merged 6 commits into
apache:mainfrom
drauschenbach:hashmap-type-alias

Conversation

@drauschenbach

@drauschenbachdrauschenbach commented Nov 3, 2024

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes#677.

Rationale for this change

Centralize the recommended default implementation of HashMap and HashSet.

What changes are included in this PR?

  • All references to hashbrown::HashMap are now unified under the datafusion_common::HashMap type alias.
  • All references to hashbrown::HashSet are now unified under the datafusion_common::HashSet type alias.
  • Some additional references to std::collections::HashMap and std::collections::HashSet are replaced with the type alias, where public contracts were not involved, and where tests did not break.

Are these changes tested?

Yes, on an Apple M1.

$ cargo test
...
All modules: test result: ok.

Are there any user-facing changes?

Hopefully not. All tests and public contracts are left untouched, where std::collections:: types are the idiomatic platform default.

@drauschenbach
drauschenbach marked this pull request as draft November 3, 2024 17:12
@github-actionsgithub-actionsBot added logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate common Related to common crate execution Related to the execution crate functions Changes to functions implementation labels Nov 3, 2024
@github-actionsgithub-actionsBot added the sql SQL Planner label Nov 3, 2024
collections::{HashMap, HashSet},
sync::Arc,
};
use std::{collections::HashSet, sync::Arc};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe you could do the same to HashSet?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done.

@drauschenbachdrauschenbach changed the title Hashmap type aliasHashMap type aliasNov 3, 2024
@drauschenbachdrauschenbach changed the title HashMap type aliasIntroduce a HashMap type aliasNov 3, 2024
@drauschenbachdrauschenbach changed the title Introduce a HashMap type aliasIntroduce HashMap and HashSet type aliasesNov 3, 2024
@drauschenbach
drauschenbach marked this pull request as ready for review November 3, 2024 23:48
@Dandandan
Dandandan merged commit 2e52580 into apache:mainNov 5, 2024
@Dandandan

Copy link
Copy Markdown
Contributor

Thank you @drauschenbach

@drauschenbach
drauschenbach deleted the hashmap-type-alias branch November 5, 2024 14:10
findepi pushed a commit to sdf-labs/datafusion that referenced this pull request Nov 25, 2024
* Unite all references to hashbrown::HashMap by using a common type definition
* Replace some use of std::collections::HashMap with hashbrown::HashMap
* Replace some use of std::collections::HashMap with hashbrown::HashMap
* Replace some use of std::collections::HashMap with hashbrown::HashMap
* Unite all references to hashbrown::HashSet by using a common type definition
* Replace some use of std::collections::HashSet with hashbrown::HashSet
findepi pushed a commit to sdf-labs/datafusion that referenced this pull request Nov 26, 2024
* Unite all references to hashbrown::HashMap by using a common type definition
* Replace some use of std::collections::HashMap with hashbrown::HashMap
* Replace some use of std::collections::HashMap with hashbrown::HashMap
* Replace some use of std::collections::HashMap with hashbrown::HashMap
* Unite all references to hashbrown::HashSet by using a common type definition
* Replace some use of std::collections::HashSet with hashbrown::HashSet
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commonRelated to common cratecoreCore DataFusion crateexecutionRelated to the execution cratefunctionsChanges to functions implementationlogical-exprLogical plan and expressionsoptimizerOptimizer rulesphysical-exprChanges to the physical-expr cratessqlSQL PlannersubstraitChanges to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a single HashMap implementation consistently across the code base

3 participants

@drauschenbach@Dandandan@andygrove