TableInfo { @Override public String toString() { StringBuilder sb = new StringBuilder(); if (projectName != null) { sb.append(projectName).append('.'); } sb.append(tblName); if (partSpec != null && !partSpec.isEmpty()) { sb.append(partSpec.toString()); } return sb.toString(); } TableInfo(String projectName, String tblName, LinkedHashMap<String, String> partSpec,
                   String[] cols, String lable);  TableInfo();  TableInfo(TableInfo table); static TableInfoBuilder builder(); void validate(); String getProjectName(); PartitionSpec getPartitionSpec(); LinkedHashMap<String, String> getPartSpec(); String getPartPath(); void setPartSpec(LinkedHashMap<String, String> partSpec); void setPartSpec(String partPath); String[] getCols(); void setCols(String[] cols); String getTableName(); void setTableName(String name); String getLabel(); void setLable(String lable); Class<?> getMapperClass(); void setMapperClass(Class<?> mapperClass); void setProjectName(String projectName); @Override boolean equals(Object that); @Override String toString(); static final String DEFAULT_LABEL; static final String INNER_OUTPUT_LABEL; }
@Test public void testPartitionSpecToString() { PartitionSpec spec = new PartitionSpec(); spec.set("pt1", "foo"); spec.set("pt2", "bar"); Assert.assertEquals("pt1=\'foo\',pt2=\'bar\'", spec.toString(true, false)); Assert.assertEquals("pt1=foo,pt2=bar", spec.toString(false, false)); Assert.assertEquals("pt1=\'foo\'/pt2=\'bar\'", spec.toString(true, true)); Assert.assertEquals("pt1=foo/pt2=bar", spec.toString(false, true)); }