How to load Avro file in a Dataset

Posted by Soheil Pourbafrani on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/How-to-load-Avro-file-in-a-Dataset-tp25789.html

According to the Flink document, it's possible to load Avro file like the following:
AvroInputFormat<User> users = new AvroInputFormat<User>(in, User.class);
DataSet<User> usersDS = env.createInput(users);
It's a bit confusing for me. I guess the User is a predefined class. My question is can Flink detect the Avro file schema automatically? How can I load Avro file without any predefined class?