Skip to content

Conversation

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Aug 20, 2017

  • Reimplement Decimal128 types to use the Int128 type as the underlying integer
    representation, adapted from the Apache ORC project's C++ in memory format.
    This enables us to write integration tests and results in an in-memory
    Decimal128 format that is compatible with the Java implementation
  • Additionaly, this PR also fixes Decimal slice comparison and adds related
    regression tests
  • Follow-ups include ARROW-695 (C++ Decimal integration tests), ARROW-696 (JSON
    read/write support for decimals) and ARROW-1238 (Java Decimal integration
    tests).

@wesm
Copy link
Member

wesm commented Aug 20, 2017

nice! I will review when I can

@cpcloud cpcloud force-pushed the decimal-rewrite branch 4 times, most recently from 5837cfe to 3ae50de Compare August 20, 2017 19:10
@wesm
Copy link
Member

wesm commented Aug 21, 2017

If you rebase on master and then fix bugs, you should be able to get to a passing build

@cpcloud cpcloud force-pushed the decimal-rewrite branch 2 times, most recently from 2a18b76 to 82332b6 Compare August 22, 2017 12:58
Copy link
Member

Choose a reason for hiding this comment

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

Make the default offset 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's set to 0 as the default in the constructor already.

Copy link
Member

Choose a reason for hiding this comment

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

Any way to share code with FixedSizeBinaryArray on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Possibly. Let me look into cleaning up DecimalArray even more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was able to do a pretty significant refactoring of DecimalArray and inherit most methods from FixedSizeBinaryArray, including reuse of existing comparison methods for both FixedSizeBinaryArray and DecimalArray.

Copy link
Member

Choose a reason for hiding this comment

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

kMaximumPrecision

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

does this do anything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Member

Choose a reason for hiding this comment

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

trailing underscores

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Divide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Negate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Divide

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

Add \brief here for doxygen

Copy link
Member

Choose a reason for hiding this comment

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

Can you use /// style comments for doxygen instead of C-style?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

Choose a reason for hiding this comment

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

\brief, and below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@wesm
Copy link
Member

wesm commented Aug 22, 2017

Here's my "Arrow preflight check" that helps with not checking in cpplint or flake8 fails

function arrow_preflight {
    ARROW_PREFLIGHT_DIR=$HOME/code/arrow/cpp/preflight
    mkdir -p $ARROW_PREFLIGHT_DIR
    pushd $ARROW_PREFLIGHT_DIR
    arrow_cmake
    ninja format
    ninja lint
    popd
    pushd $HOME/code/arrow/python
    flake8 pyarrow
    flake8 --config=.flake8.cython pyarrow
    popd
}

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, thanks for all this! onward to the integration tests

private:
void SetData(const std::shared_ptr<internal::ArrayData>& data);
const uint8_t* raw_values_;
const uint8_t* sign_bitmap_data_;
Copy link
Member

Choose a reason for hiding this comment

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

Nice

@asfgit asfgit closed this in 750b77d Aug 24, 2017
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.

2 participants