viirya commented on a change in pull request #27499: [SPARK-30590][SQL] Untyped select API cannot take typed column expression URL: https://github.com/apache/spark/pull/27499#discussion_r382897674
########## File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ########## @@ -1430,6 +1430,11 @@ class Dataset[T] private[sql]( */ @scala.annotation.varargs def select(cols: Column*): DataFrame = withPlan { + cols.find(_.isInstanceOf[TypedColumn[_, _]]).foreach { typedCol => + throw new AnalysisException(s"$typedCol is a typed column that " + + "cannot be passed in untyped `select` API. If you are going to select " + + "multiple typed columns, you can use `Dataset.selectUntyped` API.") + } Review comment: We already shipped `count` as `TypedColumn` for a while, now to change it to `Column` is a breaking change. In order to not break current usage, I think the fix is to allow feasible typed columns (e.g. `count`) in the untyped `select`. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org