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

make datatype descriptions for numbers more clear... #4281

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

rramthun
Copy link

@rramthun rramthun commented Sep 4, 2024

...especially w.r.t. fixed point types vs. floating point types

Please double check if the updated descriptions are in line with what Hop wants, especially that NUMBER is floating point arithmetic and BIGNUMBER is fixed point arithmetic.

I will base the changes in database schema generation from #4268 on these descriptions, if they are agreeable.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Run mvn clean install apache-rat:check to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If you have a group of commits related to the same change, please squash your commits into one and force push your branch using git rebase -i.
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable.

To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@hansva
Copy link
Contributor

hansva commented Sep 5, 2024

Thanks for this!
To be precise we can take a look at ValueMetaAndData.java.
This is the mapping that we use for Objects to MetaValue:

public ValueMetaAndData(String valueName, Object valueData) {
    this.valueData = valueData;
    if (valueData instanceof String) {
      this.valueMeta = new ValueMetaString(valueName);
    } else if (valueData instanceof Double) {
      this.valueMeta = new ValueMetaNumber(valueName);
    } else if (valueData instanceof Long) {
      this.valueMeta = new ValueMetaInteger(valueName);
    } else if (valueData instanceof Date) {
      this.valueMeta = new ValueMetaDate(valueName);
    } else if (valueData instanceof BigDecimal) {
      this.valueMeta = new ValueMetaBigNumber(valueName);
    } else if (valueData instanceof Boolean) {
      this.valueMeta = new ValueMetaBoolean(valueName);
    } else if (valueData instanceof byte[]) {
      this.valueMeta = new ValueMetaBinary(valueName);
    } else {
      this.valueMeta = new ValueMetaSerializable(valueName);
    }
  }

@hansva hansva merged commit fcafadb into apache:main Sep 5, 2024
1 check passed
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