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

SNOW-802269-months_between_format_number #159

Merged
merged 7 commits into from
Sep 12, 2024

Conversation

sfc-gh-sjayabalan
Copy link
Collaborator

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

Added following functions:
1. months_between()
2. instr()
3. format_number()
4. from_unix_timestamp()
5. to_unix_timestamp()

  1. Fill out the following pre-review checklist:

    • [ yes] I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
  2. Please describe how your code solves the related issue.

    It adds the above functions to scala and java modules

Pre-review checklist

(For Snowflake employees)

  • This change has passed precommit
  • I have reviewed code coverage report for my PR in (Sonarqube)

Copy link
Collaborator

@sfc-gh-bli sfc-gh-bli left a comment

Choose a reason for hiding this comment

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

Please add jira number in the PR title.

@sfc-gh-sjayabalan sfc-gh-sjayabalan changed the title added new functions,testcases SNOW-802269-months_between_format_number Sep 11, 2024
@sfc-gh-sjayabalan
Copy link
Collaborator Author

Please add jira number in the PR title.
Added

@sfc-gh-mrojas
Copy link
Collaborator

sfc-gh-mrojas commented Sep 11, 2024 via email

@sfc-gh-sjayabalan
Copy link
Collaborator Author

I think that the convention is that if this is a string we assume that the string is the column name. Sorry for the confusion.

On Wed, Sep 11, 2024 at 11:15 AM Shyamala Jayabalan < @.> wrote: @.* commented on this pull request. ------------------------------ In src/main/java/com/snowflake/snowpark_java/Functions.java <#159 (comment)> : > + * {{{ + * months_between("2017-11-14", "2017-07-14") // returns 4.0 + * months_between("2017-01-01", "2017-01-10") // returns 0.29032258 + * months_between("2017-06-01", "2017-06-16 12:00:00") // returns -0.5 + * }}} + * } + * + * @param end A date, timestamp or string. If a string, the data must be in a format that can be + * cast to a timestamp, such as yyyy-MM-dd or yyyy-MM-dd HH:mm:ss.SSSS + * @param start A date, timestamp or string. If a string, the data must be in a format that can + * cast to a timestamp, such as yyyy-MM-dd or yyyy-MM-dd HH:mm:ss.SSSS + * @return A double, or null if either end or start were strings that could not be cast to a + * timestamp. Negative if end is before start + * @SInCE 1.15.0 + / + public static Column months_between(Column end, Column start) { Fixed it.Can you please check now. — Reply to this email directly, view it on GitHub <#159 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55TFHFSWIJARRTSTK5JBPTZWB3EHAVCNFSM6AAAAABN7VQVDWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDEOJYGAZDIMBVGI . You are receiving this because your review was requested.Message ID: @.**>

  • Fixed it.Can you please approve.

Copy link
Collaborator

@sfc-gh-bli sfc-gh-bli left a comment

Choose a reason for hiding this comment

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

LGTM

@sfc-gh-sjayabalan sfc-gh-sjayabalan merged commit 6a9edb1 into main Sep 12, 2024
15 checks passed
@sfc-gh-sjayabalan sfc-gh-sjayabalan deleted the SNOW-802269-months_between_format_number branch September 12, 2024 18:44
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