Search in sources :

Example 16 with StructImpl

use of org.apache.geode.cache.query.internal.StructImpl in project zeppelin by apache.

the class GeodeOqlInterpreterTest method oqlStructResponseWithReservedCharacters.

@Test
public void oqlStructResponseWithReservedCharacters() throws Exception {
    String[] fields = new String[] { "fi\teld1", "f\nield2" };
    Struct s1 = new StructImpl(new StructTypeImpl(fields), new String[] { "v\nal\t1", "val2" });
    testOql(asIterator(s1), "fi eld1\tf ield2\t\nv al 1\tval2\t\n", 10);
}
Also used : StructImpl(org.apache.geode.cache.query.internal.StructImpl) StructTypeImpl(org.apache.geode.cache.query.internal.types.StructTypeImpl) Struct(org.apache.geode.cache.query.Struct) Test(org.junit.Test)

Example 17 with StructImpl

use of org.apache.geode.cache.query.internal.StructImpl in project zeppelin by apache.

the class GeodeOqlInterpreterTest method oqlStructResponse.

@Test
public void oqlStructResponse() throws Exception {
    String[] fields = new String[] { "field1", "field2" };
    Struct s1 = new StructImpl(new StructTypeImpl(fields), new String[] { "val11", "val12" });
    Struct s2 = new StructImpl(new StructTypeImpl(fields), new String[] { "val21", "val22" });
    testOql(asIterator(s1, s2), "field1\tfield2\t\nval11\tval12\t\nval21\tval22\t\n", 10);
    testOql(asIterator(s1, s2), "field1\tfield2\t\nval11\tval12\t\n", 1);
}
Also used : StructImpl(org.apache.geode.cache.query.internal.StructImpl) StructTypeImpl(org.apache.geode.cache.query.internal.types.StructTypeImpl) Struct(org.apache.geode.cache.query.Struct) Test(org.junit.Test)

Aggregations

StructImpl (org.apache.geode.cache.query.internal.StructImpl)17 Test (org.junit.Test)10 SelectResults (org.apache.geode.cache.query.SelectResults)8 Region (org.apache.geode.cache.Region)7 QueryService (org.apache.geode.cache.query.QueryService)7 ClientCache (org.apache.geode.cache.client.ClientCache)6 ClientCacheFactory (org.apache.geode.cache.client.ClientCacheFactory)6 PortfolioPdx (org.apache.geode.cache.query.data.PortfolioPdx)6 PositionPdx (org.apache.geode.cache.query.data.PositionPdx)6 Host (org.apache.geode.test.dunit.Host)6 SerializableCallable (org.apache.geode.test.dunit.SerializableCallable)6 VM (org.apache.geode.test.dunit.VM)6 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)6 Struct (org.apache.geode.cache.query.Struct)5 PdxInstance (org.apache.geode.pdx.PdxInstance)5 QueryObserver (org.apache.geode.cache.query.internal.QueryObserver)4 StructTypeImpl (org.apache.geode.cache.query.internal.types.StructTypeImpl)4 ArrayList (java.util.ArrayList)3 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)3 Collection (java.util.Collection)2