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

[Rust][DataFusion] More ergonomic conversion between Schema, SchemaRef, DFSchema, and DFSchemaRef

    XMLWordPrintableJSON

Details

    Description

      https://github.com/apache/arrow/pull/8839 added a DFSchema wrapper object into DataFusion so we can represent multiple relations (e.g. tables) easily

      However, it is somewhat annyoing to use now (as I discovered while trying to update IOx to use the latest version of Arrow).

      Specifically, there are things like this:
      ```
      Arc::new(DFSchema::from(&parquet.schema())?),
      ```
      Instead I would like to be able to write

      ```
      parquet.schema().try_into()?
      ```

      There are several other conversions I would like to be able to use the standard Rust into or `try_into` for:

      Schema -> DFSchema
      Schema -> Arc<DFSchema>
      Arc<Schema> -> DFSchema
      Arc<Schema> -> Arc<DFSchema>

      DFSchema -> Schema
      DFSchema -> Arc<Schema>
      Arc<DFSchema> -> Schema
      Arc<DFSchema> -> Arc<Schema>

      Attachments

        Issue Links

          Activity

            People

              alamb Andrew Lamb
              alamb Andrew Lamb
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 40m
                  1h 40m