You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "jiasheng55 (Jira)" <ji...@apache.org> on 2021/11/19 08:00:00 UTC

[jira] [Commented] (SPARK-37382) `with as` clause got inconsistent results

    [ https://issues.apache.org/jira/browse/SPARK-37382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446344#comment-17446344 ] 

jiasheng55 commented on SPARK-37382:
------------------------------------

The imsages are broken, please have a look:)

> `with as` clause got inconsistent results
> -----------------------------------------
>
>                 Key: SPARK-37382
>                 URL: https://issues.apache.org/jira/browse/SPARK-37382
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.1.2
>            Reporter: caican
>            Priority: Major
>
> In Spark3.1, the `with as` clause in the same SQL is executed multiple times,  got different results
> `
> with tab as (
>  select 'Withas' as name, rand() as rand_number
> )
> select name, rand_number
> from tab
> union all
> select name, rand_number
> from tab
> `
> !https://internal-api-lark-file.f.mioffice.cn/api/image/keys/img_bcf6f867-6aee-4afe-bc43-30bf4f2dbdel?message_id=7032102765711097965!
> But In spark2.3, it got consistent results
> `
> with tab as (
>  select 'Withas' as name, rand() as rand_number
> )
> select name, rand_number
> from tab
> union all
> select name, rand_number
> from tab
> `
> !https://internal-api-lark-file.f.mioffice.cn/api/image/keys/img_6dc6e44b-d4a5-4b0d-bd2c-00859ec80a1l?message_id=7032104202756751468!
> Why does Spark3.1.2 return different results?
> Has anyone encountered this problem?



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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