-
Notifications
You must be signed in to change notification settings - Fork 20
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
SNOW-802269-months_between_format_number #159
Conversation
…thub.com/snowflakedb/snowpark-java-scala into SNOW-802269-months_between_format_number
There was a problem hiding this 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.
|
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
+ * }}}
+ * }</pre>
+ *
+ * @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:
***@***.***>
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please answer these questions before submitting your pull requests. Thanks!
Added following functions:
1. months_between()
2. instr()
3. format_number()
4. from_unix_timestamp()
5. to_unix_timestamp()
Fill out the following pre-review checklist:
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)