Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Incomplete
-
2.3.1
-
None
Description
When i am trying to multiply calender interval with long/int , I am getting below error. The same syntax is supported in Postgres.
spark.sql("select interval '1' day * 3").show()
org.apache.spark.sql.AnalysisException: cannot resolve '(3 * interval 1 days)' due to data type mismatch: differing types in '(interval 1 days) * 3' (int and calendarinterval).; line 1 pos 7;
'Project [unresolvedalias((interval 1 days * 3) , None)]
+- OneRowRelation
at org.apache.spark.sql.catalyst.analysis.package$AnalysisErrorAt.failAnalysis(package.scala:42)
at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:93)
at org.apache.spark.sql.catalyst.analysis.CheckAnalysis$$anonfun$checkAnalysis$1$$anonfun$apply$2.applyOrElse(CheckAnalysis.scala:85)
at org.apache.spark.sql.catalyst.trees.TreeNode$$anonfun$transformUp$1.apply(TreeNode.scala:289)