You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "voidstar69 (via GitHub)" <gi...@apache.org> on 2023/07/19 21:57:14 UTC

[GitHub] [arrow] voidstar69 commented on pull request #36566: GH-30717: [C#] Add ToString() methods to Arrow classes

voidstar69 commented on PR #36566:
URL: https://github.com/apache/arrow/pull/36566#issuecomment-1642811256

   > These are helpful but I don't know if they address the heart of the issue. My guess is the issue was asking for some kind of pretty printing support. Do you want to perhaps add a follow-up issue for actual table-printing support? For example, here is what the "to string" looks like in various other implementations:
   > 
   > ### Python:
   > ```
   > pyarrow.Table
   > strings: string
   > ints: int32
   > floats: float
   > ----
   > strings: [["one","two","three","four","five"]]
   > ints: [[1,2,3,4,5]]
   > floats: [[1,2,3,4,5]]
   > ```
   > 
   > ### C++
   > ```
   > strings: string
   > ints: int32
   > floats: float
   > ----
   > strings:
   >   [
   >     [
   >       "one",
   >       "two",
   >       "three",
   >       "four",
   >       "five"
   >     ]
   >   ]
   > ints:
   >   [
   >     [
   >       1,
   >       2,
   >       3,
   >       4,
   >       5
   >     ]
   >   ]
   > floats:
   >   [
   >     [
   >       1,
   >       2,
   >       3,
   >       4,
   >       5
   >     ]
   >   ]
   > ```
   > 
   > ### Rust:
   > ```
   > RecordBatch { schema: Schema { fields: [Field { name: "strings", data_type: Utf8, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "ints", data_type: Int32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: "floats", data_type: Float64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {} }, columns: [StringArray
   > [
   >   "one",
   >   "two",
   >   "three",
   >   "four",
   >   "five",
   > ], PrimitiveArray<Int32>
   > [
   >   1,
   >   2,
   >   3,
   >   4,
   >   5,
   > ], PrimitiveArray<Float64>
   > [
   >   1.0,
   >   2.0,
   >   3.0,
   >   4.0,
   >   5.0,
   > ]], row_count: 5 }
   > ```
   
   I see. I thought the original issue might have been about making these types easier to comprehend in a debugger, such as in Visual Studio. There the debugger invokes `ToString` on an object, which usually returns a single line of text which the debugger then displays. I think this current PR achieves that goal, although I cannot know the intent of the original issue.
   
   I have now created issue #36777 for adding pretty printing methods. 


-- 
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