Skip to content

Conversation

@bkietz
Copy link
Member

@bkietz bkietz commented Sep 3, 2019

JS can't represent all 64 bit integers as numbers (which are doubles), so store them in the JSON IPC as strings instead.

@bkietz bkietz force-pushed the 6310-Write-64-bit-integers-as- branch from cdfe299 to 8318e9e Compare September 9, 2019 16:42
@pitrou
Copy link
Member

pitrou commented Sep 10, 2019

You'll probably need to change the Java side as well (and perhaps Go). Maybe @emkornfield can help.

Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to set up an integration branch for this work



class IntegerType(PrimitiveType):
class Column(PrimitiveColumn):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't very idiomatic to declare nested classes, this should be IntegerColumn at the top level

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

(std::is_same<UInt8Type, T>::value || std::is_same<Int8Type, T>::value);
};

template <typename T, typename CType = void>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should put this in json_internal.cc unless we anticipate using it elsewhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think IsSignedInt etc should be removed in favor of this trait or one like it (though it should probably be renamed).

IsSignedInt takes either an array or a type as a type argument, which is surprisingly atypical for traits. Furthermore whereas is_signed_integer returns false for date and other types which are represented by but not identical to integers IsSignedInt returns true by checking only the c_type, which leads to static_assert(IsSignedInt<HalfFloatType>::value, ""). Finally the declaration of IsSignedInt is far from readable due to nested macro usage

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wesm
Copy link
Member

wesm commented Sep 10, 2019

@bkietz
Copy link
Member Author

bkietz commented Sep 10, 2019

Java side seems to have been addressed already: #5002

@wesm wesm changed the base branch from master to ARROW-6512-integration-64bit-integers September 11, 2019 00:48
Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. I changed the base to an integration branch where we can address the Go and JS side of this before merging into master

wesm pushed a commit that referenced this pull request Sep 11, 2019
JS can't represent all 64 bit integers as numbers (which are doubles), so store them in the JSON IPC as strings instead.

Closes #5267 from bkietz/6310-Write-64-bit-integers-as- and squashes the following commits:

09b6a94 <Benjamin Kietzman> de-nest IntegerColumn
8318e9e <Benjamin Kietzman> rewrite integration/integration_test.py to generate int64 cols as strings
121dee1 <Benjamin Kietzman> use std::to_string
a5cd719 <Benjamin Kietzman> ipc json should use strings for 64 bit ints

Authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
@wesm wesm closed this Sep 11, 2019
fsaintjacques pushed a commit that referenced this pull request Jun 4, 2020
Some 64 bit integer values are not representable as JSON numbers, so store these as strings.

This is issue is a regression; original fix was #5267

Closes #7292 from bkietz/8471-Regression-to-uint64-as-J

Authored-by: Benjamin Kietzman <bengilgit@gmail.com>
Signed-off-by: François Saint-Jacques <fsaintjacques@gmail.com>
@wesm
Copy link
Member

wesm commented Jun 5, 2020

@bkietz bkietz deleted the 6310-Write-64-bit-integers-as- branch February 25, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants