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
Fix CTE handling in dependency planner and CAST type in test queries
- Add CTE check in dependencyplanner.go to skip provider resolution for CTE table references (similar to existing view/subquery handling)- Change CAST type from 'INTEGER' to 'unsigned' in test queries to match StackQL parser requirements
Copy file name to clipboardExpand all lines: internal/test/testobjects/input.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,12 @@ const (
59
59
// Window function test queries.
60
60
SelectGoogleComputeDisksWindowRowNumberstring=`select name, sizeGb, ROW_NUMBER() OVER (ORDER BY name) as row_num from google.compute.disks where zone = 'australia-southeast1-b' AND project = 'testing-project' ORDER BY name;`
61
61
SelectGoogleComputeDisksWindowRankstring=`select name, sizeGb, RANK() OVER (ORDER BY sizeGb) as size_rank from google.compute.disks where zone = 'australia-southeast1-b' AND project = 'testing-project' ORDER BY name;`
62
-
SelectGoogleComputeDisksWindowSumstring=`select name, sizeGb, SUM(cast(sizeGb asINTEGER)) OVER (ORDER BY name) as running_total from google.compute.disks where zone = 'australia-southeast1-b' AND project = 'testing-project' ORDER BY name;`
62
+
SelectGoogleComputeDisksWindowSumstring=`select name, sizeGb, SUM(cast(sizeGb asunsigned)) OVER (ORDER BY name) as running_total from google.compute.disks where zone = 'australia-southeast1-b' AND project = 'testing-project' ORDER BY name;`
63
63
64
64
// CTE test queries.
65
65
SelectGoogleComputeDisksCTESimplestring=`WITH disk_cte AS (SELECT name, sizeGb FROM google.compute.disks WHERE zone = 'australia-southeast1-b' AND project = 'testing-project') SELECT name, sizeGb FROM disk_cte ORDER BY name;`
66
66
SelectGoogleComputeDisksCTEWithAggstring=`WITH disk_cte AS (SELECT name, sizeGb FROM google.compute.disks WHERE zone = 'australia-southeast1-b' AND project = 'testing-project') SELECT COUNT(*) as disk_count FROM disk_cte;`
67
-
SelectGoogleComputeDisksCTEMultiplestring=`WITH small_disks AS (SELECT name, sizeGb FROM google.compute.disks WHERE zone = 'australia-southeast1-b' AND project = 'testing-project' AND cast(sizeGb asINTEGER) <= 10), large_disks AS (SELECT name, sizeGb FROM google.compute.disks WHERE zone = 'australia-southeast1-b' AND project = 'testing-project' AND cast(sizeGb asINTEGER) > 10) SELECT 'small' as category, COUNT(*) as cnt FROM small_disks UNION ALL SELECT 'large' as category, COUNT(*) as cnt FROM large_disks;`
67
+
SelectGoogleComputeDisksCTEMultiplestring=`WITH small_disks AS (SELECT name, sizeGb FROM google.compute.disks WHERE zone = 'australia-southeast1-b' AND project = 'testing-project' AND cast(sizeGb asunsigned) <= 10), large_disks AS (SELECT name, sizeGb FROM google.compute.disks WHERE zone = 'australia-southeast1-b' AND project = 'testing-project' AND cast(sizeGb asunsigned) > 10) SELECT 'small' as category, COUNT(*) as cnt FROM small_disks UNION ALL SELECT 'large' as category, COUNT(*) as cnt FROM large_disks;`