I want to join two dataframes based on the following condition: if df1.col("name")== df2.col("name") and df1.col("starttime") is greater than df2.col("starttime").
the first part of the condition is ok, I use "equal" method of the column class in spark sql, but for the "greater than" condition, when I use the following syntax in java":
df1.col("starttime").gt(df2.col("starttime"))
It does not work, It seems "gt" function of column in spark sql, only accepts numerical value types, it does not work properly when you pass column type as its input parameter. The program finishes normally but the results are wrong, it does not find any rows in the dataframe that satisfy my condition, while I know that such rows exist in the dataframe.
any idea on how should I implement comparison between two column types in spark sql?(e.g. if one column is greater than other column in another dataframe)