feat: Have make_write_op take the table name as an argument to be more flexible

pull/24376/head
Carol (Nichols || Goulding) 2022-11-16 21:05:46 -05:00
parent d0218fb025
commit c7b9866483
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
3 changed files with 17 additions and 2 deletions

View File

@ -390,6 +390,7 @@ mod tests {
&PartitionKey::from("banana-split"),
SHARD_INDEX,
NAMESPACE_ID,
TABLE_NAME,
TABLE_ID,
0,
r#"test_table,city=Medford day="sun",temp=55 22"#,
@ -436,6 +437,7 @@ mod tests {
&PartitionKey::from("1970-01-01"),
SHARD_INDEX,
namespace.id,
TABLE_NAME,
TABLE_ID,
1,
"test_table foo=1 10",
@ -444,6 +446,7 @@ mod tests {
&PartitionKey::from("1970-01-01"),
SHARD_INDEX,
namespace.id,
TABLE_NAME,
TABLE_ID,
2,
"test_table foo=1 10",

View File

@ -197,6 +197,7 @@ mod tests {
&PartitionKey::from("banana-split"),
SHARD_INDEX,
NAMESPACE_ID,
TABLE_NAME,
TABLE_ID,
0,
r#"test_table,city=Medford day="sun",temp=55 22"#,

View File

@ -542,6 +542,7 @@ pub(crate) fn make_partitions(
&PartitionKey::from(TEST_PARTITION_2),
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Medford day="sun",temp=55 22"#,
@ -552,6 +553,7 @@ pub(crate) fn make_partitions(
&PartitionKey::from(TEST_PARTITION_2),
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Reading day="mon",temp=58 40"#,
@ -562,6 +564,7 @@ pub(crate) fn make_partitions(
&PartitionKey::from(TEST_PARTITION_1),
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Medford day="sun",temp=55 22"#,
@ -572,6 +575,7 @@ pub(crate) fn make_partitions(
&PartitionKey::from(TEST_PARTITION_1),
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Reading day="mon",temp=58 40"#,
@ -585,15 +589,16 @@ pub(crate) fn make_write_op(
partition_key: &PartitionKey,
shard_index: ShardIndex,
namespace_id: NamespaceId,
table_name: &str,
table_id: TableId,
sequence_number: i64,
lines: &str,
) -> DmlWrite {
let tables = lines_to_batches(lines, 0).unwrap();
assert_eq!(tables.len(), 1);
assert!(tables.get(TEST_TABLE).is_some());
assert!(tables.get(table_name).is_some());
let ids = [(TEST_TABLE.into(), table_id)].into_iter().collect();
let ids = [(table_name.into(), table_id)].into_iter().collect();
DmlWrite::new(
namespace_id,
tables,
@ -644,6 +649,7 @@ fn make_first_partition_data(
partition_key,
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Boston day="sun",temp=60 36"#,
@ -654,6 +660,7 @@ fn make_first_partition_data(
partition_key,
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Andover day="tue",temp=56 30"#,
@ -666,6 +673,7 @@ fn make_first_partition_data(
partition_key,
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Andover day="mon" 46"#,
@ -676,6 +684,7 @@ fn make_first_partition_data(
partition_key,
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Medford day="wed" 26"#,
@ -689,6 +698,7 @@ fn make_first_partition_data(
partition_key,
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Boston day="mon" 38"#,
@ -699,6 +709,7 @@ fn make_first_partition_data(
partition_key,
shard_index,
ns_id,
TEST_TABLE,
table_id,
seq_num,
r#"test_table,city=Wilmington day="mon" 35"#,