Projection { @Override public String toString() { String str; if (!StringUtils.isEmpty(functionName)) { str = toExpr(true); } else if (!StringUtils.isEmpty(expr)) { str = quoteAlias(expr); } else { throw new IllegalArgumentException("expr or functionName should be specified"); } return str; } Projection();  Projection(Projection other);  Projection(String expr, String functionName, List<String> args, String outputFieldName); String getExpr(); String getFunctionName(); List<String> getArgs(); String getOutputFieldName(); @Override String toString();  }
@Test public void testProjectionToString1() throws Exception { Projection projection = new Projection("UPPER(review_id) AS Camel", null, null, null); String str = projection.toString(); Assert.assertEquals("UPPER(review_id) AS \"Camel\"", str); }
@Test public void testProjectionToString2() throws Exception { Projection projection = new Projection("UPPER(review_id) AS \"Camel\"", null, null, null); String str = projection.toString(); Assert.assertEquals("UPPER(review_id) AS \"Camel\"", str); }
@Test public void testProjectionToString3() throws Exception { Projection projection = new Projection(null, "UPPER", Collections.singletonList("review_id"), "Camel"); String str = projection.toString(); Assert.assertEquals("UPPER(review_id) AS \"Camel\"", str); }