diff --git a/tests-integration/src/tests/promql_test.rs b/tests-integration/src/tests/promql_test.rs index c26670f87e7..15cd2cd0fae 100644 --- a/tests-integration/src/tests/promql_test.rs +++ b/tests-integration/src/tests/promql_test.rs @@ -1797,8 +1797,10 @@ async fn native_result_rows(output: Output) -> Vec<(i64, String, f64)> { .unwrap(); let hosts = hosts.as_any().downcast_ref::().unwrap(); let values = batch - .column_by_name("val") - .unwrap() + .columns() + .iter() + .find(|column| column.data_type() == &DataType::Float64) + .expect("native/legacy result has one Float64 value column") .as_any() .downcast_ref::() .unwrap(); @@ -1833,6 +1835,11 @@ fn assert_four_native_partitions(plan: &Arc>(); - let legacy_rows = native_result_rows(native_tql_output(&instance, sql, false).await).await; + let legacy_rows = native_result_rows( + instance + .do_promql_query(query, native_query_context(false, 4)) + .await + .remove(0) + .unwrap(), + ) + .await; assert_eq!(native_rows, expected); assert_eq!(native_rows, legacy_rows); } @@ -1964,7 +1988,7 @@ async fn native_promql_view_fallback_preserves_native_hint() { let expected_extensions = ctx.extensions(); execute_all( &instance, - "CREATE VIEW native_view AS TQL EVAL (0, 0, '1s') native_view_source", + "CREATE VIEW native_view AS TQL EVAL (0, 0, '1s', '5m') native_view_source", ctx.clone(), ) .await; @@ -1976,6 +2000,14 @@ async fn native_promql_view_fallback_preserves_native_hint() { let view_rows = native_result_rows(view).await; assert_eq!(ctx.extensions(), expected_extensions); assert_eq!(view_rows, vec![(0, "a".to_string(), 2.0)]); + let create_view = instance + .do_query("SHOW CREATE VIEW native_view", ctx.clone()) + .await + .remove(0) + .unwrap(); + let create_view_text = native_output_text(create_view).await; + assert!(create_view_text.contains("TQL EVAL")); + assert!(create_view_text.contains("5m")); let direct = instance .do_query("TQL EVAL (0, 0, '1s') native_view_source", ctx) .await