cho2hhun opened a new issue, #1225:
URL: https://github.com/apache/age/issues/1225

   **Problem and My comments**
   
   - 'agtype' cannot cast to other Data Type
   
   1. 'agtype' cannot cast to string like 'text'. It could only cast to 
'varchar'
   - the error for casting to 'text from 'agtype' is like that
   ```
   ERROR:  agtype argument must resolve to a scalar value
   ```
   actually it don't matter to casting other string data type.
   but I Think the user who tring to use AGE initially could confused by cating 
'agtype' to string data type, and it could takes lots of time to recognize that 
'agtype' can only cast to 'varchar' among string data type.
   
   3. 'agtype' cannot cast to 'json' or 'jsonb', it is casted to json or jsonb 
but only written as one string for objects in brace({})
   - Of course 'agtype' could extract the objects values from agtype column 
like ```select json_key ->> 'json_value'``` like 'jsonb' in PG
   but The matter is that it is read as string in Python, Java enviroments. So 
I couldn't help casting string(from agtype) to json in Python, Java enviroments.
   - I've tried many PG functions which convert json data type like 
'to_json()', 'to_jsonb()', but it is only read just ONE STRING
   - the method that I've devised was first casting to 'varchar' string and use 
**regular expression** to get rid off unnecessary escape, and then casting to 
jsonb using 'to_jsonb()' function
   the problem is that we've got to face one more unnecessary casting ; 
'varchar' for casting to json, so compare to json casting in Python Java, the 
method i mentioned above is more efficient, but still have one more unnecessary 
casting.
   So, If you guys knows any casting method for agtype to json then please let 
me know and share it!
   
   
   **Environment (please complete the following information):**
   - Version: 13
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to