@Test public void testParseStruct() { String name1 = "struct<name:string,age:tinyint,families:map<string,int>,hobbies:array<string>,test:decimal(10,2),test2:decimal>"; TypeInfo typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name1); validateStruct(typeInfo); String name = "strUCT<name:char(8),test:" + name1 + ">"; typeInfo = TypeInfoParser.getTypeInfoFromTypeString(name); Assert.assertEquals(((StructTypeInfo) typeInfo).getFieldNames().get(0), "name"); Assert.assertEquals(((StructTypeInfo) typeInfo).getFieldNames().get(1), "test"); Assert.assertTrue( ((StructTypeInfo) typeInfo).getFieldTypeInfos().get(0) instanceof CharTypeInfo); Assert.assertEquals(((StructTypeInfo) typeInfo).getFieldTypeInfos().get(0).getTypeName(), "CHAR(8)"); Assert.assertEquals(((CharTypeInfo)((StructTypeInfo) typeInfo).getFieldTypeInfos().get(0)).getLength(), 8); validateStruct(((StructTypeInfo) typeInfo).getFieldTypeInfos().get(1)); }
public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name); }
TypeInfoParser { public static TypeInfo getTypeInfoFromTypeString(String name) { return new TypeInfoParser(name).parseTypeInfo(); } TypeInfoParser(String name); static TypeInfo getTypeInfoFromTypeString(String name);  }