GitHub user tarekauel opened a pull request:
https://github.com/apache/spark/pull/7178
[SPARK-8223][SPARK-8224][SQL] shift left and shift right
Jira:
https://issues.apache.org/jira/browse/SPARK-8223
https://issues.apache.org/jira/browse/SPARK-8224
I am aware of #7174 and will update this pr, if it's merged.
I don't know if #7034 can simplify this, but we can have a look on it, if
it gets merged
@rxin In the Jira ticket the function as no second argument. I added a
`numBits` argument that allows to specify the number of bits. I guess this
improves the usability. I wanted to add `shiftleft(value)` as well, but the
`selectExpr` dataframe tests crashes, if I have both. I order to do this, I
added the following to the functions.scala `def shiftRight(e: Column): Column =
ShiftRight(e.expr, lit(1).expr)`, but as I mentioned this doesn't pass tests
like `df.selectExpr("shiftRight(a)", ...` (not enough arguments exception).
If we need the bitwise shift in order to be hive compatible, I suggest to
add `shiftLeft` and something like `shiftLeftX`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tarekauel/spark 8223
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/7178.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #7178
----
commit ac7fe9d85ba8594b1c3ed8d8b911b95e1670e468
Author: Tarek Auel <[email protected]>
Date: 2015-07-02T04:05:51Z
[SPARK-8223][SPARK-8224] right and left bit shift
commit 44ee324f4a3494bba9d98eb0754291a794617032
Author: Tarek Auel <[email protected]>
Date: 2015-07-02T04:10:15Z
[SPARK-8223][SPARK-8224] docu fix
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]