Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for loading Apache Arrow data #11

Merged
merged 16 commits into from
Jan 26, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Better dispatch on arrow datatypes for numeric data
  • Loading branch information
nmichaud committed Jan 26, 2018
commit 97f0c2582cf2855698db3bb1b91d4eec0cdf1084
36 changes: 16 additions & 20 deletions packages/perspective/src/js/perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,29 +1045,25 @@ const perspective = {
types.push(__MODULE__.t_dtype.DTYPE_STR);
break;
case 'FloatingPoint':
switch (column.data.BYTES_PER_ELEMENT) {
case 4:
types.push(__MODULE__.t_dtype.DTYPE_FLOAT32);
break;
case 8:
types.push(__MODULE__.t_dtype.DTYPE_FLOAT64);
break;
if (column instanceof Arrow.Float64Vector) {
types.push(__MODULE__.t_dtype.DTYPE_FLOAT64);
}
else if (column instanceof Arrow.Float32Vector) {
types.push(__MODULE__.t_dtype.DTYPE_FLOAT32);
}
break;
case 'Int':
switch (column.data.BYTES_PER_ELEMENT) {
case 1:
types.push(__MODULE__.t_dtype.DTYPE_INT8);
break;
case 2:
types.push(__MODULE__.t_dtype.DTYPE_INT16);
break;
case 4:
types.push(__MODULE__.t_dtype.DTYPE_INT32);
break;
case 8:
types.push(__MODULE__.t_dtype.DTYPE_INT64);
break;
if (column instanceof Arrow.Int64Vector) {
types.push(__MODULE__.t_dtype.DTYPE_INT64);
}
else if (column instanceof Arrow.Int32Vector) {
types.push(__MODULE__.t_dtype.DTYPE_INT32);
}
else if (column instanceof Arrow.Int16Vector) {
types.push(__MODULE__.t_dtype.DTYPE_INT16);
}
else if (column instanceof Arrow.Int8Vector) {
types.push(__MODULE__.t_dtype.DTYPE_INT8);
}
break;
case 'Bool':
Expand Down