public Analysis analyze(Statement statement)
    {
        return analyze(statement, false);
    }
@Test
    public void testWindowOrderByAnalysis()
    {
        assertHasWarning(analyzeWithWarnings("SELECT SUM(x) OVER (PARTITION BY y ORDER BY 1) AS s\n" +
                "FROM (values (1,10), (2, 10)) AS T(x, y)"), PERFORMANCE_WARNING, "ORDER BY literals/constants with window function:");

        assertHasWarning(analyzeWithWarnings("SELECT SUM(x) OVER (ORDER BY 1) AS s\n" +
                "FROM (values (1,10), (2, 10)) AS T(x, y)"), PERFORMANCE_WARNING, "ORDER BY literals/constants with window function:");

        // Now test for error when the session param is set to disallow this.
        Session session = testSessionBuilder(new SessionPropertyManager(new SystemSessionProperties(
                new QueryManagerConfig(),
                new TaskManagerConfig(),
                new MemoryManagerConfig(),
                new FeaturesConfig().setAllowWindowOrderByLiterals(false),
                new NodeMemoryConfig(),
                new WarningCollectorConfig(),
                new NodeSchedulerConfig(),
                new NodeSpillConfig(),
                new TracingConfig(),
                new CompilerConfig(),
                new HistoryBasedOptimizationConfig()))).build();
        assertFails(session, WINDOW_FUNCTION_ORDERBY_LITERAL,
                "SELECT SUM(x) OVER (PARTITION BY y ORDER BY 1) AS s\n" +
                        "FROM (values (1,10), (2, 10)) AS T(x, y)");
        assertFails(session, WINDOW_FUNCTION_ORDERBY_LITERAL,
                "SELECT SUM(x) OVER (ORDER BY 1) AS s\n" +
                        "FROM (values (1,10), (2, 10)) AS T(x, y)");

        analyze(session, "SELECT SUM(x) OVER (PARTITION BY y ORDER BY y) AS s\n" +
                "FROM (values (1,10), (2, 10)) AS T(x, y)");
    }