srschandan commented on issue #33394:
URL: https://github.com/apache/arrow/issues/33394#issuecomment-1789697233

   I wonder if the fix could be as simple as ignoring the type.id when 
comparing 2 dictionaries 
(https://github.com/apache/arrow/blob/87a1852d3578ecdf23e776e65bf30f0ee1f2362f/js/src/visitor/typecomparator.ts#L197).
 If two dicts are same in every other way (other than type.id which is NEVER 
the same), aren't they technically of the same type of columns? Or sub-columns? 
   In my case, I can convert nested JSON objects as complex as below to Arrow, 
when I comment it out:
   
   `
   describe('tableFromNestedJSON', () => {
       test('created a table from a nested json', () => {
           const table = tableFromJSON([
               {
                   a: 42,
                   c: 'foo',
                   d: [
                       {
                           da: 'abc',
                           dc: null,
                           dd: [1, 23, 3],
                           de: [
                               {
                                   dda: 'a',
                               }
                           ],
                       },
                       {
                           da: null,
                           dc: 45,
                           dd: [51, 3],
                           de: [
                               {
                                   dda: 'b',
                               }
                           ],
                       },
                   ],
               },
               {
                   a: 12,
                   c: 'bar',
                   d: [
                       {
                           da: 'def',
                           dc: null,
                           dd: [],
                           de: [
                               {
                                   dda: 'e',
                               }
                           ],
                       },
                       {
                           da: 'xyz',
                           dc: 76,
                           dd: [1, 2, 3],
                           de: [
                               {
                                   dda: null,
                               }
                           ],
                       },
                   ],
               },
           ]);
           expect(table.numRows).toBe(2);
           expect(table.numCols).toBe(3);
           expect(table.getChild('a')!.type).toBeInstanceOf(Float64);
           expect(table.getChild('c')!.type).toBeInstanceOf(Dictionary);
           expect(table.getChild('d')!.type).toBeInstanceOf(List);
           const list = table.getChild('d')!;
           expect(list.getChildAt(0)!.type).toBeInstanceOf(Struct);
           const struct = list.getChildAt(0)!;
           expect(struct.getChild('da')!.type).toBeInstanceOf(Dictionary);
           expect(struct.getChild('dd')!.type).toBeInstanceOf(List);
           expect(struct.getChild('dc')!.type).toBeInstanceOf(Float64);
       });
   });
   `
   
   However, I'm if this still causes the same type of failure mentioned by 
[MannySchneck] (https://github.com/MannySchneck) in 
https://github.com/apache/arrow/pull/14554#issuecomment-1298946553 since I 
could'd reproduce it myself.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to