aboutsummaryrefslogtreecommitdiff
path: root/graphx
diff options
context:
space:
mode:
authorHerman van Hovell <hvanhovell@databricks.com>2016-09-01 12:01:22 -0700
committerJosh Rosen <joshrosen@databricks.com>2016-09-01 12:01:22 -0700
commit2be5f8d7e0819de03971d0af6fa310793d2d0e65 (patch)
tree602c660b7215536f901af5cc729664a5f0b4cf49 /graphx
parenta0aac4b775bc8c275f96ad0fbf85c9d8a3690588 (diff)
downloadspark-2be5f8d7e0819de03971d0af6fa310793d2d0e65.tar.gz
spark-2be5f8d7e0819de03971d0af6fa310793d2d0e65.tar.bz2
spark-2be5f8d7e0819de03971d0af6fa310793d2d0e65.zip
[SPARK-17263][SQL] Add hexadecimal literal parsing
## What changes were proposed in this pull request? This PR adds the ability to parse SQL (hexadecimal) binary literals (AKA bit strings). It follows the following syntax `X'[Hexadecimal Characters]+'`, for example: `X'01AB'` would create a binary the following binary array `0x01AB`. If an uneven number of hexadecimal characters is passed, then the upper 4 bits of the initial byte are kept empty, and the lower 4 bits are filled using the first character. For example `X'1C7'` would create the following binary array `0x01C7`. Binary data (Array[Byte]) does not have a proper `hashCode` and `equals` functions. This meant that comparing `Literal`s containing binary data was a pain. I have updated Literal.hashCode and Literal.equals to deal properly with binary data. ## How was this patch tested? Added tests to the `ExpressionParserSuite`, `SQLQueryTestSuite` and `ExpressionSQLBuilderSuite`. Author: Herman van Hovell <hvanhovell@databricks.com> Closes #14832 from hvanhovell/SPARK-17263.
Diffstat (limited to 'graphx')
0 files changed, 0 insertions, 0 deletions