style: unmangle wrapped diagrams
Adds #[rustfmt::skip] to comment blocks containing diagrams to skip wrapping.pull/24376/head
parent
7e351ba609
commit
4c35253fd5
|
@ -362,6 +362,7 @@ pub enum ColumnData {
|
|||
Unsigned(Vec<Option<u64>>),
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
// Maps multiple columnar field blocks to a single tablular representation.
|
||||
//
|
||||
// Given a set of field keys and a set of blocks for each key,
|
||||
|
@ -371,19 +372,17 @@ pub enum ColumnData {
|
|||
//
|
||||
// For example, here we have three blocks (one block for a different field):
|
||||
//
|
||||
// ┌───────────┬───────────┐ ┌───────────┬───────────┐
|
||||
// ┌───────────┬───────────┐ │ TS │ Temp │ │ TS │
|
||||
// Voltage │ │ TS │ Current │ ├───────────┼───────────┤
|
||||
// ├───────────┼───────────┤ ├───────────┼───────────┤ │ 1 │ 10.2
|
||||
// │ │ 1 │ 1.23 │ │ 2 │ 0.332 │
|
||||
// ├───────────┼───────────┤ ├───────────┼───────────┤
|
||||
// ├───────────┼───────────┤ │ 2 │ 11.4 │ │ 2 │ 1.24
|
||||
// │ │ 3 │ 0.5 │ ├───────────┼───────────┤
|
||||
// ├───────────┼───────────┤ ├───────────┼───────────┤ │ 3 │ 10.2
|
||||
// │ │ 3 │ 1.26 │ │ 5 │ 0.6 │
|
||||
// └───────────┼───────────┘ └───────────┼───────────┘
|
||||
// └───────────┼───────────┘ │ │
|
||||
// │ │ │ │
|
||||
// ┌───────────┬───────────┐ ┌───────────┬───────────┐ ┌───────────┬───────────┐
|
||||
// │ TS │ Temp │ │ TS │ Voltage │ │ TS │ Current │
|
||||
// ├───────────┼───────────┤ ├───────────┼───────────┤ ├───────────┼───────────┤
|
||||
// │ 1 │ 10.2 │ │ 1 │ 1.23 │ │ 2 │ 0.332 │
|
||||
// ├───────────┼───────────┤ ├───────────┼───────────┤ ├───────────┼───────────┤
|
||||
// │ 2 │ 11.4 │ │ 2 │ 1.24 │ │ 3 │ 0.5 │
|
||||
// ├───────────┼───────────┤ ├───────────┼───────────┤ ├───────────┼───────────┤
|
||||
// │ 3 │ 10.2 │ │ 3 │ 1.26 │ │ 5 │ 0.6 │
|
||||
// └───────────┼───────────┘ └───────────┼───────────┘ └───────────┼───────────┘
|
||||
// │ │ │
|
||||
// │ │ │
|
||||
// └─────────────────────────────┼────────────────────────────┘
|
||||
// │
|
||||
// │
|
||||
|
|
|
@ -1783,6 +1783,7 @@ mod tests {
|
|||
//
|
||||
// cpu,az=b watts=3000 5000
|
||||
|
||||
#[rustfmt::skip]
|
||||
// Expected output table
|
||||
//
|
||||
// | az | region | server | temp | voltage | watts | time |
|
||||
|
@ -1790,14 +1791,12 @@ mod tests {
|
|||
// | b | NULL | NULL | NULL | NULL | 1000 | 3000 |
|
||||
// | b | NULL | NULL | NULL | NULL | 2000 | 4000 |
|
||||
// | b | NULL | NULL | NULL | NULL | 3000 | 5000 |
|
||||
// | NULL | east | NULL | 1.2 | 10.2 | NULL | 0000 | <-- notice
|
||||
// series joined on ts column | NULL | east | NULL | 1.2 | 10.2
|
||||
// | NULL | 1000 | <-- notice series joined on ts column
|
||||
// | NULL | east | NULL | 1.4 | 10.4 | NULL | 2000 | <-- notice
|
||||
// series joined on ts column | NULL | west | a | 100.2 | NULL
|
||||
// | NULL | 2000 | | NULL | west | a | 99.5 | NULL |
|
||||
// NULL | 3000 | | NULL | west | a | 100.3 | NULL | NULL |
|
||||
// 4000 |
|
||||
// | NULL | east | NULL | 1.2 | 10.2 | NULL | 0000 | <-- notice series joined on ts column
|
||||
// | NULL | east | NULL | 1.2 | 10.2 | NULL | 1000 | <-- notice series joined on ts column
|
||||
// | NULL | east | NULL | 1.4 | 10.4 | NULL | 2000 | <-- notice series joined on ts column
|
||||
// | NULL | west | a | 100.2 | NULL | NULL | 2000 |
|
||||
// | NULL | west | a | 99.5 | NULL | NULL | 3000 |
|
||||
// | NULL | west | a | 100.3 | NULL | NULL | 4000 |
|
||||
|
||||
let mut table = MeasurementTable::new("cpu".to_string(), 0);
|
||||
// cpu region=east temp=<all the block data for this key>
|
||||
|
|
|
@ -265,11 +265,12 @@ impl AmazonS3 {
|
|||
/// credentials in:
|
||||
///
|
||||
/// 1. Environment variables: `AWS_ACCESS_KEY_ID` and
|
||||
/// `AWS_SECRET_ACCESS_KEY` 2. `credential_process` command in the AWS
|
||||
/// config file, usually located at `~/.aws/config`. 3. AWS credentials
|
||||
/// file. Usually located at `~/.aws/credentials`. 4. IAM instance
|
||||
/// profile. Will only work if running on an EC2 instance with an instance
|
||||
/// profile/role.
|
||||
/// `AWS_SECRET_ACCESS_KEY`
|
||||
/// 2. `credential_process` command in the AWS config file, usually located
|
||||
/// at `~/.aws/config`.
|
||||
/// 3. AWS credentials file. Usually located at `~/.aws/credentials`.
|
||||
/// 4. IAM instance profile. Will only work if running on an EC2 instance
|
||||
/// with an instance profile/role.
|
||||
///
|
||||
/// [cp]: https://docs.rs/rusoto_credential/0.43.0/rusoto_credential/struct.ChainProvider.html
|
||||
pub fn new(region: rusoto_core::Region, bucket_name: impl Into<String>) -> Self {
|
||||
|
|
|
@ -155,20 +155,21 @@ fn window_bounds(
|
|||
every: &WindowDuration,
|
||||
offset: &WindowDuration,
|
||||
) -> Result<ArrayRef> {
|
||||
// Note: At the time of writing, DataFusion creates arrays of
|
||||
// constants for constant arguments (which 4 of 5 arguments to
|
||||
// window bounds are). We should eventually contribute someway
|
||||
// back upstream to make DataFusion pass 4 constants rather than 4
|
||||
// arrays of constants.
|
||||
// Note: At the time of writing, DataFusion creates arrays of constants for
|
||||
// constant arguments (which 4 of 5 arguments to window bounds are). We
|
||||
// should eventually contribute some way back upstream to make DataFusion
|
||||
// pass 4 constants rather than 4 arrays of constants.
|
||||
|
||||
// There are any number of ways this function could also be
|
||||
// further optimized, which we leave as an exercise to our future
|
||||
// selves
|
||||
// There are any number of ways this function could also be further
|
||||
// optimized, which we leave as an exercise to our future selves
|
||||
|
||||
// `args` and output are dynamically-typed Arrow arrays, which means that we
|
||||
// need to: 1. cast the values to the type we want
|
||||
// 2. perform the window_bounds calculation for every element in the timestamp
|
||||
// array 3. construct the resulting array
|
||||
// need to:
|
||||
//
|
||||
// 1. cast the values to the type we want
|
||||
// 2. perform the window_bounds calculation for every element in the
|
||||
// timestamp array
|
||||
// 3. construct the resulting array
|
||||
|
||||
// this is guaranteed by DataFusion based on the function's signature.
|
||||
assert_eq!(args.len(), 1);
|
||||
|
|
Loading…
Reference in New Issue