chore: e2e test for unsigned types

pull/24376/head
Nga Tran 2021-03-22 15:50:42 -04:00
parent a19c1cd3d6
commit 6a2e5d69f1
3 changed files with 68 additions and 0 deletions

View File

@ -84,6 +84,22 @@ impl DBSetup for TwoMeasurements {
}
}
pub struct TwoMeasurementsUnsignedType {}
#[async_trait]
impl DBSetup for TwoMeasurementsUnsignedType {
async fn make(&self) -> Vec<DBScenario> {
let partition_key = "1970-01-01T00";
let lp_lines = vec![
"restaurant,town=andover count=40000u 100",
"restaurant,town=reading count=632u 120",
"school,town=reading count=17u 150",
"school,town=andover count=25u 160",
];
make_one_chunk_scenarios(partition_key, &lp_lines.join("\n")).await
}
}
/// Single measurement that has several different chunks with
/// different (but compatible) schema
pub struct MultiChunkSchemaMerge {}

View File

@ -143,6 +143,40 @@ async fn sql_select_with_schema_merge() {
run_sql_test_case!(MultiChunkSchemaMerge {}, "SELECT * from cpu", &expected);
}
#[tokio::test]
async fn sql_select_from_restaurant() {
let expected = vec![
"+---------+-------+",
"| town | count |",
"+---------+-------+",
"| andover | 40000 |",
"| reading | 632 |",
"+---------+-------+",
];
run_sql_test_case!(
TwoMeasurementsUnsignedType {},
"SELECT town, count from restaurant",
&expected
);
}
#[tokio::test]
async fn sql_select_from_school() {
let expected = vec![
"+---------+-------+",
"| town | count |",
"+---------+-------+",
"| reading | 17 |",
"| andover | 25 |",
"+---------+-------+",
];
run_sql_test_case!(
TwoMeasurementsUnsignedType {},
"SELECT town, count from school",
&expected
);
}
#[tokio::test]
async fn sql_select_with_schema_merge_subset() {
let expected = vec![

View File

@ -113,3 +113,21 @@ async fn list_schema_disk_selection() {
run_table_schema_test_case!(TwoMeasurements {}, selection, "disk", expected_schema);
}
#[tokio::test]
async fn list_schema_location_all() {
// we expect columns to come out in lexographic order by name
let expected_schema = SchemaBuilder::new()
.field("count", DataType::UInt64)
.timestamp()
.tag("town")
.build()
.unwrap();
run_table_schema_test_case!(
TwoMeasurementsUnsignedType {},
Selection::All,
"restaurant",
expected_schema
);
}