def get_output_types(query):
    """Get the output event types for a query."""
    from .walkers import RecursiveWalker
    from .ast import EqlAnalytic, PipedQuery
    if isinstance(query, EqlAnalytic):
        query = query.query
    elif not isinstance(query, PipedQuery):
        raise TypeError('unsupported type {} to get_output_types. Expected {}'
            .format(type(query), PipedQuery))
    walker = RecursiveWalker()
    walker.walk(query)
    return walker.output_event_types
