diff --git a/pkg/plugins/diff/delta_diff_server/src/diff.rs b/pkg/plugins/diff/delta_diff_server/src/diff.rs index b1d8190ceb3..cb63f927791 100644 --- a/pkg/plugins/diff/delta_diff_server/src/diff.rs +++ b/pkg/plugins/diff/delta_diff_server/src/diff.rs @@ -116,6 +116,7 @@ pub enum OperationType { Create = 0, Update = 1, Delete = 2, + Unknown = 3, } impl OperationType { /// String value of the enum field names used in the ProtoBuf definition. @@ -127,6 +128,7 @@ impl OperationType { OperationType::Create => "CREATE", OperationType::Update => "UPDATE", OperationType::Delete => "DELETE", + OperationType::Unknown => "UNKNOWN", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -135,6 +137,7 @@ impl OperationType { "CREATE" => Some(Self::Create), "UPDATE" => Some(Self::Update), "DELETE" => Some(Self::Delete), + "UNKNOWN" => Some(Self::Unknown), _ => None, } } diff --git a/pkg/plugins/diff/delta_diff_server/src/utils.rs b/pkg/plugins/diff/delta_diff_server/src/utils.rs index 819faafca40..77d029742ef 100644 --- a/pkg/plugins/diff/delta_diff_server/src/utils.rs +++ b/pkg/plugins/diff/delta_diff_server/src/utils.rs @@ -7,19 +7,17 @@ use deltalake::DeltaDataTypeVersion; use prost_types::Timestamp; use crate::delta_ops::OP_TYPES; -use crate::differ::{GatewayConfig, TableOperation}; +use crate::differ::{GatewayConfig, OperationType, TableOperation}; #[derive(Debug)] pub enum TableOperationsError { MissingKey(String), - UnknownOperation(String), } impl Display for TableOperationsError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { TableOperationsError::MissingKey(key) => write!(f, "Key '{}' is missing", key), - TableOperationsError::UnknownOperation(op) => write!(f, "Unknown operation: '{}'", op), } } } @@ -68,7 +66,7 @@ pub(crate) fn construct_table_op(commit_info: &CommitInfo, version: DeltaDataTyp .collect(); match prefix_matches.len() { - 0 => return Err(TableOperationsError::UnknownOperation(op_name.to_string())), + 0 => OperationType::Unknown as i32, 1 => prefix_matches[0].1, _ => { // Handle multiple prefix matches diff --git a/pkg/plugins/diff/service.go b/pkg/plugins/diff/service.go index 692cadede5c..6c7855db66f 100644 --- a/pkg/plugins/diff/service.go +++ b/pkg/plugins/diff/service.go @@ -30,6 +30,7 @@ const ( OpTypeCreate = "create" OpTypeUpdate = "update" OpTypeDelete = "delete" + OpTypeUnknown = "unknown" ) func getOpType(operationType OperationType) string { @@ -38,8 +39,10 @@ func getOpType(operationType OperationType) string { return OpTypeCreate case OperationType_DELETE: return OpTypeDelete - default: + case OperationType_UPDATE: return OpTypeUpdate + default: + return OpTypeUnknown } } diff --git a/pkg/plugins/diff/table_diff.pb.go b/pkg/plugins/diff/table_diff.pb.go index b29fdeceece..bbc531836ef 100644 --- a/pkg/plugins/diff/table_diff.pb.go +++ b/pkg/plugins/diff/table_diff.pb.go @@ -12,12 +12,11 @@ package tablediff import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -79,9 +78,10 @@ func (DiffType) EnumDescriptor() ([]byte, []int) { type OperationType int32 const ( - OperationType_CREATE OperationType = 0 - OperationType_UPDATE OperationType = 1 - OperationType_DELETE OperationType = 2 + OperationType_CREATE OperationType = 0 + OperationType_UPDATE OperationType = 1 + OperationType_DELETE OperationType = 2 + OperationType_UNKNOWN OperationType = 3 ) // Enum value maps for OperationType. @@ -90,11 +90,13 @@ var ( 0: "CREATE", 1: "UPDATE", 2: "DELETE", + 3: "UNKNOWN", } OperationType_value = map[string]int32{ - "CREATE": 0, - "UPDATE": 1, - "DELETE": 2, + "CREATE": 0, + "UPDATE": 1, + "DELETE": 2, + "UNKNOWN": 3, } ) @@ -677,22 +679,22 @@ var file_table_diff_proto_rawDesc = []byte{ 0x02, 0x38, 0x01, 0x2a, 0x31, 0x0a, 0x08, 0x44, 0x69, 0x66, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x52, 0x4f, - 0x50, 0x50, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x33, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x50, 0x50, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x40, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, - 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x32, 0x7d, 0x0a, 0x0b, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x09, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x44, 0x69, 0x66, 0x66, 0x12, 0x11, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x44, - 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x64, 0x69, 0x66, - 0x66, 0x2e, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, - 0x0a, 0x0b, 0x53, 0x68, 0x6f, 0x77, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x2e, - 0x64, 0x69, 0x66, 0x66, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, - 0x73, 0x65, 0x2f, 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x69, 0x66, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x32, 0x7d, 0x0a, 0x0b, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x09, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x44, 0x69, 0x66, 0x66, 0x12, 0x11, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x44, 0x69, 0x66, 0x66, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x44, + 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x53, + 0x68, 0x6f, 0x77, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x2e, 0x64, 0x69, 0x66, + 0x66, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2f, + 0x6c, 0x61, 0x6b, 0x65, 0x66, 0x73, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x69, 0x66, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/plugins/diff/table_diff.proto b/pkg/plugins/diff/table_diff.proto index 59ada26a329..a77723a712f 100644 --- a/pkg/plugins/diff/table_diff.proto +++ b/pkg/plugins/diff/table_diff.proto @@ -42,6 +42,7 @@ enum OperationType { CREATE = 0; UPDATE = 1; DELETE = 2; + UNKNOWN = 3; } message DiffResponse { diff --git a/pkg/plugins/diff/table_diff_grpc.pb.go b/pkg/plugins/diff/table_diff_grpc.pb.go index efddbe0b89c..75ab6cedc84 100644 --- a/pkg/plugins/diff/table_diff_grpc.pb.go +++ b/pkg/plugins/diff/table_diff_grpc.pb.go @@ -8,7 +8,6 @@ package tablediff import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/webui/src/styles/globals.css b/webui/src/styles/globals.css index 79d1fbe89b9..784f5f2d264 100644 --- a/webui/src/styles/globals.css +++ b/webui/src/styles/globals.css @@ -6,6 +6,7 @@ --color-bg-added: #e6ffec; --color-bg-removed: #ffece6; --color-bg-changed: #fff6db; + --color-bg-unknown: #f1f4ff; --color-bg-conflict: #fff3cd; } @@ -710,6 +711,10 @@ td.change-summary { background-color: var(--color-bg-removed); } +.otf-diff-unknown { + background-color: var(--color-bg-unknown); +} + .table.table-diff { table-layout: fixed; } @@ -880,4 +885,4 @@ td.entry-type-indicator { .upload-item-done { color: #198754; -} \ No newline at end of file +}