[ 
https://issues.apache.org/jira/browse/FLINK-6895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16383451#comment-16383451
 ] 

ASF GitHub Bot commented on FLINK-6895:
---------------------------------------

GitHub user buptljy opened a pull request:

    https://github.com/apache/flink/pull/5618

    [FLINK-6895][table]Add STR_TO_DATE supported in SQL

    ## What is the purpose of the change
    Add STR_TO_DATE Function supported in SQL
    ## Brief change log
     * STR_TO_DATE(str string, format string)  
        \-  str is the string that need to be transformed.
        \- format is the pattern of "str"
     * Add tests in ScalarFunctionsTest.scala
     * Add docs in sql.md
    ## Verifying this change
     * Run unit tests in  ScalarFunctionsTest.scala
    ## Does this pull request potentially affect one of the following parts:
     * A new sql function
    ## Documentation
      * Add docs in sql.md

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/buptljy/flink str_to_date

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/5618.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #5618
    
----
commit 59752143ee438cb11969ae4bdda1fac5fc32813c
Author: Liao Jiayi <liaojiayi@...>
Date:   2018-03-01T11:58:08Z

    add str_to_date sql function

commit 63f71e4b3d6378f2114aa04ba4d1128f1ec3bc38
Author: Liao Jiayi <liaojiayi@...>
Date:   2018-03-01T11:58:41Z

    Merge branch 'master' of github.com:apache/flink

commit 3ec6d2ec487151928032d144de94ca9113d63f01
Author: Liao Jiayi <liaojiayi@...>
Date:   2018-03-01T15:30:04Z

    fix checkstyle error

----


> Add STR_TO_DATE supported in SQL
> --------------------------------
>
>                 Key: FLINK-6895
>                 URL: https://issues.apache.org/jira/browse/FLINK-6895
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API &amp; SQL
>    Affects Versions: 1.4.0
>            Reporter: sunjincheng
>            Assignee: Aegeaner
>            Priority: Major
>
> STR_TO_DATE(str,format) This is the inverse of the DATE_FORMAT() function. It 
> takes a string str and a format string format. STR_TO_DATE() returns a 
> DATETIME value if the format string contains both date and time parts, or a 
> DATE or TIME value if the string contains only date or time parts. If the 
> date, time, or datetime value extracted from str is illegal, STR_TO_DATE() 
> returns NULL and produces a warning.
> * Syntax:
> STR_TO_DATE(str,format) 
> * Arguments
> **str: -
> **format: -
> * Return Types
>   DATAETIME/DATE/TIME
> * Example:
>   STR_TO_DATE('01,5,2013','%d,%m,%Y') -> '2013-05-01'
>   SELECT STR_TO_DATE('a09:30:17','a%h:%i:%s') -> '09:30:17'
> * See more:
> ** [MySQL| 
> https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_str-to-date]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to