Search in sources :

Example 1 with ObjectLiteral

use of io.crate.sql.tree.ObjectLiteral in project crate by crate.

the class SetAnalyzerTest method testObjectValue.

@Test
public void testObjectValue() throws Exception {
    SetAnalyzedStatement analysis = analyze("SET GLOBAL PERSISTENT cluster.graceful_stop = {timeout='1h'}");
    Multimap<String, Expression> map = LinkedListMultimap.create();
    map.put("timeout", Literal.fromObject("1h"));
    Literal expected = new ObjectLiteral(map);
    assertThat(analysis.settings().get("cluster.graceful_stop").get(0), Matchers.<Expression>is(expected));
}
Also used : ObjectLiteral(io.crate.sql.tree.ObjectLiteral) Expression(io.crate.sql.tree.Expression) Literal(io.crate.sql.tree.Literal) ObjectLiteral(io.crate.sql.tree.ObjectLiteral) Test(org.junit.Test) CrateUnitTest(io.crate.test.integration.CrateUnitTest)

Aggregations

Expression (io.crate.sql.tree.Expression)1 Literal (io.crate.sql.tree.Literal)1 ObjectLiteral (io.crate.sql.tree.ObjectLiteral)1 CrateUnitTest (io.crate.test.integration.CrateUnitTest)1 Test (org.junit.Test)1