get datatype of column using pyspark

前端 未结 6 419
野的像风
野的像风 2021-01-31 15:58

We are reading data from MongoDB Collection. Collection column has two different values (e.g.: (bson.Int64,int) (int,float) ).

I a

6条回答
  •  清歌不尽
    2021-01-31 16:33

    I am assuming you are looking to get the data type of the data you read.

    input_data = [Read from Mongo DB operation]

    You can use

    type(input_data) 
    

    to inspect the data type

提交回复
热议问题