Skip to content

Commit f427934

Browse files
committed
Fix:A bunch of tiny improvements here and there
1 parent f1b8b2c commit f427934

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/pgwire_integration.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,16 @@ impl DfSessionService {
129129
Field::new("event_name", DataType::Utf8, true),
130130
]));
131131
let table = Arc::new(MemTable::try_new(schema, vec![]).unwrap());
132-
session_context.register_table("table_events", table).unwrap();
132+
match session_context.register_table("table_events", table) {
133+
Ok(_) => {},
134+
Err(e) => {
135+
if e.to_string().contains("already exists") {
136+
debug!("Table 'table_events' already exists, ignoring registration error: {}", e);
137+
} else {
138+
panic!("Error registering table_events: {:?}", e);
139+
}
140+
}
141+
}
133142

134143
Self {
135144
session_context,
@@ -528,4 +537,4 @@ where
528537
}
529538
}
530539
Ok(())
531-
}
540+
}

0 commit comments

Comments
 (0)