[ 
https://issues.apache.org/jira/browse/PHOENIX-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14512204#comment-14512204
 ] 

ASF GitHub Bot commented on PHOENIX-628:
----------------------------------------

Github user AakashPradeep commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/76#discussion_r29097048
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/schema/types/PDataType.java ---
    @@ -1144,17 +1144,18 @@ public static PDataType fromLiteral(Object value) {
           return null;
         }
         for (PDataType type : PDataType.values()) {
    -      if (type.isArrayType()) {
    -        PhoenixArray arr = (PhoenixArray) value;
    -        if ((type.getSqlType() == arr.baseType.sqlType + 
PDataType.ARRAY_TYPE_BASE)
    -            && type.getJavaClass().isInstance(value)) {
    -          return type;
    -        }
    -      } else {
    -        if (type.getJavaClass().isInstance(value)) {
    -          return type;
    -        }
    -      }
    +           if (type.isArrayType() && 
type.getJavaClass().isInstance(value)) {
    --- End diff --
    
    @twdsilva , your placement of isInstance() is good since in current case if 
it is of Array type but not compatible class then it will call isInstance() 
twice (once in if () + once in else part )  whereas in your case it will be 
called only once. 


> Support native JSON data type
> -----------------------------
>
>                 Key: PHOENIX-628
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-628
>             Project: Phoenix
>          Issue Type: Task
>    Affects Versions: 4.4.0
>            Reporter: James Taylor
>            Assignee: Aakash Pradeep
>              Labels: JSON, Java, SQL
>             Fix For: 4.4.0
>
>
> MongoDB and PostGres do some interesting things with JSON. We should look at 
> adding similar support. For a detailed description, see JSONB support in 
> Postgres: 
> http://www.craigkerstiens.com/2014/03/24/Postgres-9.4-Looking-up
> http://www.depesz.com/2014/03/25/waiting-for-9-4-introduce-jsonb-a-structured-format-for-storing-json/
> http://michael.otacoo.com/postgresql-2/manipulating-jsonb-data-with-key-unique/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to