Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-15652

[C++] GDB plugin printer gives error with extension type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.0.0
    • C++

    Description

      Copying the example from ARROW-9078

      import pyarrow as pa
      import pyarrow.parquet as pq
      
      
      class MyStructType(pa.PyExtensionType): 
       
          def __init__(self): 
              pa.PyExtensionType.__init__(self, pa.struct([('left', pa.int64()), ('right', pa.int64())])) 
       
          def __reduce__(self): 
              return MyStructType, () 
      
      
      struct_array = pa.StructArray.from_arrays(
          [
              pa.array([0, 1], type="int64", from_pandas=True),
              pa.array([1, 2], type="int64", from_pandas=True),
          ],
          names=["left", "right"],
      )
      
      mystruct_array = pa.ExtensionArray.from_storage(MyStructType(), struct_array)
      table = pa.table({'a': mystruct_array})
      pq.write_table(table, "test_struct.parquet")
      

      What I was doing is then reading the table back in, with a breakpoint at ApplyOriginalMetadata. But I suppose any other way to get into the debugger is fine as well (and maybe also with a simpler extension type, i.e. not with a struct type as storage type, I didn't yet try that).

      This gives:

      (gdb) p origin_field
      $3 = (const arrow::Field &) @0x555bbb308190: Python Exception <class 'gdb.error'> A syntax error in expression, near `) (0x555bbb277020)).ToString()'.: 
      arrow::field("a", )
      

      for the field/type being extension type

      cc apitrou

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              jorisvandenbossche Joris Van den Bossche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m