Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

tableFromIPC incorrectly types columns in schema when there are duplicate column names

Open
#288 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
data

Research direction

Start by reproducing the issue with the supplied base64 Arrow IPC data and the tableFromIPC entry point. Compare the returned schema with getChildAt(i).type for duplicate id columns, using the pyarrow output as the expected result. Done means the two duplicate fields retain their individual types in the table schema.

Written by the indexing model from the issue text.

Description

Describe the bug, including details regarding any error messages, version, and platform.

Version: apache-arrow@21.0.0 (also tested and noticed the issue in 17.0.0)
I have a use case where I have an arrow file that has two columns with the same name, but different types. In this example, there are two "id" columns, but one is an Int while the other is a string.
When I load this arrow file using tableFromIPC, the table schema marks both columns as strings.
Simple base64 arrow file used in this example:

/////7ABAAAQAAAAAAAKAA4ABgANAAgACgAAAAAABAAQAAAAAAEKAAwAAAAIAAQACgAAAAgAAAAIAAAAAAAAAAIAAADAAAAABAAAAFr///8UAAAAiAAAAIwAAAAAAAAFiAAAAAIAAABAAAAABAAAABT///8IAAAAFAAAAAgAAAAic3RyaW5nIgAAAAAXAAAAU3Bhcms6RGF0YVR5cGU6SnNvblR5cGUATP///wgAAAAQAAAABgAAAFNUUklORwAAFgAAAFNwYXJrOkRhdGFUeXBlOlNxbE5hbWUAAAAAAAAEAAQABAAAAAIAAABpZAAAAAASABgAFAAAABMADAAAAAgABAASAAAAFAAAAIwAAACUAAAAAAAAApgAAAACAAAARAAAAAQAAADM////CAAAABAAAAAGAAAAImxvbmciAAAXAAAAU3Bhcms6RGF0YVR5cGU6SnNvblR5cGUACAAMAAgABAAIAAAACAAAABAAAAAGAAAAQklHSU5UAAAWAAAAU3Bhcms6RGF0YVR5cGU6U3FsTmFtZQAAAAAAAAgADAAIAAcACAAAAAAAAAFAAAAAAgAAAGlkAAD/////yAAAABQAAAAAAAAADAAWAAYABQAIAAwADAAAAAADBAAYAAAAKAAAAAAAAAAAAAoAGAAMAAQACAAKAAAAbAAAABAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAQAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAAIAAAAAAAAACAAAAAAAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAIAAAAxMAAAAAAAAP////8AAAAA

Below are the details of the Table object returned by tableFromIPC. Notice how in the schema, both id columns are marked as Utf8, but the column details show the difference in column types.

=== Arrow Table Information ===
Rows: 1
Columns: 2
Schema: Schema<{ 0: id: Utf8, 1: id: Utf8 }>
=== Table Contents ===
[
  {"id": 0, "id": "10"}
]
=== Column Details ===
Column 0: undefined (Int64)
Column 1: undefined (Utf8)
Code to generate the above result
const arrowBuffer = base64ToUint8Array(base64String);
// Parse the Arrow IPC data into a table
const table = tableFromIPC(arrowBuffer);
console.log('\n=== Arrow Table Information ===');
console.log(`Rows: ${table.numRows}`);
console.log(`Columns: ${table.numCols}`);
console.log(`Schema: ${table.schema}`);
console.log('\n=== Table Contents ===');
console.log(table.toString());
console.log('\n=== Column Details ===');
for (let i = 0; i < table.numCols; i++) {
  const column = table.getChildAt(i);
  console.log(`Column ${i}: ${column.name} (${column.type})`);
}

I have tested this same arrow file with pyarrow, and it shows the expected result:

Schema:
 id: int64 not null
  -- field metadata --
  Spark:DataType:SqlName: 'BIGINT'
  Spark:DataType:JsonType: '"long"'
id: string not null
  -- field metadata --
  Spark:DataType:SqlName: 'STRING'
  Spark:DataType:JsonType: '"string"'
Batch 0:
pyarrow.RecordBatch
id: int64 not null
id: string not null
----
id: [0]
id: ["10"]
Dominant language
TypeScript
Stars
112
Forks
23
Avg merge
17h 55m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-js

All issues in apache/arrow-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.