[ https://issues.apache.org/jira/browse/PHOENIX-6764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Istvan Toth updated PHOENIX-6764: --------------------------------- Description: Currently there is no sane way to specify arbitrary binary and varbinary values in the query string. They can be set as variables for preparedstatements, and if the length corresponds to an existing type, then some casting gymnastics can be used to work around the problem, but I have not found a way to write a query that upserts an arbitrary three byte value into a binary/varbinary. The SQL standard defines Binary and Hex literals in the form of B'01010101001...' and X'0102AAF5...' Implement this in the parser. EDIT: The ENCODE()/DECODE() functions provide similar functionality, and are available in pre-5.2 Phoenix versions. was: Currently there is no sane way to specify arbitrary binary and varbinary values in the query string. They can be set as variables for preparedstatements, and if the length corresponds to an existing type, then some casting gymnastics can be used to work around the problem, but I have not found a way to write a query that upserts an arbitrary three byte value into a binary/varbinary. The SQL standard defines Binary and Hex literals in the form of B'01010101001...' and X'0102AAF5...' Implement this in the parser. > Implement Binary and Hexadecimal literals > ----------------------------------------- > > Key: PHOENIX-6764 > URL: https://issues.apache.org/jira/browse/PHOENIX-6764 > Project: Phoenix > Issue Type: Bug > Components: core > Environment: Phoenix now supports binary string literals as defined > by the SQL standard: X'AF23' for hexadecimal literals, and > B'0101011100100010' for binary literals. > Binary values in explain statements are now returned in the above format. > getString() for BINARY type results now use the same formatting as the > VARBINARY type. > Reporter: Istvan Toth > Assignee: Istvan Toth > Priority: Major > Fix For: 5.2.0 > > > Currently there is no sane way to specify arbitrary binary and varbinary > values in the query string. > They can be set as variables for preparedstatements, and if the length > corresponds to an existing type, then some casting gymnastics can be used to > work around the problem, but I have not found a way to write a query that > upserts an arbitrary three byte value into a binary/varbinary. > The SQL standard defines Binary and Hex literals in the form of > B'01010101001...' and X'0102AAF5...' > Implement this in the parser. > EDIT: > The ENCODE()/DECODE() functions provide similar functionality, and are > available in pre-5.2 Phoenix versions. -- This message was sent by Atlassian Jira (v8.20.10#820010)