[ https://issues.apache.org/jira/browse/PHOENIX-7545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17956195#comment-17956195 ]
Viraj Jasani edited comment on PHOENIX-7545 at 6/4/25 8:57 PM: --------------------------------------------------------------- I think it would be better to use BSON_VALUE() to make things simpler. JSON_QUERY() is mostly from the JSON spec, whereas BSON functions don't have standard specs. Also, BSON_VALUE() is quite rich in functionality in comparison to JSON_VALUE() because JSON_VALUE() only supports returning value as String/VARCHAR whereas with BSON_VALUE(), client can specify the SQL data type in which they expect the function returned value. This is why specifying 'BSON' as data-type would make perfect fit. As follow up Jira to this Jira, we can also extend the support to arrays, though array's return type would not match with SQL data type (SQL expects same data type array values e.g. varchar array, integer array etc, whereas BSON array can contain any data type). was (Author: vjasani): I think it would be better to use BSON_VALUE() to make things simpler. JSON_QUERY() is mostly from the JSON spec, whereas BSON functions don't have standard specs. Also, BSON_VALUE() is quite rich in functionality in comparison to JSON_VALUE() because JSON_VALUE() only supports returning value as String/VARCHAR whereas with BSON_VALUE(), client can specify the SQL data type in which they expect the function returned value. This is why specifying 'BSON' as data-type would make perfect fit. > BSON_VALUE() to support returning sub-document > ---------------------------------------------- > > Key: PHOENIX-7545 > URL: https://issues.apache.org/jira/browse/PHOENIX-7545 > Project: Phoenix > Issue Type: Improvement > Reporter: Viraj Jasani > Assignee: Rahul Kumar > Priority: Major > Fix For: 5.3.0 > > > BSON_VALUE() function introduced with PHOENIX-7396 supports returning leaf > node document field values with scalar data type (VARCHAR, INTEGER, > VARBINARY_ENCODED, BOOLEAN etc). > As part of this Jira, we should extend this to support returning sub-document > as BSON data type. -- This message was sent by Atlassian Jira (v8.20.10#820010)