use of org.apache.samza.sql.SamzaSqlRelRecord in project samza by apache.
the class TestGetSqlFieldUdf method testMapAtIntermediateFields.
@Test
public void testMapAtIntermediateFields() {
SamzaSqlRelRecord record = createRecord("bar.map:baz.map:baf.foo");
GetSqlFieldUdf getSqlFieldUdf = new GetSqlFieldUdf();
Assert.assertEquals(getSqlFieldUdf.execute(record, "bar.baz.baf.foo"), "bar");
}
use of org.apache.samza.sql.SamzaSqlRelRecord in project samza by apache.
the class TestGetSqlFieldUdf method testNullFields.
@Test(expected = NullPointerException.class)
public void testNullFields() {
SamzaSqlRelRecord record = createRecord("bar.baz.baf.foo");
GetSqlFieldUdf getSqlFieldUdf = new GetSqlFieldUdf();
getSqlFieldUdf.execute(record, null);
}
use of org.apache.samza.sql.SamzaSqlRelRecord in project samza by apache.
the class TestGetSqlFieldUdf method testMultiLevelInvalidFinalField.
@Test(expected = IllegalArgumentException.class)
public void testMultiLevelInvalidFinalField() {
SamzaSqlRelRecord record = createRecord("bar.baz.baf.foo");
GetSqlFieldUdf getSqlFieldUdf = new GetSqlFieldUdf();
getSqlFieldUdf.execute(record, "bar.baz.baf.funny");
}
use of org.apache.samza.sql.SamzaSqlRelRecord in project samza by apache.
the class TestGetSqlFieldUdf method testMapAtAllIntermediateFields.
@Test
public void testMapAtAllIntermediateFields() {
SamzaSqlRelRecord record = createRecord("bar.map:baz.map:baf.map:foo");
GetSqlFieldUdf getSqlFieldUdf = new GetSqlFieldUdf();
Assert.assertEquals(getSqlFieldUdf.execute(record, "bar.baz.baf.foo"), "bar");
}
use of org.apache.samza.sql.SamzaSqlRelRecord in project samza by apache.
the class TestGetSqlFieldUdf method testMapAtLastField.
@Test
public void testMapAtLastField() {
SamzaSqlRelRecord record = createRecord("bar.baz.baf.map:foo");
GetSqlFieldUdf getSqlFieldUdf = new GetSqlFieldUdf();
Assert.assertEquals(getSqlFieldUdf.execute(record, "bar.baz.baf.foo"), "bar");
}
Aggregations