Skip to content

Commit

Permalink
ensure filesystem safe column names
Browse files Browse the repository at this point in the history
  • Loading branch information
cswinter committed Mar 10, 2024
1 parent 6641baa commit 37dae96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scheduler/inner_locustdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ fn subpartition(
acc.subpartition_metadata[0].subpartition_key = "all".to_string();
} else {
for meta in &mut acc.subpartition_metadata {
let subpartition_key = if meta.column_names.len() == 1 {
let is_column_name_filesystem_safe = meta.column_names[0].len() <= 64
&& meta.column_names[0]
.chars()
.all(|c| (c.is_alphanumeric() && c.is_lowercase()) || c == '_');
let subpartition_key = if meta.column_names.len() == 1 && is_column_name_filesystem_safe {
format!("x{}", meta.column_names[0])
} else {
use sha2::{Digest, Sha256};
Expand Down

0 comments on commit 37dae96

Please sign in to comment.