You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Takeshi Yamamuro (Jira)" <ji...@apache.org> on 2019/12/29 06:37:00 UTC

[jira] [Updated] (SPARK-28007) Caret operator (^) means bitwise XOR in Spark/Hive and exponentiation in Postgres/Redshift

     [ https://issues.apache.org/jira/browse/SPARK-28007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Takeshi Yamamuro updated SPARK-28007:
-------------------------------------
    Parent Issue: SPARK-30375  (was: SPARK-27764)

> Caret operator (^) means bitwise XOR in Spark/Hive and exponentiation in Postgres/Redshift
> ------------------------------------------------------------------------------------------
>
>                 Key: SPARK-28007
>                 URL: https://issues.apache.org/jira/browse/SPARK-28007
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Josh Rosen
>            Priority: Major
>
> The expression {{expr1 ^ expr2}} has different meanings in Spark and Postgres:
>  * [In Postgres|https://www.postgresql.org/docs/11/functions-math.html] and [Redshift|https://docs.aws.amazon.com/redshift/latest/dg/r_OPERATOR_SYMBOLS.html] , this returns {{expr1}} raised to the exponent {{expr2}} (additionally, the Postgres docs explicitly state that this operation is left-associative).
>  * [In Spark|https://spark.apache.org/docs/2.4.3/api/sql/index.html#_14] and [Hive|https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-ArithmeticOperators], this returns the bitwise exclusive OR of {{expr1}} and {{expr2}}.
> I'm reporting this under the Postgres compatibility umbrella. If we have SQL dialect support (e.g. a Postgres compatibility dialect), maybe this behavior could be flagged there? Alternatively, maybe we could document this in a compatibility / porting guide?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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