from pyspark.sql.types import StructType, StructField, StringType, IntegerType, FloatType
def schema_virtual(*args, **kwargs):
return StructType([
StructField (name = 'year', dataType = IntegerType(), nullable = True),
StructField (name = 'month', dataType = StringType(), nullable = True),
StructField (name = 'department', dataType = StringType(), nullable = True),
StructField (name = 'income_all', dataType = FloatType(), nullable = True),
StructField (name = 'income_accepted', dataType = FloatType(), nullable = True),
StructField (name = 'income_percent', dataType = FloatType(), nullable = True),
StructField (name = 'outcome_all', dataType = FloatType(), nullable = True),
StructField (name = 'outcome_accepted', dataType = FloatType(), nullable = True),
StructField (name = 'outcome_precent', dataType = FloatType(), nullable = True),
StructField (name = 'income_outcome', dataType = FloatType(), nullable = True)
])