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

[JS] Construct tables from JavaScript types

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Implemented
    • None
    • 7.0.0
    • JavaScript
    • None

    Description

      Right now, Arrow has no automatic type inference for JavaScript types, so I think we would need to add that.

      // Convert from JS types automatically
      const t = Arrow.Table.from({
      	Country: ["USA", "Canada", "Mexico"],
      	GDP: [123, 234, 345],
      })
      
      // I'd also like Arrow to support other common JS table formats:
      const t = Arrow.Table.from([
      	{Country: "USA", GDP: 123},
      	{Country: "Canada", GDP: 234},
      	{Country: "Mexico", GDP: 345},
      ])
      
      const t = Arrow.Table.from([
      	["Country", "GDP"],
      	["USA", 123],
      	["Canada", 234],
      	["Mexico", 345],
      ])
      

      Thanks to Thiago for the suggestions!

      Attachments

        Issue Links

          Activity

            People

              domoritz Dominik Moritz
              domoritz Dominik Moritz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Slack

                  Issue deployment