我已经从 Hive 表创建了 Dataframe 并想要检索字段/列名称。
>>>a=df.schema >>>a StructType(List(StructField(empid, IntegerType, true), StructField(empname,StringType, true)))
如何从此对象中检索字段名称(empid、empname)。
schema struct apache-spark apache-spark-sql pyspark
apache-spark ×1
apache-spark-sql ×1
pyspark ×1
schema ×1
struct ×1