apply schema for flatten operator