You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/09/17 20:22:58 UTC

[GitHub] [incubator-superset] khtruong commented on a change in pull request #8233: Simplify and improve `expand_data` in Presto

khtruong commented on a change in pull request #8233: Simplify and improve `expand_data` in Presto
URL: https://github.com/apache/incubator-superset/pull/8233#discussion_r325309653
 
 

 ##########
 File path: superset/db_engine_specs/presto.py
 ##########
 @@ -40,6 +40,51 @@
 QueryStatus = utils.QueryStatus
 
 
+def get_children(column: Dict[str, str]) -> List[Dict[str, str]]:
+    """
+    Get the children of a complex Presto type (row or array).
+
+    For arrays, we return a single list with the base type:
+
+        >>> get_children(dict(name="a", type="ARRAY(BIGINT)"))
+        [{"name": "a", "type": "BIGINT"}]
+
+    For rows, we return a list of the columns:
+
+        >>> get_children(dict(name="a", type="ROW(BIGINT,FOO VARCHAR)"))
 
 Review comment:
   This is more for my understanding than a PR comment. I thought each row has a variable name before the type. For example `ROW(FOO BIGINT, BAR VARCHAR)`. When will there be a nameless column again?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org