Skip to content

Commit

Permalink
feat: add convert_to_delta
Browse files Browse the repository at this point in the history
Add a convert_to_delta operation for converting a Parquet table to a Delta
Table in place.
  • Loading branch information
junjunjd committed Nov 11, 2023
1 parent d833f08 commit 7f3c1d0
Show file tree
Hide file tree
Showing 5 changed files with 878 additions and 1 deletion.
30 changes: 30 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,34 @@ 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 PartialEq for StructField {
fn eq(&self, other: &Self) -> bool {
self.path == other.path
&& self.deletion_timestamp == other.deletion_timestamp
&& self.data_change == other.data_change
&& self.extended_file_metadata == other.extended_file_metadata
&& self.partition_values == other.partition_values
&& self.size == other.size
&& self.tags == other.tags
&& self.deletion_vector == other.deletion_vector
}
} */

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 7f3c1d0

Please sign in to comment.