Search in sources :

Example 6 with WarningCode

use of com.facebook.presto.spi.WarningCode in project presto by prestodb.

the class TestDefaultWarningCollector method testWarningSuppress.

@Test
public void testWarningSuppress() {
    WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig(), WarningHandlingLevel.SUPPRESS);
    warningCollector.add(new PrestoWarning(new WarningCode(1, "1"), "warning 1"));
    assertEquals(warningCollector.getWarnings().size(), 0);
}
Also used : PrestoWarning(com.facebook.presto.spi.PrestoWarning) WarningCollector(com.facebook.presto.spi.WarningCollector) StandardWarningCode(com.facebook.presto.spi.StandardWarningCode) WarningCode(com.facebook.presto.spi.WarningCode) Test(org.testng.annotations.Test)

Example 7 with WarningCode

use of com.facebook.presto.spi.WarningCode in project presto by prestodb.

the class TestDefaultWarningCollector method testMaxWarnings.

@Test
public void testMaxWarnings() {
    WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig().setMaxWarnings(2), WarningHandlingLevel.NORMAL);
    warningCollector.add(new PrestoWarning(new WarningCode(1, "1"), "warning 1"));
    warningCollector.add(new PrestoWarning(new WarningCode(2, "2"), "warning 2"));
    warningCollector.add(new PrestoWarning(new WarningCode(3, "3"), "warning 3"));
    assertEquals(warningCollector.getWarnings().size(), 2);
}
Also used : PrestoWarning(com.facebook.presto.spi.PrestoWarning) WarningCollector(com.facebook.presto.spi.WarningCollector) StandardWarningCode(com.facebook.presto.spi.StandardWarningCode) WarningCode(com.facebook.presto.spi.WarningCode) Test(org.testng.annotations.Test)

Example 8 with WarningCode

use of com.facebook.presto.spi.WarningCode in project presto by prestodb.

the class TestDefaultWarningCollector method testNoWarnings.

@Test
public void testNoWarnings() {
    WarningCollector warningCollector = new DefaultWarningCollector(new WarningCollectorConfig().setMaxWarnings(0), WarningHandlingLevel.NORMAL);
    warningCollector.add(new PrestoWarning(new WarningCode(1, "1"), "warning 1"));
    assertEquals(warningCollector.getWarnings().size(), 0);
}
Also used : PrestoWarning(com.facebook.presto.spi.PrestoWarning) WarningCollector(com.facebook.presto.spi.WarningCollector) StandardWarningCode(com.facebook.presto.spi.StandardWarningCode) WarningCode(com.facebook.presto.spi.WarningCode) Test(org.testng.annotations.Test)

Aggregations

WarningCode (com.facebook.presto.spi.WarningCode)8 PrestoWarning (com.facebook.presto.spi.PrestoWarning)6 WarningCollector (com.facebook.presto.spi.WarningCollector)6 Test (org.testng.annotations.Test)6 StandardWarningCode (com.facebook.presto.spi.StandardWarningCode)4 Session (com.facebook.presto.Session)2 DefaultWarningCollector (com.facebook.presto.execution.warnings.DefaultWarningCollector)2 WarningCollectorConfig (com.facebook.presto.execution.warnings.WarningCollectorConfig)2 SemanticException (com.facebook.presto.sql.analyzer.SemanticException)2 TestingSession.testSessionBuilder (com.facebook.presto.testing.TestingSession.testSessionBuilder)2 ImmutableList (com.google.common.collect.ImmutableList)2 SessionBuilder (com.facebook.presto.Session.SessionBuilder)1 WarningHandlingLevel (com.facebook.presto.execution.warnings.WarningHandlingLevel)1 Captures (com.facebook.presto.matching.Captures)1 Pattern (com.facebook.presto.matching.Pattern)1 ProjectNode (com.facebook.presto.spi.plan.ProjectNode)1 LOCAL (com.facebook.presto.spi.plan.ProjectNode.Locality.LOCAL)1 UNKNOWN (com.facebook.presto.spi.plan.ProjectNode.Locality.UNKNOWN)1 LogicalPlanner (com.facebook.presto.sql.planner.LogicalPlanner)1 Plan (com.facebook.presto.sql.planner.Plan)1