You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by KurtYoung <gi...@git.apache.org> on 2017/01/05 03:36:40 UTC

[GitHub] flink pull request #3062: [FLINK-5144] Fix error while applying rule Aggrega...

GitHub user KurtYoung opened a pull request:

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

    [FLINK-5144] Fix error while applying rule AggregateJoinTransposeRule

    There are two calcite's issues related.
    One is during calcite's decorrelation, there will be an assertion error: https://issues.apache.org/jira/browse/CALCITE-1543.
    Another one is about the AggregateJoinTransposeRule, looks like the rule has changed the output RowType unexpectedly: https://issues.apache.org/jira/browse/CALCITE-1544.
    
    I have fixed these two issues in calcite, but it won't be included util calcite 1.12.0. So i copied two related classes and do a early fix in flink's codes.

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

    $ git pull https://github.com/KurtYoung/flink flink-5144

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

    https://github.com/apache/flink/pull/3062.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 #3062
    
----
commit a97246af69282e981f3247f5f83b0c54ded9043a
Author: kete.yangkt <ke...@alibaba-inc.com>
Date:   2017-01-05T03:32:04Z

    [FLINK-5144] Fix error while applying rule AggregateJoinTransposeRule

----


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

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


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95427815
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/CorrelateITCase.scala ---
    @@ -0,0 +1,68 @@
    +/*
    + * 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.scala.batch.sql
    +
    +import org.apache.flink.api.scala._
    +import org.apache.flink.api.scala.ExecutionEnvironment
    +import org.apache.flink.api.scala.util.CollectionDataSets
    +import org.apache.flink.table.api.TableEnvironment
    +import org.apache.flink.table.api.scala._
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase.TableConfigMode
    +import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode
    +import org.apache.flink.test.util.TestBaseUtils
    +import org.apache.flink.types.Row
    +import org.junit._
    +import org.junit.runner.RunWith
    +import org.junit.runners.Parameterized
    +
    +import scala.collection.JavaConverters._
    +
    +@RunWith(classOf[Parameterized])
    +class CorrelateITCase(mode: TestExecutionMode, configMode: TableConfigMode)
    --- End diff --
    
    Ok, i will add some logical plan tests.


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95427718
  
    --- Diff: tools/maven/suppressions.xml ---
    @@ -23,6 +23,8 @@ under the License.
     		"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
     
     <suppressions>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]generated[\\/].*.java" checks="[a-zA-Z0-9]*"/>
    +    <suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    --- End diff --
    
    Since the classes i copied are violating multiple style check rules, and it looks like disabling multiple rules isn't working as i wanted, so i think i still need to change the suppression file. Will also clean this up once we update Calcite version


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95373645
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/CorrelateITCase.scala ---
    @@ -0,0 +1,68 @@
    +/*
    + * 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.scala.batch.sql
    +
    +import org.apache.flink.api.scala._
    +import org.apache.flink.api.scala.ExecutionEnvironment
    +import org.apache.flink.api.scala.util.CollectionDataSets
    +import org.apache.flink.table.api.TableEnvironment
    +import org.apache.flink.table.api.scala._
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase.TableConfigMode
    +import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode
    +import org.apache.flink.test.util.TestBaseUtils
    +import org.apache.flink.types.Row
    +import org.junit._
    +import org.junit.runner.RunWith
    +import org.junit.runners.Parameterized
    +
    +import scala.collection.JavaConverters._
    +
    +@RunWith(classOf[Parameterized])
    +class CorrelateITCase(mode: TestExecutionMode, configMode: TableConfigMode)
    --- End diff --
    
    Ok, will change that.


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95374019
  
    --- Diff: tools/maven/suppressions.xml ---
    @@ -23,6 +23,8 @@ under the License.
     		"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
     
     <suppressions>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]generated[\\/].*.java" checks="[a-zA-Z0-9]*"/>
    +    <suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    --- End diff --
    
    Can you show me how to disable style check in flink-table module, or show me similar example and i can figure it out by myself.


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r96410334
  
    --- Diff: tools/maven/suppressions.xml ---
    @@ -23,6 +23,8 @@ under the License.
     		"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
     
     <suppressions>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]generated[\\/].*.java" checks="[a-zA-Z0-9]*"/>
    +    <suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    --- End diff --
    
    I auto-formatted the code. Then we don't need this modification. I will merge your PR.


---
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 #3062: [FLINK-5144] Fix error while applying rule AggregateJoinT...

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

    https://github.com/apache/flink/pull/3062
  
    Thanks @twalthr for the reviewing. I have opened https://issues.apache.org/jira/browse/FLINK-5435 to track the cleanup work.


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95381307
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/CorrelateITCase.scala ---
    @@ -0,0 +1,68 @@
    +/*
    + * 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.scala.batch.sql
    +
    +import org.apache.flink.api.scala._
    +import org.apache.flink.api.scala.ExecutionEnvironment
    +import org.apache.flink.api.scala.util.CollectionDataSets
    +import org.apache.flink.table.api.TableEnvironment
    +import org.apache.flink.table.api.scala._
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase.TableConfigMode
    +import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode
    +import org.apache.flink.test.util.TestBaseUtils
    +import org.apache.flink.types.Row
    +import org.junit._
    +import org.junit.runner.RunWith
    +import org.junit.runners.Parameterized
    +
    +import scala.collection.JavaConverters._
    +
    +@RunWith(classOf[Parameterized])
    +class CorrelateITCase(mode: TestExecutionMode, configMode: TableConfigMode)
    --- End diff --
    
    Yes, you are right. Query decorrelation has to be tested well, but everything happens logically. ITCases are basically only necessary to test the translation of FlinkRels such as `DataSetJoin`, `DataStreamUnion`, etc.


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95362143
  
    --- Diff: tools/maven/suppressions.xml ---
    @@ -23,6 +23,8 @@ under the License.
     		"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
     
     <suppressions>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]generated[\\/].*.java" checks="[a-zA-Z0-9]*"/>
    +    <suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    --- End diff --
    
    We should avoid modifying files that are not within the `flink-table` module. You can also disable checkstyle for certain classes. 


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95361767
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/batch/sql/CorrelateITCase.scala ---
    @@ -0,0 +1,68 @@
    +/*
    + * 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.scala.batch.sql
    +
    +import org.apache.flink.api.scala._
    +import org.apache.flink.api.scala.ExecutionEnvironment
    +import org.apache.flink.api.scala.util.CollectionDataSets
    +import org.apache.flink.table.api.TableEnvironment
    +import org.apache.flink.table.api.scala._
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase
    +import org.apache.flink.table.api.scala.batch.utils.TableProgramsTestBase.TableConfigMode
    +import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode
    +import org.apache.flink.test.util.TestBaseUtils
    +import org.apache.flink.types.Row
    +import org.junit._
    +import org.junit.runner.RunWith
    +import org.junit.runners.Parameterized
    +
    +import scala.collection.JavaConverters._
    +
    +@RunWith(classOf[Parameterized])
    +class CorrelateITCase(mode: TestExecutionMode, configMode: TableConfigMode)
    --- End diff --
    
    Can you change this test to extend `TableTestBase`? We don't need a full IT case here, logical testing should be enough.


---
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 #3062: [FLINK-5144] Fix error while applying rule Aggrega...

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

    https://github.com/apache/flink/pull/3062#discussion_r95381802
  
    --- Diff: tools/maven/suppressions.xml ---
    @@ -23,6 +23,8 @@ under the License.
     		"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
     
     <suppressions>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    -		<suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]generated[\\/].*.java" checks="[a-zA-Z0-9]*"/>
    +    <suppress files="org[\\/]apache[\\/]flink[\\/]api[\\/]io[\\/]avro[\\/]example[\\/]User.java" checks="[a-zA-Z0-9]*"/>
    --- End diff --
    
    It should look similar to:
    
    ```java
    //CHECKSTYLE.OFF: AvoidStarImport - Needed for TupleGenerator
    import org.apache.flink.api.java.tuple.*;
    //CHECKSTYLE.ON: AvoidStarImport
    ```
    
    You have to specify which checkstyle rule you want to disable and give a explanation why.


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