You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by twalthr <gi...@git.apache.org> on 2016/06/23 10:03:53 UTC

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

GitHub user twalthr opened a pull request:

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

    [FLINK-3580] [table] Reintroduce Date/Time and implement scalar functions for it

    Thanks for contributing to Apache Flink. Before you open your pull request, please take the following check list into consideration.
    If your changes take all of the items into account, feel free to open your pull request. For more information and/or questions please refer to the [How To Contribute guide](http://flink.apache.org/how-to-contribute.html).
    In addition to going through the list, please provide a meaningful description of your changes.
    
    - [x] General
      - The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
      - The pull request addresses only one issue
      - Each commit in the PR has a meaningful commit message (including the JIRA id)
    
    - [ ] Documentation
      - Documentation has been added for new functionality
      - Old documentation affected by the pull request has been updated
      - JavaDoc for public methods has been added
    
    - [x] Tests & Build
      - Functionality added by the pull request is covered by tests
      - `mvn clean verify` has been executed successfully locally or a Travis build has passed
    
    This PR implements basic Date/Time/Timestamp support for the Table API. Not all scalar functions are supported so far. It also solves FLINK-3152. I will add some documentation later.

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

    $ git pull https://github.com/twalthr/flink TableApiDateTimeTimestamp2

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

    https://github.com/apache/flink/pull/2150.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 #2150
    
----
commit 76f382be8cc38339bbd2e8ced8b9e269f96374eb
Author: twalthr <tw...@apache.org>
Date:   2016-06-17T07:27:57Z

    [FLINK-3580] [table] Reintroduce Date/Time and implement scalar functions for it

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2150#discussion_r68735888
  
    --- Diff: docs/apis/table.md ---
    @@ -775,6 +775,8 @@ column names and function names follow Java identifier syntax. Expressions speci
     
     If working with exact numeric values or large decimals is required, the Table API also supports Java's BigDecimal type. In the Scala Table API decimals can be defined by `BigDecimal("123456")` and in Java by appending a "p" for precise e.g. `123456p`.
    --- End diff --
    
    No, there is no standard suffix for BigDecimals and `d` is already the suffix for `double`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2150#discussion_r68740142
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/sql/ExpressionsITCase.scala ---
    @@ -120,4 +122,26 @@ class ExpressionsITCase(
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
     
    +  @Test
    +  def testAdvancedDataTypes(): Unit = {
    --- End diff --
    
    Ah, I see, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2150#discussion_r68735444
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/sql/ExpressionsITCase.scala ---
    @@ -120,4 +122,26 @@ class ExpressionsITCase(
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
     
    +  @Test
    +  def testAdvancedDataTypes(): Unit = {
    --- End diff --
    
    This is meant to be the unit test for all future advanced data types. It has the same name as the test in `ExpressionITCase` of Scala Table API.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2150: [FLINK-3580] [table] Reintroduce Date/Time and implement ...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on the issue:

    https://github.com/apache/flink/pull/2150
  
    Merging...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2150#discussion_r68476229
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/typeutils/TypeCoercion.scala ---
    @@ -85,6 +85,9 @@ object TypeCoercion {
         case (STRING_TYPE_INFO, _: NumericTypeInfo[_]) => true
         case (STRING_TYPE_INFO, BOOLEAN_TYPE_INFO) => true
         case (STRING_TYPE_INFO, BIG_DEC_TYPE_INFO) => true
    +    case (STRING_TYPE_INFO, SqlTimeTypeInfo.DATE) => true
    +    case (STRING_TYPE_INFO, SqlTimeTypeInfo.TIME) => true
    +    case (STRING_TYPE_INFO, SqlTimeTypeInfo.TIMESTAMP) => true
    --- End diff --
    
    Allow casting from LONG to TIMESTAMP?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2150: [FLINK-3580] [table] Reintroduce Date/Time and implement ...

Posted by fhueske <gi...@git.apache.org>.
Github user fhueske commented on the issue:

    https://github.com/apache/flink/pull/2150
  
    Hi @twalthr, thanks for the PR. I skimmed the changes and everything looked fine. I have two suggestions though. 
    
    1. Can we add a casts from `Long` to `Timestamp` and back? 
    2. Can you add a Date, Time, and Timestamp type an existing ITCase for Scala SQL and Table API to check that these work fine?
    
    Thanks, Fabian


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #2150: [FLINK-3580] [table] Reintroduce Date/Time and implement ...

Posted by twalthr <gi...@git.apache.org>.
Github user twalthr commented on the issue:

    https://github.com/apache/flink/pull/2150
  
    @fhueske I have updated the PR. If there are no objections, I would merge it soon. So that it will be contained in the next release.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2150#discussion_r68571843
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/sql/ExpressionsITCase.scala ---
    @@ -120,4 +122,26 @@ class ExpressionsITCase(
         TestBaseUtils.compareResultAsText(results.asJava, expected)
       }
     
    +  @Test
    +  def testAdvancedDataTypes(): Unit = {
    --- End diff --
    
    this should probably be `testAdvancedDateTypes`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #2150: [FLINK-3580] [table] Reintroduce Date/Time and imp...

Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2150#discussion_r68730731
  
    --- Diff: docs/apis/table.md ---
    @@ -775,6 +775,8 @@ column names and function names follow Java identifier syntax. Expressions speci
     
     If working with exact numeric values or large decimals is required, the Table API also supports Java's BigDecimal type. In the Scala Table API decimals can be defined by `BigDecimal("123456")` and in Java by appending a "p" for precise e.g. `123456p`.
    --- End diff --
    
    Is the `p` suffix a standard suffix for BigDecimal?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---