You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/08/26 09:11:12 UTC

[GitHub] [arrow-datafusion] preetijoshi-womply opened a new issue #949: Creating dataframe with Recordbatch using pyarrow.Table.to_batches gives schema error

preetijoshi-womply opened a new issue #949:
URL: https://github.com/apache/arrow-datafusion/issues/949


   **Describe the bug**
   I want to create a datafusion dataframe using an in memory pyarrow table. But while doing so i am getting schema error.
   
   **To Reproduce**
   import datafusion
   import pyarrow as pa
   import pyarrow.dataset as ds
   
   ctx = datafusion.ExecutionContext()
   <.....code to get the pyarrow table>
   batches = pa_table.to_batches()
   ctx.create_dataframe(batches[0])
   
   Error : AttributeError: 'pyarrow.lib.StringScalar' object has no attribute 'schema'
   
   
   **Expected behavior**
   A dataframe should be created
   
   **Additional context**
   pa_table.schema gives the following:
   "col1: string
   col2: string
   date_col: date32[day]
   -- schema metadata --
   org.apache.spark.version: '3.0.1'
   org.apache.spark.sql.parquet.row.metadata: '{"type":"struct","fields":[{"' + 546"
   


-- 
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: github-unsubscribe@arrow.apache.org

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