lxhoang97 opened a new issue #8978: Error when run query from SQL Lab using 
json_agg/json_build_object
URL: https://github.com/apache/incubator-superset/issues/8978
 
 
   A clear and concise description of what the bug is.
   I need to run some query using json_agg/json_build_object in Postgres 
database, but I got an error
   `pyarrow.lib.ArrowNotImplementedError: Not implemented type for list in 
DataFrameBlock: struct<column_name: string, type: string>`
   
   My query: 
   
   > WITH sample AS (
           SELECT database_id, table_name, '' as column_name, '' as type FROM 
tables
           UNION
           SELECT tables.database_id, tables.table_name, 
table_columns.column_name, table_columns.type
           FROM tables, table_columns
           WHERE tables.id=table_columns.table_id)
                SELECT database_id, table_name, 
json_agg(json_build_object('column_name',column_name, 'type', type)) as 
column_info 
                FROM sample group by database_id, table_name
   
   ### Error details:
   
   >ERROR:superset.sql_lab:Query 11: Not implemented type for list in 
DataFrameBlock: struct<column_name: string, type: string>
   Traceback (most recent call last):
     File "/app/superset/sql_lab.py", line 170, in get_sql_results
       log_params=log_params,
     File "/app/superset/sql_lab.py", line 391, in execute_sql_statements
       expand_data,
     File "/app/superset/sql_lab.py", line 291, in _serialize_and_expand_data
       df = result_set.to_pandas_df()
     File "/app/superset/result_set.py", line 152, in to_pandas_df
       return self.convert_table_to_df(self.table)
     File "/app/superset/result_set.py", line 129, in convert_table_to_df
       return table.to_pandas(integer_object_nulls=True)
     File "pyarrow/array.pxi", line 468, in 
pyarrow.lib._PandasConvertible.to_pandas
     File "pyarrow/table.pxi", line 1238, in pyarrow.lib.Table._to_pandas
     File "/usr/local/lib/python3.6/site-packages/pyarrow/pandas_compat.py", 
line 704, in table_to_blockmanager
       blocks = _table_to_blocks(options, table, categories)
     File "/usr/local/lib/python3.6/site-packages/pyarrow/pandas_compat.py", 
line 976, in _table_to_blocks
       result = pa.lib.table_to_blocks(options, block_table, categories)
     File "pyarrow/table.pxi", line 780, in pyarrow.lib.table_to_blocks
     File "pyarrow/error.pxi", line 86, in pyarrow.lib.check_status
   pyarrow.lib.ArrowNotImplementedError: Not implemented type for list in 
DataFrameBlock: struct<column_name: string, type: string>
    
   
   #### Screenshots
   
![image](https://user-images.githubusercontent.com/52392577/72510123-726b7800-387b-11ea-88f8-66a0b8fa3680.png)
   
   
   ### Environment
   
   (please complete the following information):
   
   - git branch: master
   - env: Docker

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to