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

HIVE-27094: Support of big numbers conversions #4074

Closed
wants to merge 2 commits into from

Conversation

NarekDW
Copy link

@NarekDW NarekDW commented Feb 18, 2023

What changes were proposed in this pull request?

Add support for converting big numbers between different radixes, without an overflow.

For example such a query:

SELECT
  conv(9223372036854775807, 36, 16),
  conv(9223372036854775807, 36, -16),
  conv(-9223372036854775807, 36, 16),
  conv(-9223372036854775807, 36, -16)
FROM src tablesample (1 rows); 

Should give a correct result, like:

12DDAC15F246BAF8C0D551AC7   12DDAC15F246BAF8C0D551AC7  D2253EA0DB945073F2AAE539   -12DDAC15F246BAF8C0D551AC7

Why are the changes needed?

Add support for converting big numbers between different radixes, without an overflow.

Does this PR introduce any user-facing change?

Yes, it allows users to convert big numbers without an overflow among different bases.

How was this patch tested?

By existing unit tests + added an additional test case TestUDFConv

Also I tested it on my local machine with JMH and it works faster about 2 times.

@NarekDW
Copy link
Author

NarekDW commented Feb 19, 2023

Hi guys, it's my first contribution to the hive and I see that CI fails, but seems it is not because of tests or code related issue...
I see such a log in Jenkins:

...
[2023-02-18T21:01:35.667Z] waiting for oracle to be available...
[2023-02-18T21:06:42.458Z] timeout reached before the port went into state "inuse"
script returned exit code 1

Let me know if something is wrong here, please.

@wecharyu
Copy link
Contributor

[2023-02-18T21:06:42.458Z] timeout reached before the port went into state "inuse"
script returned exit code 1

This timeout error can be ignored, please check other failed tests in your Tests page.

@NarekDW
Copy link
Author

NarekDW commented Feb 19, 2023

@wecharyu thank you for the support. Yep, my bad, there was a bug. I've fixed it and added additional unit tests in the TestUDFConv class.

@sonarcloud
Copy link

sonarcloud bot commented Feb 19, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@NarekDW
Copy link
Author

NarekDW commented Mar 5, 2023

@kgyrtkirk could you take a look, pls?

@github-actions
Copy link

github-actions bot commented May 5, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.

@github-actions github-actions bot added the stale label May 5, 2023
@github-actions github-actions bot closed this May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants