Schema implements ProtoObject<SchemaProto>, Cloneable, GsonObject { public void setQualifier(String qualifier) { List<Column> columns = getRootColumns(); fields.clear(); fieldsByQualifiedName.clear(); fieldsByName.clear(); Column newColumn; for (Column c : columns) { newColumn = new Column(qualifier + "." + c.getSimpleName(), c.typeDesc); addColumn(newColumn); } } Schema();  Schema(SchemaProto proto);  Schema(Schema schema);  Schema(Column [] columns);  Schema(Iterable<Column> columns); void setQualifier(String qualifier); int size(); Column getColumn(int id); Column getColumn(Column column); int getIndex(Column column); Column getColumn(String name); int getColumnId(String name); int getColumnIdByName(String colName); List<Column> getRootColumns(); List<Column> getAllColumns(); boolean contains(String name); boolean contains(Column column); boolean containsByQualifiedName(String qualifiedName); boolean containsByName(String colName); boolean containsAll(Collection<Column> columns); synchronized Schema addColumn(String name, TypeDesc typeDesc); synchronized Schema addColumn(String name, Type type); synchronized Schema addColumn(String name, Type type, int length); synchronized Schema addColumn(String name, DataType dataType); synchronized void addColumn(Column column); synchronized void addColumns(Schema schema); @Override int hashCode(); @Override boolean equals(Object o); @Override Object clone(); @Override SchemaProto getProto(); String toString(); @Override String toJson(); Column [] toArray();  }
@Test public final void testSetQualifier() { Schema schema2 = new Schema(schema.getProto()); schema2.setQualifier("test1"); Column column = schema2.getColumn(1); assertEquals(1, schema2.getColumnIdByName("age")); assertEquals(column, schema2.getColumn("age")); assertEquals(column, schema2.getColumn("test1.age")); Schema schema3 = new Schema(); schema3.addColumn("tb1.col1", Type.INT4); schema3.addColumn("col2", Type.INT4); assertEquals("tb1", schema3.getColumn(0).getQualifier()); assertEquals("tb1.col1", schema3.getColumn(0).getQualifiedName()); assertEquals("col1", schema3.getColumn(0).getSimpleName()); assertEquals("col2", schema3.getColumn(1).getQualifiedName()); assertEquals(schema3.getColumn(0), schema3.getColumn("col1")); assertEquals(schema3.getColumn(0), schema3.getColumn("tb1.col1")); assertEquals(schema3.getColumn(1), schema3.getColumn("col2")); assertEquals(schema3.getColumn(1), schema3.getColumn("col2")); schema3.setQualifier("tb2"); assertEquals("tb2", schema3.getColumn(0).getQualifier()); assertEquals("tb2.col1", schema3.getColumn(0).getQualifiedName()); assertEquals("col1", schema3.getColumn(0).getSimpleName()); assertEquals("tb2.col2", schema3.getColumn(1).getQualifiedName()); assertEquals(schema3.getColumn(0), schema3.getColumn("col1")); assertEquals(schema3.getColumn(0), schema3.getColumn("tb2.col1")); assertEquals(schema3.getColumn(1), schema3.getColumn("col2")); assertEquals(schema3.getColumn(1), schema3.getColumn("tb2.col2")); }