You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: prevent_set_operator_mismatch.rb
    path of file: ./repos/gitlabhq/lib/gitlab/database/query_analyzers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Database
    module QueryAnalyzers

    
          def analyze(parsed)
            return unless requires_detection?(parsed.sql)

            # Only handle SELECT queries.
            parsed.pg.tree.stmts.each do |stmt|
              select_stmt = next_select_stmt(stmt)
              next unless select_stmt

              types = SelectStmt.new(select_stmt).types

              raise SetOperatorStarError if types.any?(Type::INVALID)
            end
          end