Viraj Jasani created PHOENIX-7396:
-------------------------------------
Summary: BSON_VALUE function to retrieve BSON field value with
given data type
Key: PHOENIX-7396
URL: https://issues.apache.org/jira/browse/PHOENIX-7396
Project: Phoenix
Issue Type: New Feature
Reporter: Viraj Jasani
The purpose of this Jira is to introduce new function for BSON data type to
retrieve the value of the given Bson Document field key. The function should
also take data type as an argument to decode the document field value.
h2. *Function Grammar:*
*Name:* BSON_VALUE
*Arguments:*
| |*Expression*|*DataType*|
|1|Column Value|BSON|
|2|Bson Field Key|The field key can represent any top level or nested fields
within the document. The caller should use "." notation for accessing nested
document elements and "[n]" notation for accessing nested array elements.
Unlike nested fields, top level document fields do not require any additional
character.|
|3|SQL Data Type|The data type that the client expects the value of the field
to be converted to while returning the value.|
*Definition:* The function returns the value of the given field key from the
BSON Document. The client is expected to provide the data type that is used for
decoding the value of the field key.
*Return Type:* PDataType (Depending on the third argument of the function, the
data type conversion takes place)
*Examples:*
* BSON_VALUE(COL, 'topfield', 'DOUBLE')
* BSON_VALUE(COL, 'topfield.nestedfield1', 'VARCHAR')
* BSON_VALUE(COL, 'topfield.nestedfield[2]', 'INTEGER')
Here, COL represents the column name of data type BSON.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)