You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
- Cater for windows `real` number implementation.
- Skipping robot test `AWS Materialized View and Cast and Multiple Function Query on Resource Costs Exemplifies Cast and Multiple Functions on Materialized Views` for windows only.
- Added robot test `Contains Check AWS Materialized View and Cast and Multiple Function Query on Resource Costs Exemplifies Cast and Multiple Functions on Materialized Views`.
Copy file name to clipboardExpand all lines: test/robot/functional/stackql_mocked_from_cmd_line.robot
+28-1Lines changed: 28 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7523,6 +7523,7 @@ AWS Materialized View And Multiple Function Query on Resource Costs Exemplifies
7523
7523
7524
7524
AWS Materialized View and Cast and Multiple Function Query on Resource Costs Exemplifies Cast and Multiple Functions on Materialized Views
7525
7525
[Tags] registry tls_proxied
7526
+
Pass Execution If "${IS_WINDOWS}" == "1" Windows real casting on the input is indeterminant so will use a similarity check below.
7526
7527
${sqliteInputStr} = Catenate
7527
7528
... create or replace materialized view e1 as select json_extract(json_each.value, '$.TimePeriod.Start') as beginning, json_extract(json_each.value, '$.TimePeriod.End') as ending, json_extract(json_each.value, '$.Groups') as rez from aws.ce_native.cost_and_usage, json_each(ResultsByTime) where data__Granularity = 'MONTHLY' and data__Metrics = '["UnblendedCost"]' and data__TimePeriod = '{"Start": "2024-08-01", "End": "2024-11-30"}' and data__GroupBy = '[{"Type":"DIMENSION","Key":"SERVICE"}]' and region = 'us-east-1';
7528
7529
... select beginning, ending, json_extract(json_each.value, '$.Keys') as keyz, cast(json_extract(json_each.value, '$.Metrics.UnblendedCost.Amount') as real) as amount, json_extract(json_each.value, '$.Metrics.UnblendedCost.Unit') as unit from e1, json_each(e1.rez) order by amount, keyz, ending;
@@ -7532,7 +7533,9 @@ AWS Materialized View and Cast and Multiple Function Query on Resource Costs Exe
7532
7533
${inputStr} = Set Variable If "${SQL_BACKEND}" == "postgres_tcp" ${postgresInputStr} ${sqliteInputStr}
7533
7534
${outputStrSQLite} = Get File ${REPOSITORY_ROOT}${/}test${/}assets${/}expected${/}aws${/}ce${/}ce-cast-real.txt
7534
7535
${outputStrPostgres} = Get File ${REPOSITORY_ROOT}${/}test${/}assets${/}expected${/}aws${/}ce${/}ce-cast-real-postgres.txt
7535
-
${outputStr} = Set Variable If "${SQL_BACKEND}" == "postgres_tcp" ${outputStrPostgres} ${outputStrSQLite}
Contains Check AWS Materialized View and Cast and Multiple Function Query on Resource Costs Exemplifies Cast and Multiple Functions on Materialized Views
7554
+
[Tags] registry tls_proxied
7555
+
[Documentation] This test exists only because windows real casting is intereminant and we want to check the query is not erroeaous on windows.
7556
+
${sqliteInputStr} = Catenate
7557
+
... create or replace materialized view e1 as select json_extract(json_each.value, '$.TimePeriod.Start') as beginning, json_extract(json_each.value, '$.TimePeriod.End') as ending, json_extract(json_each.value, '$.Groups') as rez from aws.ce_native.cost_and_usage, json_each(ResultsByTime) where data__Granularity = 'MONTHLY' and data__Metrics = '["UnblendedCost"]' and data__TimePeriod = '{"Start": "2024-08-01", "End": "2024-11-30"}' and data__GroupBy = '[{"Type":"DIMENSION","Key":"SERVICE"}]' and region = 'us-east-1';
7558
+
... select beginning, ending, json_extract(json_each.value, '$.Keys') as keyz, cast(json_extract(json_each.value, '$.Metrics.UnblendedCost.Amount') as real) as amount, json_extract(json_each.value, '$.Metrics.UnblendedCost.Unit') as unit from e1, json_each(e1.rez) order by amount, keyz, ending;
7559
+
${postgresInputStr} = Catenate
7560
+
... create or replace materialized view e1 as select json_extract_path_text(rd.value, 'TimePeriod', 'Start') as beginning, json_extract_path_text(rd.value, 'TimePeriod', 'End') as ending, json_extract_path_text(rd.value, 'Groups') as rez from aws.ce_native.cost_and_usage, json_array_elements_text(ResultsByTime) as rd where data__Granularity = 'MONTHLY' and data__Metrics = '["UnblendedCost"]' and data__TimePeriod = '{"Start": "2024-08-01", "End": "2024-11-30"}' and data__GroupBy = '[{"Type":"DIMENSION","Key":"SERVICE"}]' and region = 'us-east-1';
7561
+
... select beginning, ending, json_extract_path_text(rd.value, 'Keys') as keyz, cast(json_extract_path_text(rd.value, 'Metrics', 'UnblendedCost', 'Amount') as real) as amount, json_extract_path_text(rd.value, 'Metrics', 'UnblendedCost', 'Unit') as unit from e1, json_array_elements_text(e1.rez) as rd order by amount, keyz, ending;
7562
+
${inputStr} = Set Variable If "${SQL_BACKEND}" == "postgres_tcp" ${postgresInputStr} ${sqliteInputStr}
0 commit comments