Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into datafusion-head
Browse files Browse the repository at this point in the history
  • Loading branch information
Blajda committed Nov 14, 2023
2 parents f8612e4 + 2b913b3 commit 6ee54c4
Show file tree
Hide file tree
Showing 8 changed files with 870 additions and 10 deletions.
16 changes: 16 additions & 0 deletions crates/deltalake-core/src/kernel/schema.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Delta table schema
use std::borrow::Borrow;
use std::fmt::Formatter;
use std::hash::{Hash, Hasher};
use std::sync::Arc;
use std::{collections::HashMap, fmt::Display};

Expand Down Expand Up @@ -110,6 +112,20 @@ pub struct StructField {
pub metadata: HashMap<String, MetadataValue>,
}

impl Hash for StructField {
fn hash<H: Hasher>(&self, state: &mut H) {
self.name.hash(state);
}
}

impl Borrow<str> for StructField {
fn borrow(&self) -> &str {
self.name.as_ref()
}
}

impl Eq for StructField {}

impl StructField {
/// Creates a new field
pub fn new(name: impl Into<String>, data_type: DataType, nullable: bool) -> Self {
Expand Down
Loading

0 comments on commit 6ee54c4

Please sign in to comment.