Home > Mobile >  pyspark get different varchar printSchema()
pyspark get different varchar printSchema()

Time:02-16

From spark dataframe when I run df.printSchema() all varchar(1), varchar(10), etc... becomes string Is there a way to differentiate varchars?

Doesn't have to be in pyspark. method to do it in spark sql is welcome as well.

CodePudding user response:

VarcharType(length) can only be used in table schema, not functions/operators. This means you can use it in create table sql, but not dataFrame schema.

  • Related