Skip to content

Commit

Permalink
check failures/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jayakasadev committed Feb 6, 2025
1 parent e394453 commit 65e01f0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/connector/src/sink/iceberg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,17 @@ impl IcebergSink {
Some(partition_field) => {
let mut partition_fields = Vec::<UnboundPartitionField>::new();
// captures column, transform(column), transform(n,column), transform(n, column)
let re = Regex::new(r"(?<transform>\w+)(\(((?<n>\d+)?(?:,|(,\s)))?(?<field>\w+)\))?").unwrap();
let re = Regex::new(
r"(?<transform>\w+)(\(((?<n>\d+)?(?:,|(,\s)))?(?<field>\w+)\))?",
)
.unwrap();
if !re.is_match(partition_field) {
bail!(format!("Invalid partition fields: {}", partition_field))
}
let caps = re.captures_iter(partition_field);
for mat in caps {
let (column, transform) = if &mat["n"] == "" && &mat["field"] == "" {
let (column, transform) = if mat["n"].is_empty() && mat["field"].is_empty()
{
(&mat["func"], Transform::Identity)
} else {
let mut func = mat["func"].to_owned();
Expand All @@ -347,7 +351,7 @@ impl IcebergSink {
.source_id(pos as i32)
.transform(transform)
.name(column.to_owned())
.build()
.build(),
);
exists = true;
break;
Expand Down

0 comments on commit 65e01f0

Please sign in to comment.