containsSystemSchema reports whether a query references a Trino system/metadata schema, via a case-insensitive substring scan. This mirrors the legacy plugin's heuristic (and omni analysis.Classify's refineSelect) so the SELECT → SelectInfoSchema promotion is identical across the legacy and omni sta
(sql string)
| 112 | // plugin's heuristic (and omni analysis.Classify's refineSelect) so the SELECT → |
| 113 | // SelectInfoSchema promotion is identical across the legacy and omni stacks. |
| 114 | func containsSystemSchema(sql string) bool { |
| 115 | lowerSQL := strings.ToLower(sql) |
| 116 | systemPrefixes := []string{ |
| 117 | "system.", |
| 118 | "information_schema.", |
| 119 | "$system.", |
| 120 | "catalog.", |
| 121 | "metadata.", |
| 122 | } |
| 123 | for _, prefix := range systemPrefixes { |
| 124 | if strings.Contains(lowerSQL, prefix) { |
| 125 | return true |
| 126 | } |
| 127 | } |
| 128 | return false |
| 129 | } |
no outgoing calls