Refactor and add test for api1 binary query
This commit is contained in:
@@ -30,7 +30,6 @@ tracing-futures = { version = "0.2.5", features = ["futures-01", "futures-03", "
|
||||
fs2 = "0.4.3"
|
||||
libc = "0.2.93"
|
||||
hex = "0.4.3"
|
||||
nom = "6.1.2"
|
||||
num-traits = "0.2.14"
|
||||
num-derive = "0.3"
|
||||
url = "2.2.2"
|
||||
|
||||
@@ -47,7 +47,7 @@ async fn agg_x_dim_0_inner() {
|
||||
array: false,
|
||||
shape: Shape::Scalar,
|
||||
scalar_type: ScalarType::F64,
|
||||
byte_order: ByteOrder::big_endian(),
|
||||
byte_order: ByteOrder::Big,
|
||||
compression: true,
|
||||
},
|
||||
timebin: 18723,
|
||||
@@ -102,7 +102,7 @@ async fn agg_x_dim_1_inner() {
|
||||
array: true,
|
||||
shape: Shape::Wave(1024),
|
||||
scalar_type: ScalarType::F64,
|
||||
byte_order: ByteOrder::big_endian(),
|
||||
byte_order: ByteOrder::Big,
|
||||
compression: true,
|
||||
},
|
||||
timebin: 0,
|
||||
|
||||
@@ -185,11 +185,11 @@ where
|
||||
macro_rules! match_end {
|
||||
($nty:ident, $end:expr, $scalar_type:expr, $shape:expr, $agg_kind:expr, $query:expr, $node_config:expr) => {
|
||||
match $end {
|
||||
ByteOrder::LE => {
|
||||
ByteOrder::Little => {
|
||||
make_num_pipeline_nty_end::<$nty, LittleEndian>($scalar_type, $shape, $agg_kind, $query, $node_config)
|
||||
.await
|
||||
}
|
||||
ByteOrder::BE => {
|
||||
ByteOrder::Big => {
|
||||
make_num_pipeline_nty_end::<$nty, BigEndian>($scalar_type, $shape, $agg_kind, $query, $node_config)
|
||||
.await
|
||||
}
|
||||
@@ -244,7 +244,7 @@ pub async fn pre_binned_bytes_for_http(
|
||||
let ret = make_num_pipeline(
|
||||
query.scalar_type().clone(),
|
||||
// TODO actually, make_num_pipeline should not depend on endianness.
|
||||
ByteOrder::LE,
|
||||
ByteOrder::Little,
|
||||
query.shape().clone(),
|
||||
query.agg_kind().clone(),
|
||||
query.clone(),
|
||||
|
||||
@@ -152,8 +152,10 @@ where
|
||||
macro_rules! match_end {
|
||||
($f:expr, $nty:ident, $end:expr, $scalar_type:expr, $shape:expr, $agg_kind:expr, $node_config:expr) => {
|
||||
match $end {
|
||||
ByteOrder::LE => channel_exec_nty_end::<_, $nty, _>($f, LittleEndian {}, $scalar_type, $shape, $agg_kind),
|
||||
ByteOrder::BE => channel_exec_nty_end::<_, $nty, _>($f, BigEndian {}, $scalar_type, $shape, $agg_kind),
|
||||
ByteOrder::Little => {
|
||||
channel_exec_nty_end::<_, $nty, _>($f, LittleEndian {}, $scalar_type, $shape, $agg_kind)
|
||||
}
|
||||
ByteOrder::Big => channel_exec_nty_end::<_, $nty, _>($f, BigEndian {}, $scalar_type, $shape, $agg_kind),
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -201,7 +203,7 @@ where
|
||||
f,
|
||||
scalar_type,
|
||||
// TODO TODO TODO is the byte order ever important here?
|
||||
ByteOrder::LE,
|
||||
ByteOrder::Little,
|
||||
shape,
|
||||
agg_kind,
|
||||
node_config,
|
||||
|
||||
@@ -823,7 +823,7 @@ mod test {
|
||||
keyspace: 2,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: netpod::ScalarType::I32,
|
||||
byte_order: netpod::ByteOrder::big_endian(),
|
||||
byte_order: netpod::ByteOrder::Big,
|
||||
shape: netpod::Shape::Scalar,
|
||||
array: false,
|
||||
compression: false,
|
||||
|
||||
@@ -264,7 +264,7 @@ mod test {
|
||||
keyspace: 2,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: netpod::ScalarType::I32,
|
||||
byte_order: netpod::ByteOrder::big_endian(),
|
||||
byte_order: netpod::ByteOrder::Big,
|
||||
shape: netpod::Shape::Scalar,
|
||||
array: false,
|
||||
compression: false,
|
||||
|
||||
@@ -29,7 +29,7 @@ pub async fn gen_test_data() -> Result<(), Error> {
|
||||
keyspace: 2,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: ScalarType::I32,
|
||||
byte_order: ByteOrder::big_endian(),
|
||||
byte_order: ByteOrder::Big,
|
||||
shape: Shape::Scalar,
|
||||
array: false,
|
||||
compression: false,
|
||||
@@ -50,7 +50,7 @@ pub async fn gen_test_data() -> Result<(), Error> {
|
||||
array: true,
|
||||
scalar_type: ScalarType::F64,
|
||||
shape: Shape::Wave(21),
|
||||
byte_order: ByteOrder::big_endian(),
|
||||
byte_order: ByteOrder::Big,
|
||||
compression: true,
|
||||
},
|
||||
gen_var: netpod::GenVar::Default,
|
||||
@@ -67,7 +67,7 @@ pub async fn gen_test_data() -> Result<(), Error> {
|
||||
keyspace: 3,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: ScalarType::U16,
|
||||
byte_order: ByteOrder::little_endian(),
|
||||
byte_order: ByteOrder::Little,
|
||||
shape: Shape::Wave(77),
|
||||
array: true,
|
||||
compression: true,
|
||||
@@ -86,7 +86,7 @@ pub async fn gen_test_data() -> Result<(), Error> {
|
||||
keyspace: 2,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: ScalarType::I32,
|
||||
byte_order: ByteOrder::little_endian(),
|
||||
byte_order: ByteOrder::Little,
|
||||
shape: Shape::Scalar,
|
||||
array: false,
|
||||
compression: false,
|
||||
@@ -105,7 +105,7 @@ pub async fn gen_test_data() -> Result<(), Error> {
|
||||
keyspace: 2,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: ScalarType::I32,
|
||||
byte_order: ByteOrder::little_endian(),
|
||||
byte_order: ByteOrder::Little,
|
||||
shape: Shape::Scalar,
|
||||
array: false,
|
||||
compression: false,
|
||||
|
||||
@@ -360,7 +360,7 @@ mod test {
|
||||
keyspace: 2,
|
||||
time_bin_size: Nanos { ns: DAY },
|
||||
scalar_type: ScalarType::I32,
|
||||
byte_order: ByteOrder::BE,
|
||||
byte_order: ByteOrder::Big,
|
||||
array: false,
|
||||
compression: false,
|
||||
shape: Shape::Scalar,
|
||||
|
||||
@@ -112,8 +112,8 @@ macro_rules! pipe3 {
|
||||
macro_rules! pipe2 {
|
||||
($nty:ident, $end:expr, $shape:expr, $agg_kind:expr, $event_blobs:expr) => {
|
||||
match $end {
|
||||
ByteOrder::LE => pipe3!($nty, LittleEndian, $shape, $agg_kind, $event_blobs),
|
||||
ByteOrder::BE => pipe3!($nty, BigEndian, $shape, $agg_kind, $event_blobs),
|
||||
ByteOrder::Little => pipe3!($nty, LittleEndian, $shape, $agg_kind, $event_blobs),
|
||||
ByteOrder::Big => pipe3!($nty, BigEndian, $shape, $agg_kind, $event_blobs),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user