francis-du opened a new issue #941:
URL: https://github.com/apache/arrow-datafusion/issues/941


   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for 
this feature, in addition to  the *what*)
   
   The current user who wants to preview the API of the DataFrame need to  use 
the `print` function to print the result without limit after the `collect`. The 
printing result is very unfriendly. It is hoped that the user can print and 
preview the result of the DataFrame by calling one function.
   
   ```python
   import pyarrow as pa
   from datafusion import ExecutionContext
   
   ctx = ExecutionContext()
   
   batch = pa.RecordBatch.from_arrays(
       [pa.array([1, 2, 3]), pa.array([4, 5, 6])],
       names=["a", "b"],
   )
   
   df = ctx.create_dataframe([[batch]])
   for i in df.collect():
       for j in i:
           print(j)
   ```
   
   Result
   
   ```
   [
     1,
     2,
     3
   ]
   [
     4,
     5,
     6
   ]
   ```
   
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   
   Let the user call the `show` function to print and preview the results, the 
user can customize the number of displayed lines, if not specified, 20 lines 
will be displayed by default.
   
   eg:
   
   ```python
   import pyarrow as pa
   from datafusion import ExecutionContext
   
   ctx = ExecutionContext()
   
   batch = pa.RecordBatch.from_arrays(
       [pa.array([1, 2, 3]), pa.array([4, 5, 6])],
       names=["a", "b"],
   )
   
   df = ctx.create_dataframe([[batch]])
   df.show()
   
   ```
   
   Result
   
   ```
   +---+---+
   | a | b |
   +---+---+
   | 1 | 4 |
   | 2 | 5 |
   | 3 | 6 |
   +---+---+
   
   ```
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features 
you've considered.
   
   **Additional context**
   Add any other context or screenshots about the feature request here.
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to