Skip to content

Commit

Permalink
feat: add convert_to_delta (delta-io#1686)
Browse files Browse the repository at this point in the history
# Description
Add a convert_to_delta operation for converting a Parquet table to a
Delta Table in place.

# Related Issue(s)
- closes delta-io#1041
- closes delta-io#1682
<!---
For example:

- closes delta-io#106
--->

# Documentation

<!---
Share links to useful documentation
--->
  • Loading branch information
junjunjd authored Nov 12, 2023
1 parent d833f08 commit 1368a78
Show file tree
Hide file tree
Showing 5 changed files with 864 additions and 1 deletion.
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 1368a78

Please sign in to comment.