[ https://issues.apache.org/jira/browse/SPARK-36757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17419386#comment-17419386 ]
Paul Deng commented on SPARK-36757: ----------------------------------- Just adding that this behavior also occurs when called via scala without using the `_jc` private property. {code:bash} scala> countDistinct("foo").toString() res1: String = count(foo) scala> countDistinct("foo") res2: org.apache.spark.sql.Column = count(foo) {code} > countDistinct becomes count when converted to SQL string > -------------------------------------------------------- > > Key: SPARK-36757 > URL: https://issues.apache.org/jira/browse/SPARK-36757 > Project: Spark > Issue Type: Bug > Components: SQL > Affects Versions: 3.1.1 > Reporter: Paul Deng > Priority: Major > Original Estimate: 24h > Remaining Estimate: 24h > > In pyspark=3.1.1 > {code:python} > > F.countDistinct(F.col("bar")) > Column<'count(bar)'>{code} > > In pyspark=2.4 > {code:python} > > F.countDistinct(F.col("bar")) > Column<b'count(DISTINCT foo)'>{code} > > This creates problems when trying to convert the pyspark function into SQL > code to compose SQL queries via: > {code:python} > > F.countDistinct(F.col("bar"))._jc.toString() > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org