'Can't extract value from SHP_DT_YYYYMM#12442: need struct type but got timestamp
I'm trying to filter data for year = 2010 on a Pyspark DF.
DF
DataFrame[LANE: string, PRODUCT: string, SHP_DT_YYYYMM: timestamp]
DF.filter(DF.SHP_DT_YYYYMM.year == 2010)
I'm getting error as:
AnalysisException: Can't extract value from SHP_DT_YYYYMM#12442: need struct type but got timestamp
I came across a lot of similar questions, but I'm unable to get the root cause for such an error.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
