You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "csjh (via GitHub)" <gi...@apache.org> on 2023/06/29 19:04:44 UTC

[GitHub] [arrow] csjh opened a new issue, #36395: Setting value of row in table with strings truncates longer strings

csjh opened a new issue, #36395:
URL: https://github.com/apache/arrow/issues/36395

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   ```js
   const table = tableFromJSON([{ name: "Bill" }, { name: "Samantha" }]);
   table.set(0, table.get(1));
   // table.get(0).name is now "Sama"
   ```
   On version 11.0.0, MacOS 13.14
   
   I'm not 100% sure that this isn't the intended behaviour, but better safe than sorry. The behaviour I would expect is for `table.get(0)` to be identical to `table.get(1)`.
   
   ### Component(s)
   
   JavaScript


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [JS] Setting value of row in table with strings truncates longer strings [arrow]

Posted by "domoritz (via GitHub)" <gi...@apache.org>.
domoritz closed issue #36395: [JS] Setting value of row in table with strings truncates longer strings
URL: https://github.com/apache/arrow/issues/36395


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [JS] Setting value of row in table with strings truncates longer strings [arrow]

Posted by "domoritz (via GitHub)" <gi...@apache.org>.
domoritz commented on issue #36395:
URL: https://github.com/apache/arrow/issues/36395#issuecomment-1878792836

   This is a bit surprising but also expected. The memory for the variable width strings is allocated in one block so writing different content in that memory with `set` will not work correctly. In general, Arrow data structures are optimized for reading and if you need to make changes, you are better off making a new data structure. Supporting write here would mean we need to move all the memory for the strings in the vector around. 
   
   If you only have a limited number of strings, you can use a dictionary and then re-assigning a value should work. 
   
   Closing as working as expected for now. 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org