Added the flatten option to replace the schemas with single table name