Skip to content
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

[CARBONDATA-4138] Reordering Carbon Expression instead of Spark Filter #4100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

QiangCai
Copy link
Contributor

@QiangCai QiangCai commented Mar 2, 2021

base on pr#4097

Why is this PR needed?

reorder Carbon Expression instead of Spark Filter

What changes were proposed in this PR?

reorder Carbon Expression instead of Spark Filter

Does this PR introduce any user interface change?

  • No

Is any new testcase added?

  • Yes

@QiangCai QiangCai changed the title [CARBONDATA-4138] reorder Carbon Expression instead of Spark Filter [CARBONDATA-4138] Reordering Carbon Expression instead of Spark Filter Mar 2, 2021
@CarbonDataQA2
Copy link

Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3348/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5107/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5110/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3351/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5112/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3353/

@QiangCai
Copy link
Contributor Author

QiangCai commented Mar 9, 2021

retest this please

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5118/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3359/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3764/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5529/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.4.5, Please check CI http://121.244.95.60:12545/job/ApacheCarbon_PR_Builder_2.4.5/3291/

@ydvpankaj99
Copy link
Contributor

retest this please

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5049/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5542/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3775/

@QiangCai
Copy link
Contributor Author

retest this please

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12444/job/ApacheCarbonPRBuilder2.3/5549/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12444/job/ApacheCarbon_PR_Builder_2.4.5/3783/

@CarbonDataQA2
Copy link

Build Failed with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/5061/

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3309/

@QiangCai
Copy link
Contributor Author

retest this please

@CarbonDataQA2
Copy link

Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3342/

@CarbonDataQA2
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12602/job/ApacheCarbonPRBuilder2.3/5094/

@QiangCai
Copy link
Contributor Author

@kunal642 please review and merge

@@ -2602,6 +2602,11 @@ private CarbonCommonConstants() {

public static final String FILE_HEADER = "fileHeader";

@CarbonProperty(dynamicConfigurable = true)
public static final String CARBON_OPTIMIZE_FILTER = "carbon.optimize.filter";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"carbon.reorder.filter" and "carbon.optimize.filter" seem to be doing the same thing. please remove one of them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reorder is one part of optimaztion

*/
public class ExpressionOptimizer {

private final OptimizeRule[] rules = { new ExpressionReorder() };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for private static class, make this final and use directly

}
MultiExpression multiExpression = MultiExpression.build(expression);
// unsupported expression
if (multiExpression == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this check above MultiExpression.build so that we dont enter the reorder code if null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MultiExpression.build return "multiExpression "

/**
* a wrapper class of Expression with storage ordinal
*/
public class ExpressionWithOrdinal extends StorageOrdinal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all classes inside optimize package except ExpressionReorder should have default access modifier so that they are not used for creating expressions by mistake

import org.apache.carbondata.core.scan.expression.Expression;

/**
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the empty description

}

test("Test filter reorder with various conditions") {
checkOptimizer("(four = 11 and two = 11) or (one = 11)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why pass the filter expression as string instead of Expression object?? No need for translation.

Refer: https://github.com/apache/carbondata/pull/3902/files#diff-ddfc2bc65b7f1055d4ae72fdfcdad5418e44373a6391fc348568b9a8bee506f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants