### Question:
MatchPrefix extends ESFunction { @Override public QueryBuilder buildQuery() throws ExecutionException { validateFunctionSignature(FUNCTION_NAME, true, EXPECTED_PARAMETERS, EXPECTED_SIGNATURE); String value = getParameters().get(1).getStringValue(); String field = ""; if (getParameters().get(0) instanceof ColumnSelector ){ field = ((ColumnSelector) getParameters().get(0)).getColumnName().getName(); } else { field = getParameters().get(0).getStringValue(); } return QueryBuilders.prefixQuery(field, value); } protected  MatchPrefix(List<Selector> parameters); @Override QueryBuilder buildQuery();  }### Answer:
@Test public void testMatch() throws UnsupportedException, ExecutionException { List<Selector> parameters = new ArrayList<>(); TableName tableName = new TableName("catalog", "table"); parameters.add(new ColumnSelector(new ColumnName(tableName, "colName"))); parameters.add(new StringSelector("value")); FunctionRelation function = new FunctionRelation(ESFunction.MATCH_PREFIX, parameters,tableName); ESFunction match = ESFunction.build(function); QueryBuilder builder = match.buildQuery(); String expected = "{\"prefix\":{\"colName\":\"value\"}}"; Assert.assertEquals(expected, builder.toString().replaceAll("\\s+", "")); }