You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by huawei-flink <gi...@git.apache.org> on 2017/02/06 13:18:49 UTC

[GitHub] flink pull request #3271: Flink 5710

GitHub user huawei-flink opened a pull request:

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

    Flink 5710

    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.
    
    - [ ] 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
    
    - [ ] 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


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

    $ git pull https://github.com/huawei-flink/flink FLINK-5710

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

    https://github.com/apache/flink/pull/3271.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 #3271
    
----
commit 72ec35a7380a4d73bd092ce14962ab2248139bae
Author: Stefano Bortoli <s....@gmail.com>
Date:   2017-02-01T16:15:58Z

    First implementation of ProcTime()

commit eaf4e92784dab01b17004390968ca4b1fe7c4bea
Author: Stefano Bortoli <s....@gmail.com>
Date:   2017-02-06T13:17:43Z

    ignore aggregation test and implemented simple proctime test

----


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100849148
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/validate/FunctionCatalog.scala ---
    @@ -190,11 +192,14 @@ object FunctionCatalog {
         // array
         "cardinality" -> classOf[ArrayCardinality],
         "at" -> classOf[ArrayElementAt],
    -    "element" -> classOf[ArrayElement]
    +    "element" -> classOf[ArrayElement],
     
    +    "procTime" -> classOf[CurrentTimestamp]
    --- End diff --
    
    make `procTime` lowercase, i.e., `proctime` to keep it consistent with `rowtime`.


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100806301
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    +
    +	/**
    +	 * An explicit representation of TIMESTAMP as an SQL return type
    +	 */
    +	private static final SqlReturnTypeInference TIMESTAMP = ReturnTypes.explicit(SqlTypeName.TIMESTAMP, 0);
    +	
    +	/**
    +	 * A a parameterless scalar function that just indicates processing time mode.
    --- End diff --
    
    Typo "A a parameterless"


---
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 #3271: FLINK-5710

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

    https://github.com/apache/flink/pull/3271
  
    Hi @huawei-flink,
    please name your PR with "[FLINK-XXX] Jira title text" pattern


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100819100
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    +
    +	/**
    +	 * An explicit representation of TIMESTAMP as an SQL return type
    +	 */
    +	private static final SqlReturnTypeInference TIMESTAMP = ReturnTypes.explicit(SqlTypeName.TIMESTAMP, 0);
    +	
    +	/**
    +	 * A a parameterless scalar function that just indicates processing time mode.
    +	 */
    +	public static final SqlFunction PROCTIME = new SqlFunction("PROCTIME", SqlKind.OTHER_FUNCTION, TIMESTAMP, null, OperandTypes.NILADIC, SqlFunctionCategory.TIMEDATE);
    --- End diff --
    
    The SQL function should also override ``getMonotonicity()`` to indicate that the returned timestamp is increasing


---
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 #3271: FLINK-5710

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

    https://github.com/apache/flink/pull/3271
  
    @fhueske not sure this was noticed. 


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100806237
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    +
    +	/**
    +	 * An explicit representation of TIMESTAMP as an SQL return type
    +	 */
    +	private static final SqlReturnTypeInference TIMESTAMP = ReturnTypes.explicit(SqlTypeName.TIMESTAMP, 0);
    --- End diff --
    
    I think we can inline this type.


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate StreamSQ...

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

    https://github.com/apache/flink/pull/3271
  
    @huawei-flink I'm very sorry, I accidentally closed this PR instead of #3277. Can you reopen 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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100844814
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    +
    +	/**
    +	 * An explicit representation of TIMESTAMP as an SQL return type
    +	 */
    +	private static final SqlReturnTypeInference TIMESTAMP = ReturnTypes.explicit(SqlTypeName.TIMESTAMP, 0);
    +	
    +	/**
    +	 * A a parameterless scalar function that just indicates processing time mode.
    +	 */
    +	public static final SqlFunction PROCTIME = new SqlFunction("PROCTIME", SqlKind.OTHER_FUNCTION, TIMESTAMP, null, OperandTypes.NILADIC, SqlFunctionCategory.TIMEDATE);
    --- End diff --
    
    Have a look at the `EveintTimeExtractor` object of PR #3252.


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100804434
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/calls/ProcTimeCallGen.scala ---
    @@ -0,0 +1,40 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.table.codegen.calls
    +
    +import org.apache.flink.api.common.typeinfo.{SqlTimeTypeInfo, TypeInformation}
    +import org.apache.flink.table.codegen.{CodeGenerator, GeneratedExpression}
    +
    +/**
    +  * Generates function call to determine current time point (as date/time/timestamp) in
    --- End diff --
    
    Please update the documentation.


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100807508
  
    --- Diff: flink-libraries/flink-table/src/test/java/org/apache/flink/table/api/java/stream/sql/StreamAggregationSqlITCase.java ---
    @@ -0,0 +1,81 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.table.api.java.stream.sql;
    +
    +import org.apache.flink.table.api.java.StreamTableEnvironment;
    +import org.apache.flink.api.java.tuple.Tuple5;
    +import org.apache.flink.types.Row;
    +import org.apache.flink.table.api.scala.stream.utils.StreamITCase;
    +import org.apache.flink.table.api.Table;
    +import org.apache.flink.table.api.TableEnvironment;
    +import org.apache.flink.streaming.api.datastream.DataStream;
    +import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
    +import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase;
    +import org.apache.flink.table.api.java.stream.utils.StreamTestData;
    +import org.junit.Ignore;
    +import org.junit.Test;
    +
    +import java.util.ArrayList;
    +import java.util.List;
    +
    +public class StreamAggregationSqlITCase extends StreamingMultipleProgramsTestBase {
    --- End diff --
    
    We test functions and expressions not with integration tests (too time intensive) but by extending the `ExpressionTestBase` class. We could add the tests for `procTime` to the `TemporalTypesTest` class.


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r101454598
  
    --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/calls/ProcTimeCallGen.scala ---
    @@ -0,0 +1,40 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.flink.table.codegen.calls
    +
    +import org.apache.flink.api.common.typeinfo.{SqlTimeTypeInfo, TypeInformation}
    +import org.apache.flink.table.codegen.{CodeGenerator, GeneratedExpression}
    +
    +/**
    +  * Generates function call to determine current time point (as date/time/timestamp) in
    --- End diff --
    
    not sure I understand this point. Should the generate method throw an exception, or should the code for the exception be generated?


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

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


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100806529
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    --- End diff --
    
    Rename class to `TimeModeIndicatorFunctions`


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r100804906
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    --- End diff --
    
    Please implement this class in Scala. 
    We don't want to unnecessarily mix Java and Scala in the same project.


---
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 #3271: [FLINK-5710] Add ProcTime() function to indicate S...

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

    https://github.com/apache/flink/pull/3271#discussion_r101455204
  
    --- Diff: flink-libraries/flink-table/src/main/java/org/apache/flink/table/calcite/functions/FlinkStreamFunctionCatalog.java ---
    @@ -0,0 +1,39 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to you under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.calcite.functions;
    +
    +import org.apache.calcite.sql.SqlFunction;
    +import org.apache.calcite.sql.SqlFunctionCategory;
    +import org.apache.calcite.sql.SqlKind;
    +import org.apache.calcite.sql.type.OperandTypes;
    +import org.apache.calcite.sql.type.ReturnTypes;
    +import org.apache.calcite.sql.type.SqlReturnTypeInference;
    +import org.apache.calcite.sql.type.SqlTypeName;
    +
    +public class FlinkStreamFunctionCatalog {
    +
    +	/**
    +	 * An explicit representation of TIMESTAMP as an SQL return type
    +	 */
    +	private static final SqlReturnTypeInference TIMESTAMP = ReturnTypes.explicit(SqlTypeName.TIMESTAMP, 0);
    +	
    +	/**
    +	 * A a parameterless scalar function that just indicates processing time mode.
    +	 */
    +	public static final SqlFunction PROCTIME = new SqlFunction("PROCTIME", SqlKind.OTHER_FUNCTION, TIMESTAMP, null, OperandTypes.NILADIC, SqlFunctionCategory.TIMEDATE);
    --- End diff --
    
    should I simply create the same class with using PROCTIME in place of ROWTIME?



---
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.
---