You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/01 13:51:28 UTC

[GitHub] [spark] wangyum commented on a change in pull request #31920: [SPARK-33604][SQL] Group exception messages in sql/execution

wangyum commented on a change in pull request #31920:
URL: https://github.com/apache/spark/pull/31920#discussion_r605674802



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1087,4 +1087,42 @@ private[spark] object QueryCompilationErrors {
   def cannotConvertDataTypeToParquetTypeError(field: StructField): Throwable = {
     new AnalysisException(s"Unsupported data type ${field.dataType.catalogString}")
   }
+
+  def groupAggPandasUDFUnsupportedByStreamingAggError(): Throwable = {
+    new AnalysisException("Streaming aggregation doesn't support group aggregate pandas UDF")
+  }
+
+  def streamJoinStreamWithoutEqualityPredicateUnsupportedError(plan: LogicalPlan): Throwable = {
+    new AnalysisException(
+      "Stream-stream join without equality predicate is not supported", plan = Some(plan))
+  }
+
+  def cannotUseMixtureOfAggFunctionAndGroupAggPandasUDFError(): Throwable = {
+    new AnalysisException(
+      "Cannot use a mixture of aggregate function and group aggregate pandas UDF")
+  }
+
+  def ambiguousAttributesInSelfJoinError(
+      ambiguousAttrs: Seq[AttributeReference]): Throwable = {
+    new AnalysisException(
+      s"""
+         |Column ${ambiguousAttrs.mkString(", ")} are ambiguous. It's probably because
+         |you joined several Datasets together, and some of these Datasets are the same.
+         |This column points to one of the Datasets but Spark is unable to figure out
+         |which one. Please alias the Datasets with different names via `Dataset.as`
+         |before joining them, and specify the column using qualified name, e.g.
+         |`df.as("a").join(df.as("b"), $$"a.id" > $$"b.id")`. You can also set
+         |${SQLConf.FAIL_AMBIGUOUS_SELF_JOIN_ENABLED.key} to false to disable this check.
+       """.stripMargin.replaceAll("\n", " "))
+  }
+
+  def unexpectedEvalTypesForUDFsError(evalTypes: Set[Int]): Throwable = {
+    new AnalysisException(
+      s"Expected udfs have the same evalType but got different evalTypes: " +

Review comment:
       Do not need `s`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org