Search in sources :

Example 26 with MaterializedResult

use of io.prestosql.testing.MaterializedResult in project hetu-core by openlookeng.

the class AbstractTestDistributedQueries method testSetSession.

@Test
public void testSetSession() {
    MaterializedResult result = computeActual("SET SESSION test_string = 'bar'");
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of("test_string", "bar"));
    result = computeActual(format("SET SESSION %s.connector_long = 999", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_long", "999"));
    result = computeActual(format("SET SESSION %s.connector_string = 'baz'", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_string", "baz"));
    result = computeActual(format("SET SESSION %s.connector_string = 'ban' || 'ana'", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_string", "banana"));
    result = computeActual(format("SET SESSION %s.connector_long = 444", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_long", "444"));
    result = computeActual(format("SET SESSION %s.connector_long = 111 + 111", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_long", "222"));
    result = computeActual(format("SET SESSION %s.connector_boolean = 111 < 3", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_boolean", "false"));
    result = computeActual(format("SET SESSION %s.connector_double = 11.1", TESTING_CATALOG));
    assertTrue((Boolean) getOnlyElement(result).getField(0));
    assertEquals(result.getSetSessionProperties(), ImmutableMap.of(TESTING_CATALOG + ".connector_double", "11.1"));
}
Also used : MaterializedResult(io.prestosql.testing.MaterializedResult) Test(org.testng.annotations.Test)

Example 27 with MaterializedResult

use of io.prestosql.testing.MaterializedResult in project hetu-core by openlookeng.

the class AbstractTestDistributedQueries method testLargeFilterExpressionWith500Between.

@Test
public void testLargeFilterExpressionWith500Between() {
    String sql = "SELECT * FROM orders WHERE (custkey BETWEEN 1 AND 5) " + " OR (custkey BETWEEN 11 AND 15) " + " OR (custkey BETWEEN 21 AND 25) " + " OR (custkey BETWEEN 31 AND 35) " + " OR (custkey BETWEEN 41 AND 45) " + " OR (custkey BETWEEN 51 AND 55) " + " OR (custkey BETWEEN 61 AND 65) " + " OR (custkey BETWEEN 71 AND 75) " + " OR (custkey BETWEEN 81 AND 85) " + " OR (custkey BETWEEN 91 AND 95) " + " OR (custkey BETWEEN 101 AND 105) " + " OR (custkey BETWEEN 111 AND 115) " + " OR (custkey BETWEEN 121 AND 125) " + " OR (custkey BETWEEN 131 AND 135) " + " OR (custkey BETWEEN 141 AND 145) " + " OR (custkey BETWEEN 151 AND 155) " + " OR (custkey BETWEEN 161 AND 165) " + " OR (custkey BETWEEN 171 AND 175) " + " OR (custkey BETWEEN 181 AND 185) " + " OR (custkey BETWEEN 191 AND 195) " + " OR (custkey BETWEEN 201 AND 205) " + " OR (custkey BETWEEN 211 AND 215) " + " OR (custkey BETWEEN 221 AND 225) " + " OR (custkey BETWEEN 231 AND 235) " + " OR (custkey BETWEEN 241 AND 245) " + " OR (custkey BETWEEN 251 AND 255) " + " OR (custkey BETWEEN 261 AND 265) " + " OR (custkey BETWEEN 271 AND 275) " + " OR (custkey BETWEEN 281 AND 285) " + " OR (custkey BETWEEN 291 AND 295) " + " OR (custkey BETWEEN 301 AND 305) " + " OR (custkey BETWEEN 311 AND 315) " + " OR (custkey BETWEEN 321 AND 325) " + " OR (custkey BETWEEN 331 AND 335) " + " OR (custkey BETWEEN 341 AND 345) " + " OR (custkey BETWEEN 351 AND 355) " + " OR (custkey BETWEEN 361 AND 365) " + " OR (custkey BETWEEN 371 AND 375) " + " OR (custkey BETWEEN 381 AND 385) " + " OR (custkey BETWEEN 391 AND 395) " + " OR (custkey BETWEEN 401 AND 405) " + " OR (custkey BETWEEN 411 AND 415) " + " OR (custkey BETWEEN 421 AND 425) " + " OR (custkey BETWEEN 431 AND 435) " + " OR (custkey BETWEEN 441 AND 445) " + " OR (custkey BETWEEN 451 AND 455) " + " OR (custkey BETWEEN 461 AND 465) " + " OR (custkey BETWEEN 471 AND 475) " + " OR (custkey BETWEEN 481 AND 485) " + " OR (custkey BETWEEN 491 AND 495) " + " OR (custkey BETWEEN 501 AND 505) " + " OR (custkey BETWEEN 511 AND 515) " + " OR (custkey BETWEEN 521 AND 525) " + " OR (custkey BETWEEN 531 AND 535) " + " OR (custkey BETWEEN 541 AND 545) " + " OR (custkey BETWEEN 551 AND 555) " + " OR (custkey BETWEEN 561 AND 565) " + " OR (custkey BETWEEN 571 AND 575) " + " OR (custkey BETWEEN 581 AND 585) " + " OR (custkey BETWEEN 591 AND 595) " + " OR (custkey BETWEEN 601 AND 605) " + " OR (custkey BETWEEN 611 AND 615) " + " OR (custkey BETWEEN 621 AND 625) " + " OR (custkey BETWEEN 631 AND 635) " + " OR (custkey BETWEEN 641 AND 645) " + " OR (custkey BETWEEN 651 AND 655) " + " OR (custkey BETWEEN 661 AND 665) " + " OR (custkey BETWEEN 671 AND 675) " + " OR (custkey BETWEEN 681 AND 685) " + " OR (custkey BETWEEN 691 AND 695) " + " OR (custkey BETWEEN 701 AND 705) " + " OR (custkey BETWEEN 711 AND 715) " + " OR (custkey BETWEEN 721 AND 725) " + " OR (custkey BETWEEN 731 AND 735) " + " OR (custkey BETWEEN 741 AND 745) " + " OR (custkey BETWEEN 751 AND 755) " + " OR (custkey BETWEEN 761 AND 765) " + " OR (custkey BETWEEN 771 AND 775) " + " OR (custkey BETWEEN 781 AND 785) " + " OR (custkey BETWEEN 791 AND 795) " + " OR (custkey BETWEEN 801 AND 805) " + " OR (custkey BETWEEN 811 AND 815) " + " OR (custkey BETWEEN 821 AND 825) " + " OR (custkey BETWEEN 831 AND 835) " + " OR (custkey BETWEEN 841 AND 845) " + " OR (custkey BETWEEN 851 AND 855) " + " OR (custkey BETWEEN 861 AND 865) " + " OR (custkey BETWEEN 871 AND 875) " + " OR (custkey BETWEEN 881 AND 885) " + " OR (custkey BETWEEN 891 AND 895) " + " OR (custkey BETWEEN 901 AND 905) " + " OR (custkey BETWEEN 911 AND 915) " + " OR (custkey BETWEEN 921 AND 925) " + " OR (custkey BETWEEN 931 AND 935) " + " OR (custkey BETWEEN 941 AND 945) " + " OR (custkey BETWEEN 951 AND 955) " + " OR (custkey BETWEEN 961 AND 965) " + " OR (custkey BETWEEN 971 AND 975) " + " OR (custkey BETWEEN 981 AND 985) " + " OR (custkey BETWEEN 991 AND 995) " + " OR (custkey BETWEEN 1001 AND 1005) " + " OR (custkey BETWEEN 1011 AND 1015) " + " OR (custkey BETWEEN 1021 AND 1025) " + " OR (custkey BETWEEN 1031 AND 1035) " + " OR (custkey BETWEEN 1041 AND 1045) " + " OR (custkey BETWEEN 1051 AND 1055) " + " OR (custkey BETWEEN 1061 AND 1065) " + " OR (custkey BETWEEN 1071 AND 1075) " + " OR (custkey BETWEEN 1081 AND 1085) " + " OR (custkey BETWEEN 1091 AND 1095) " + " OR (custkey BETWEEN 1101 AND 1105) " + " OR (custkey BETWEEN 1111 AND 1115) " + " OR (custkey BETWEEN 1121 AND 1125) " + " OR (custkey BETWEEN 1131 AND 1135) " + " OR (custkey BETWEEN 1141 AND 1145) " + " OR (custkey BETWEEN 1151 AND 1155) " + " OR (custkey BETWEEN 1161 AND 1165) " + " OR (custkey BETWEEN 1171 AND 1175) " + " OR (custkey BETWEEN 1181 AND 1185) " + " OR (custkey BETWEEN 1191 AND 1195) " + " OR (custkey BETWEEN 1201 AND 1205) " + " OR (custkey BETWEEN 1211 AND 1215) " + " OR (custkey BETWEEN 1221 AND 1225) " + " OR (custkey BETWEEN 1231 AND 1235) " + " OR (custkey BETWEEN 1241 AND 1245) " + " OR (custkey BETWEEN 1251 AND 1255) " + " OR (custkey BETWEEN 1261 AND 1265) " + " OR (custkey BETWEEN 1271 AND 1275) " + " OR (custkey BETWEEN 1281 AND 1285) " + " OR (custkey BETWEEN 1291 AND 1295) " + " OR (custkey BETWEEN 1301 AND 1305) " + " OR (custkey BETWEEN 1311 AND 1315) " + " OR (custkey BETWEEN 1321 AND 1325) " + " OR (custkey BETWEEN 1331 AND 1335) " + " OR (custkey BETWEEN 1341 AND 1345) " + " OR (custkey BETWEEN 1351 AND 1355) " + " OR (custkey BETWEEN 1361 AND 1365) " + " OR (custkey BETWEEN 1371 AND 1375) " + " OR (custkey BETWEEN 1381 AND 1385) " + " OR (custkey BETWEEN 1391 AND 1395) " + " OR (custkey BETWEEN 1401 AND 1405) " + " OR (custkey BETWEEN 1411 AND 1415) " + " OR (custkey BETWEEN 1421 AND 1425) " + " OR (custkey BETWEEN 1431 AND 1435) " + " OR (custkey BETWEEN 1441 AND 1445) " + " OR (custkey BETWEEN 1451 AND 1455) " + " OR (custkey BETWEEN 1461 AND 1465) " + " OR (custkey BETWEEN 1471 AND 1475) " + " OR (custkey BETWEEN 1481 AND 1485) " + " OR (custkey BETWEEN 1491 AND 1495) " + " OR (custkey BETWEEN 1501 AND 1505) " + " OR (custkey BETWEEN 1511 AND 1515) " + " OR (custkey BETWEEN 1521 AND 1525) " + " OR (custkey BETWEEN 1531 AND 1535) " + " OR (custkey BETWEEN 1541 AND 1545) " + " OR (custkey BETWEEN 1551 AND 1555) " + " OR (custkey BETWEEN 1561 AND 1565) " + " OR (custkey BETWEEN 1571 AND 1575) " + " OR (custkey BETWEEN 1581 AND 1585) " + " OR (custkey BETWEEN 1591 AND 1595) " + " OR (custkey BETWEEN 1601 AND 1605) " + " OR (custkey BETWEEN 1611 AND 1615) " + " OR (custkey BETWEEN 1621 AND 1625) " + " OR (custkey BETWEEN 1631 AND 1635) " + " OR (custkey BETWEEN 1641 AND 1645) " + " OR (custkey BETWEEN 1651 AND 1655) " + " OR (custkey BETWEEN 1661 AND 1665) " + " OR (custkey BETWEEN 1671 AND 1675) " + " OR (custkey BETWEEN 1681 AND 1685) " + " OR (custkey BETWEEN 1691 AND 1695) " + " OR (custkey BETWEEN 1701 AND 1705) " + " OR (custkey BETWEEN 1711 AND 1715) " + " OR (custkey BETWEEN 1721 AND 1725) " + " OR (custkey BETWEEN 1731 AND 1735) " + " OR (custkey BETWEEN 1741 AND 1745) " + " OR (custkey BETWEEN 1751 AND 1755) " + " OR (custkey BETWEEN 1761 AND 1765) " + " OR (custkey BETWEEN 1771 AND 1775) " + " OR (custkey BETWEEN 1781 AND 1785) " + " OR (custkey BETWEEN 1791 AND 1795) " + " OR (custkey BETWEEN 1801 AND 1805) " + " OR (custkey BETWEEN 1811 AND 1815) " + " OR (custkey BETWEEN 1821 AND 1825) " + " OR (custkey BETWEEN 1831 AND 1835) " + " OR (custkey BETWEEN 1841 AND 1845) " + " OR (custkey BETWEEN 1851 AND 1855) " + " OR (custkey BETWEEN 1861 AND 1865) " + " OR (custkey BETWEEN 1871 AND 1875) " + " OR (custkey BETWEEN 1881 AND 1885) " + " OR (custkey BETWEEN 1891 AND 1895) " + " OR (custkey BETWEEN 1901 AND 1905) " + " OR (custkey BETWEEN 1911 AND 1915) " + " OR (custkey BETWEEN 1921 AND 1925) " + " OR (custkey BETWEEN 1931 AND 1935) " + " OR (custkey BETWEEN 1941 AND 1945) " + " OR (custkey BETWEEN 1951 AND 1955) " + " OR (custkey BETWEEN 1961 AND 1965) " + " OR (custkey BETWEEN 1971 AND 1975) " + " OR (custkey BETWEEN 1981 AND 1985) " + " OR (custkey BETWEEN 1991 AND 1995) " + " OR (custkey BETWEEN 2001 AND 2005) " + " OR (custkey BETWEEN 2011 AND 2015) " + " OR (custkey BETWEEN 2021 AND 2025) " + " OR (custkey BETWEEN 2031 AND 2035) " + " OR (custkey BETWEEN 2041 AND 2045) " + " OR (custkey BETWEEN 2051 AND 2055) " + " OR (custkey BETWEEN 2061 AND 2065) " + " OR (custkey BETWEEN 2071 AND 2075) " + " OR (custkey BETWEEN 2081 AND 2085) " + " OR (custkey BETWEEN 2091 AND 2095) " + " OR (custkey BETWEEN 2101 AND 2105) " + " OR (custkey BETWEEN 2111 AND 2115) " + " OR (custkey BETWEEN 2121 AND 2125) " + " OR (custkey BETWEEN 2131 AND 2135) " + " OR (custkey BETWEEN 2141 AND 2145) " + " OR (custkey BETWEEN 2151 AND 2155) " + " OR (custkey BETWEEN 2161 AND 2165) " + " OR (custkey BETWEEN 2171 AND 2175) " + " OR (custkey BETWEEN 2181 AND 2185) " + " OR (custkey BETWEEN 2191 AND 2195) " + " OR (custkey BETWEEN 2201 AND 2205) " + " OR (custkey BETWEEN 2211 AND 2215) " + " OR (custkey BETWEEN 2221 AND 2225) " + " OR (custkey BETWEEN 2231 AND 2235) " + " OR (custkey BETWEEN 2241 AND 2245) " + " OR (custkey BETWEEN 2251 AND 2255) " + " OR (custkey BETWEEN 2261 AND 2265) " + " OR (custkey BETWEEN 2271 AND 2275) " + " OR (custkey BETWEEN 2281 AND 2285) " + " OR (custkey BETWEEN 2291 AND 2295) " + " OR (custkey BETWEEN 2301 AND 2305) " + " OR (custkey BETWEEN 2311 AND 2315) " + " OR (custkey BETWEEN 2321 AND 2325) " + " OR (custkey BETWEEN 2331 AND 2335) " + " OR (custkey BETWEEN 2341 AND 2345) " + " OR (custkey BETWEEN 2351 AND 2355) " + " OR (custkey BETWEEN 2361 AND 2365) " + " OR (custkey BETWEEN 2371 AND 2375) " + " OR (custkey BETWEEN 2381 AND 2385) " + " OR (custkey BETWEEN 2391 AND 2395) " + " OR (custkey BETWEEN 2401 AND 2405) " + " OR (custkey BETWEEN 2411 AND 2415) " + " OR (custkey BETWEEN 2421 AND 2425) " + " OR (custkey BETWEEN 2431 AND 2435) " + " OR (custkey BETWEEN 2441 AND 2445) " + " OR (custkey BETWEEN 2451 AND 2455) " + " OR (custkey BETWEEN 2461 AND 2465) " + " OR (custkey BETWEEN 2471 AND 2475) " + " OR (custkey BETWEEN 2481 AND 2485) " + " OR (custkey BETWEEN 2491 AND 2495) " + " OR (custkey BETWEEN 2501 AND 2505) " + " OR (custkey BETWEEN 2511 AND 2515) " + " OR (custkey BETWEEN 2521 AND 2525) " + " OR (custkey BETWEEN 2531 AND 2535) " + " OR (custkey BETWEEN 2541 AND 2545) " + " OR (custkey BETWEEN 2551 AND 2555) " + " OR (custkey BETWEEN 2561 AND 2565) " + " OR (custkey BETWEEN 2571 AND 2575) " + " OR (custkey BETWEEN 2581 AND 2585) " + " OR (custkey BETWEEN 2591 AND 2595) " + " OR (custkey BETWEEN 2601 AND 2605) " + " OR (custkey BETWEEN 2611 AND 2615) " + " OR (custkey BETWEEN 2621 AND 2625) " + " OR (custkey BETWEEN 2631 AND 2635) " + " OR (custkey BETWEEN 2641 AND 2645) " + " OR (custkey BETWEEN 2651 AND 2655) " + " OR (custkey BETWEEN 2661 AND 2665) " + " OR (custkey BETWEEN 2671 AND 2675) " + " OR (custkey BETWEEN 2681 AND 2685) " + " OR (custkey BETWEEN 2691 AND 2695) " + " OR (custkey BETWEEN 2701 AND 2705) " + " OR (custkey BETWEEN 2711 AND 2715) " + " OR (custkey BETWEEN 2721 AND 2725) " + " OR (custkey BETWEEN 2731 AND 2735) " + " OR (custkey BETWEEN 2741 AND 2745) " + " OR (custkey BETWEEN 2751 AND 2755) " + " OR (custkey BETWEEN 2761 AND 2765) " + " OR (custkey BETWEEN 2771 AND 2775) " + " OR (custkey BETWEEN 2781 AND 2785) " + " OR (custkey BETWEEN 2791 AND 2795) " + " OR (custkey BETWEEN 2801 AND 2805) " + " OR (custkey BETWEEN 2811 AND 2815) " + " OR (custkey BETWEEN 2821 AND 2825) " + " OR (custkey BETWEEN 2831 AND 2835) " + " OR (custkey BETWEEN 2841 AND 2845) " + " OR (custkey BETWEEN 2851 AND 2855) " + " OR (custkey BETWEEN 2861 AND 2865) " + " OR (custkey BETWEEN 2871 AND 2875) " + " OR (custkey BETWEEN 2881 AND 2885) " + " OR (custkey BETWEEN 2891 AND 2895) " + " OR (custkey BETWEEN 2901 AND 2905) " + " OR (custkey BETWEEN 2911 AND 2915) " + " OR (custkey BETWEEN 2921 AND 2925) " + " OR (custkey BETWEEN 2931 AND 2935) " + " OR (custkey BETWEEN 2941 AND 2945) " + " OR (custkey BETWEEN 2951 AND 2955) " + " OR (custkey BETWEEN 2961 AND 2965) " + " OR (custkey BETWEEN 2971 AND 2975) " + " OR (custkey BETWEEN 2981 AND 2985) " + " OR (custkey BETWEEN 2991 AND 2995) " + " OR (custkey BETWEEN 3001 AND 3005) " + " OR (custkey BETWEEN 3011 AND 3015) " + " OR (custkey BETWEEN 3021 AND 3025) " + " OR (custkey BETWEEN 3031 AND 3035) " + " OR (custkey BETWEEN 3041 AND 3045) " + " OR (custkey BETWEEN 3051 AND 3055) " + " OR (custkey BETWEEN 3061 AND 3065) " + " OR (custkey BETWEEN 3071 AND 3075) " + " OR (custkey BETWEEN 3081 AND 3085) " + " OR (custkey BETWEEN 3091 AND 3095) " + " OR (custkey BETWEEN 3101 AND 3105) " + " OR (custkey BETWEEN 3111 AND 3115) " + " OR (custkey BETWEEN 3121 AND 3125) " + " OR (custkey BETWEEN 3131 AND 3135) " + " OR (custkey BETWEEN 3141 AND 3145) " + " OR (custkey BETWEEN 3151 AND 3155) " + " OR (custkey BETWEEN 3161 AND 3165) " + " OR (custkey BETWEEN 3171 AND 3175) " + " OR (custkey BETWEEN 3181 AND 3185) " + " OR (custkey BETWEEN 3191 AND 3195) " + " OR (custkey BETWEEN 3201 AND 3205) " + " OR (custkey BETWEEN 3211 AND 3215) " + " OR (custkey BETWEEN 3221 AND 3225) " + " OR (custkey BETWEEN 3231 AND 3235) " + " OR (custkey BETWEEN 3241 AND 3245) " + " OR (custkey BETWEEN 3251 AND 3255) " + " OR (custkey BETWEEN 3261 AND 3265) " + " OR (custkey BETWEEN 3271 AND 3275) " + " OR (custkey BETWEEN 3281 AND 3285) " + " OR (custkey BETWEEN 3291 AND 3295) " + " OR (custkey BETWEEN 3301 AND 3305) " + " OR (custkey BETWEEN 3311 AND 3315) " + " OR (custkey BETWEEN 3321 AND 3325) " + " OR (custkey BETWEEN 3331 AND 3335) " + " OR (custkey BETWEEN 3341 AND 3345) " + " OR (custkey BETWEEN 3351 AND 3355) " + " OR (custkey BETWEEN 3361 AND 3365) " + " OR (custkey BETWEEN 3371 AND 3375) " + " OR (custkey BETWEEN 3381 AND 3385) " + " OR (custkey BETWEEN 3391 AND 3395) " + " OR (custkey BETWEEN 3401 AND 3405) " + " OR (custkey BETWEEN 3411 AND 3415) " + " OR (custkey BETWEEN 3421 AND 3425) " + " OR (custkey BETWEEN 3431 AND 3435) " + " OR (custkey BETWEEN 3441 AND 3445) " + " OR (custkey BETWEEN 3451 AND 3455) " + " OR (custkey BETWEEN 3461 AND 3465) " + " OR (custkey BETWEEN 3471 AND 3475) " + " OR (custkey BETWEEN 3481 AND 3485) " + " OR (custkey BETWEEN 3491 AND 3495) " + " OR (custkey BETWEEN 3501 AND 3505) " + " OR (custkey BETWEEN 3511 AND 3515) " + " OR (custkey BETWEEN 3521 AND 3525) " + " OR (custkey BETWEEN 3531 AND 3535) " + " OR (custkey BETWEEN 3541 AND 3545) " + " OR (custkey BETWEEN 3551 AND 3555) " + " OR (custkey BETWEEN 3561 AND 3565) " + " OR (custkey BETWEEN 3571 AND 3575) " + " OR (custkey BETWEEN 3581 AND 3585) " + " OR (custkey BETWEEN 3591 AND 3595) " + " OR (custkey BETWEEN 3601 AND 3605) " + " OR (custkey BETWEEN 3611 AND 3615) " + " OR (custkey BETWEEN 3621 AND 3625) " + " OR (custkey BETWEEN 3631 AND 3635) " + " OR (custkey BETWEEN 3641 AND 3645) " + " OR (custkey BETWEEN 3651 AND 3655) " + " OR (custkey BETWEEN 3661 AND 3665) " + " OR (custkey BETWEEN 3671 AND 3675) " + " OR (custkey BETWEEN 3681 AND 3685) " + " OR (custkey BETWEEN 3691 AND 3695) " + " OR (custkey BETWEEN 3701 AND 3705) " + " OR (custkey BETWEEN 3711 AND 3715) " + " OR (custkey BETWEEN 3721 AND 3725) " + " OR (custkey BETWEEN 3731 AND 3735) " + " OR (custkey BETWEEN 3741 AND 3745) " + " OR (custkey BETWEEN 3751 AND 3755) " + " OR (custkey BETWEEN 3761 AND 3765) " + " OR (custkey BETWEEN 3771 AND 3775) " + " OR (custkey BETWEEN 3781 AND 3785) " + " OR (custkey BETWEEN 3791 AND 3795) " + " OR (custkey BETWEEN 3801 AND 3805) " + " OR (custkey BETWEEN 3811 AND 3815) " + " OR (custkey BETWEEN 3821 AND 3825) " + " OR (custkey BETWEEN 3831 AND 3835) " + " OR (custkey BETWEEN 3841 AND 3845) " + " OR (custkey BETWEEN 3851 AND 3855) " + " OR (custkey BETWEEN 3861 AND 3865) " + " OR (custkey BETWEEN 3871 AND 3875) " + " OR (custkey BETWEEN 3881 AND 3885) " + " OR (custkey BETWEEN 3891 AND 3895) " + " OR (custkey BETWEEN 3901 AND 3905) " + " OR (custkey BETWEEN 3911 AND 3915) " + " OR (custkey BETWEEN 3921 AND 3925) " + " OR (custkey BETWEEN 3931 AND 3935) " + " OR (custkey BETWEEN 3941 AND 3945) " + " OR (custkey BETWEEN 3951 AND 3955) " + " OR (custkey BETWEEN 3961 AND 3965) " + " OR (custkey BETWEEN 3971 AND 3975) " + " OR (custkey BETWEEN 3981 AND 3985) " + " OR (custkey BETWEEN 3991 AND 3995) " + " OR (custkey BETWEEN 4001 AND 4005) " + " OR (custkey BETWEEN 4011 AND 4015) " + " OR (custkey BETWEEN 4021 AND 4025) " + " OR (custkey BETWEEN 4031 AND 4035) " + " OR (custkey BETWEEN 4041 AND 4045) " + " OR (custkey BETWEEN 4051 AND 4055) " + " OR (custkey BETWEEN 4061 AND 4065) " + " OR (custkey BETWEEN 4071 AND 4075) " + " OR (custkey BETWEEN 4081 AND 4085) " + " OR (custkey BETWEEN 4091 AND 4095) " + " OR (custkey BETWEEN 4101 AND 4105) " + " OR (custkey BETWEEN 4111 AND 4115) " + " OR (custkey BETWEEN 4121 AND 4125) " + " OR (custkey BETWEEN 4131 AND 4135) " + " OR (custkey BETWEEN 4141 AND 4145) " + " OR (custkey BETWEEN 4151 AND 4155) " + " OR (custkey BETWEEN 4161 AND 4165) " + " OR (custkey BETWEEN 4171 AND 4175) " + " OR (custkey BETWEEN 4181 AND 4185) " + " OR (custkey BETWEEN 4191 AND 4195) " + " OR (custkey BETWEEN 4201 AND 4205) " + " OR (custkey BETWEEN 4211 AND 4215) " + " OR (custkey BETWEEN 4221 AND 4225) " + " OR (custkey BETWEEN 4231 AND 4235) " + " OR (custkey BETWEEN 4241 AND 4245) " + " OR (custkey BETWEEN 4251 AND 4255) " + " OR (custkey BETWEEN 4261 AND 4265) " + " OR (custkey BETWEEN 4271 AND 4275) " + " OR (custkey BETWEEN 4281 AND 4285) " + " OR (custkey BETWEEN 4291 AND 4295) " + " OR (custkey BETWEEN 4301 AND 4305) " + " OR (custkey BETWEEN 4311 AND 4315) " + " OR (custkey BETWEEN 4321 AND 4325) " + " OR (custkey BETWEEN 4331 AND 4335) " + " OR (custkey BETWEEN 4341 AND 4345) " + " OR (custkey BETWEEN 4351 AND 4355) " + " OR (custkey BETWEEN 4361 AND 4365) " + " OR (custkey BETWEEN 4371 AND 4375) " + " OR (custkey BETWEEN 4381 AND 4385) " + " OR (custkey BETWEEN 4391 AND 4395) " + " OR (custkey BETWEEN 4401 AND 4405) " + " OR (custkey BETWEEN 4411 AND 4415) " + " OR (custkey BETWEEN 4421 AND 4425) " + " OR (custkey BETWEEN 4431 AND 4435) " + " OR (custkey BETWEEN 4441 AND 4445) " + " OR (custkey BETWEEN 4451 AND 4455) " + " OR (custkey BETWEEN 4461 AND 4465) " + " OR (custkey BETWEEN 4471 AND 4475) " + " OR (custkey BETWEEN 4481 AND 4485) " + " OR (custkey BETWEEN 4491 AND 4495) " + " OR (custkey BETWEEN 4501 AND 4505) " + " OR (custkey BETWEEN 4511 AND 4515) " + " OR (custkey BETWEEN 4521 AND 4525) " + " OR (custkey BETWEEN 4531 AND 4535) " + " OR (custkey BETWEEN 4541 AND 4545) " + " OR (custkey BETWEEN 4551 AND 4555) " + " OR (custkey BETWEEN 4561 AND 4565) " + " OR (custkey BETWEEN 4571 AND 4575) " + " OR (custkey BETWEEN 4581 AND 4585) " + " OR (custkey BETWEEN 4591 AND 4595) " + " OR (custkey BETWEEN 4601 AND 4605) " + " OR (custkey BETWEEN 4611 AND 4615) " + " OR (custkey BETWEEN 4621 AND 4625) " + " OR (custkey BETWEEN 4631 AND 4635) " + " OR (custkey BETWEEN 4641 AND 4645) " + " OR (custkey BETWEEN 4651 AND 4655) " + " OR (custkey BETWEEN 4661 AND 4665) " + " OR (custkey BETWEEN 4671 AND 4675) " + " OR (custkey BETWEEN 4681 AND 4685) " + " OR (custkey BETWEEN 4691 AND 4695) " + " OR (custkey BETWEEN 4701 AND 4705) " + " OR (custkey BETWEEN 4711 AND 4715) " + " OR (custkey BETWEEN 4721 AND 4725) " + " OR (custkey BETWEEN 4731 AND 4735) " + " OR (custkey BETWEEN 4741 AND 4745) " + " OR (custkey BETWEEN 4751 AND 4755) " + " OR (custkey BETWEEN 4761 AND 4765) " + " OR (custkey BETWEEN 4771 AND 4775) " + " OR (custkey BETWEEN 4781 AND 4785) " + " OR (custkey BETWEEN 4791 AND 4795) " + " OR (custkey BETWEEN 4801 AND 4805) " + " OR (custkey BETWEEN 4811 AND 4815) " + " OR (custkey BETWEEN 4821 AND 4825) " + " OR (custkey BETWEEN 4831 AND 4835) " + " OR (custkey BETWEEN 4841 AND 4845) " + " OR (custkey BETWEEN 4851 AND 4855) " + " OR (custkey BETWEEN 4861 AND 4865) " + " OR (custkey BETWEEN 4871 AND 4875) " + " OR (custkey BETWEEN 4881 AND 4885) " + " OR (custkey BETWEEN 4891 AND 4895) " + " OR (custkey BETWEEN 4901 AND 4905) " + " OR (custkey BETWEEN 4911 AND 4915) " + " OR (custkey BETWEEN 4921 AND 4925) " + " OR (custkey BETWEEN 4931 AND 4935) " + " OR (custkey BETWEEN 4941 AND 4945) " + " OR (custkey BETWEEN 4951 AND 4955) " + " OR (custkey BETWEEN 4961 AND 4965) " + " OR (custkey BETWEEN 4971 AND 4975) " + " OR (custkey BETWEEN 4981 AND 4985) " + " OR (custkey BETWEEN 4991 AND 4995)";
    MaterializedResult result = computeActual(sql);
    System.out.println("Query Output: " + result);
}
Also used : MaterializedResult(io.prestosql.testing.MaterializedResult) Test(org.testng.annotations.Test)

Example 28 with MaterializedResult

use of io.prestosql.testing.MaterializedResult in project hetu-core by openlookeng.

the class AbstractTestIntegrationSmokeTest method testShowTables.

@Test
public void testShowTables() {
    MaterializedResult actualTables = computeActual("SHOW TABLES").toTestTypes();
    MaterializedResult expectedTables = MaterializedResult.resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR).row("orders").build();
    assertContains(actualTables, expectedTables);
}
Also used : MaterializedResult(io.prestosql.testing.MaterializedResult) Test(org.testng.annotations.Test)

Example 29 with MaterializedResult

use of io.prestosql.testing.MaterializedResult in project hetu-core by openlookeng.

the class AbstractTestIntegrationSmokeTest method testShowSchemas.

@Test
public void testShowSchemas() {
    MaterializedResult actualSchemas = computeActual("SHOW SCHEMAS").toTestTypes();
    MaterializedResult.Builder resultBuilder = MaterializedResult.resultBuilder(getQueryRunner().getDefaultSession(), VARCHAR).row(getQueryRunner().getDefaultSession().getSchema().orElse("tpch"));
    assertContains(actualSchemas, resultBuilder.build());
}
Also used : MaterializedResult(io.prestosql.testing.MaterializedResult) Test(org.testng.annotations.Test)

Example 30 with MaterializedResult

use of io.prestosql.testing.MaterializedResult in project hetu-core by openlookeng.

the class AbstractTestIntegrationSmokeTest method testDescribeTable.

@Test
public void testDescribeTable() {
    MaterializedResult actualColumns = computeActual("DESC orders").toTestTypes();
    assertEquals(actualColumns, getExpectedOrdersTableDescription(isDateTypeSupported(), isParameterizedVarcharSupported()));
}
Also used : MaterializedResult(io.prestosql.testing.MaterializedResult) Test(org.testng.annotations.Test)

Aggregations

MaterializedResult (io.prestosql.testing.MaterializedResult)562 Test (org.testng.annotations.Test)474 Page (io.prestosql.spi.Page)139 AbstractTestIntegrationSmokeTest (io.prestosql.tests.AbstractTestIntegrationSmokeTest)97 MaterializedRow (io.prestosql.testing.MaterializedRow)95 OperatorAssertion.toMaterializedResult (io.prestosql.operator.OperatorAssertion.toMaterializedResult)74 RowPagesBuilder (io.prestosql.RowPagesBuilder)63 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)63 Type (io.prestosql.spi.type.Type)61 MarkerPage (io.prestosql.spi.snapshot.MarkerPage)58 Session (io.prestosql.Session)52 ConnectorSession (io.prestosql.spi.connector.ConnectorSession)46 TestingConnectorSession (io.prestosql.testing.TestingConnectorSession)44 ConnectorTableHandle (io.prestosql.spi.connector.ConnectorTableHandle)42 ColumnHandle (io.prestosql.spi.connector.ColumnHandle)38 ConnectorMetadata (io.prestosql.spi.connector.ConnectorMetadata)38 TestingTaskContext (io.prestosql.testing.TestingTaskContext)38 ImmutableList (com.google.common.collect.ImmutableList)34 HiveColumnHandle.bucketColumnHandle (io.prestosql.plugin.hive.HiveColumnHandle.bucketColumnHandle)34 List (java.util.List)32