private static void stripAliases(Schema s) {
   for (Schema.FieldSchema fs : s.getFields()) {
     fs.alias = null;
     if (fs.schema != null) {
       stripAliases(fs.schema);
     }
   }
 }
Exemplo n.º 2
0
 public void testCharArray2Numeric() {
   byte[] numbericTypes =
       new byte[] {DataType.DOUBLE, DataType.FLOAT, DataType.LONG, DataType.INTEGER};
   Schema.FieldSchema inputFieldSchema = new Schema.FieldSchema("", DataType.CHARARRAY);
   for (byte type : numbericTypes) {
     Schema.FieldSchema castFieldSchema = new Schema.FieldSchema("", type);
     Assert.assertTrue(Schema.FieldSchema.castable(castFieldSchema, inputFieldSchema));
   }
 }