diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyInPredicate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyInPredicate.java index 8feb52cd4bcdbe..3e194a4edde398 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyInPredicate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyInPredicate.java @@ -24,8 +24,9 @@ import org.apache.doris.nereids.trees.expressions.InPredicate; import org.apache.doris.nereids.trees.expressions.literal.DateTimeV2Literal; import org.apache.doris.nereids.trees.expressions.literal.DateV2Literal; +import org.apache.doris.nereids.types.DateTimeV2Type; -import com.google.common.collect.Lists; +import com.google.common.collect.ImmutableList; import java.util.List; @@ -46,12 +47,25 @@ public Expression visitInPredicate(InPredicate expr, ExpressionRewriteContext co List literals = expr.children().subList(1, expr.children().size()); if (literals.stream().allMatch(literal -> literal instanceof DateTimeV2Literal && canLosslessConvertToDateV2Literal((DateTimeV2Literal) literal))) { - List children = Lists.newArrayList(); + ImmutableList.Builder children = ImmutableList.builder(); children.add(cast.child()); - literals.stream().forEach( - l -> children.add(convertToDateV2Literal((DateTimeV2Literal) l))); - return expr.withChildren(children); + literals.forEach(l -> children.add(convertToDateV2Literal((DateTimeV2Literal) l))); + return expr.withChildren(children.build()); } + } else if (cast.child().getDataType().isDateTimeV2Type() + && expr.child(1) instanceof DateTimeV2Literal) { + List literals = expr.children().subList(1, expr.children().size()); + DateTimeV2Type compareType = (DateTimeV2Type) cast.child().getDataType(); + if (literals.stream().allMatch(literal -> literal instanceof DateTimeV2Literal + && canLosslessConvertToLowScaleLiteral( + (DateTimeV2Literal) literal, compareType.getScale()))) { + ImmutableList.Builder children = ImmutableList.builder(); + children.add(cast.child()); + literals.forEach(l -> children.add(new DateTimeV2Literal(compareType, + ((DateTimeV2Literal) l).getStringValue()))); + return expr.withChildren(children.build()); + } + } } } @@ -75,4 +89,8 @@ private static boolean canLosslessConvertToDateV2Literal(DateTimeV2Literal liter private DateV2Literal convertToDateV2Literal(DateTimeV2Literal literal) { return new DateV2Literal(literal.getYear(), literal.getMonth(), literal.getDay()); } + + private static boolean canLosslessConvertToLowScaleLiteral(DateTimeV2Literal literal, int targetScale) { + return literal.getMicroSecond() % (1L << (DateTimeV2Type.MAX_SCALE - targetScale)) == 0; + } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java index b9cdd7eced7a76..ffefc3e55c0f9e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java @@ -19,6 +19,8 @@ import org.apache.doris.nereids.types.DataType; +import java.util.Objects; + /** StringLikeLiteral. */ public abstract class StringLikeLiteral extends Literal { public final String value; @@ -44,6 +46,23 @@ public double getDouble() { return (double) v; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof StringLikeLiteral)) { + return false; + } + StringLikeLiteral that = (StringLikeLiteral) o; + return Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + @Override public String toString() { return "'" + value + "'"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/CharType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/CharType.java index f9ce7d2ea0de61..15ed345a3396ad 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/CharType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/CharType.java @@ -51,11 +51,6 @@ public Type toCatalogDataType() { return ScalarType.createChar(len); } - @Override - public boolean acceptsType(DataType other) { - return other instanceof CharType; - } - @Override public String simpleString() { return "char"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/StringType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/StringType.java index 5dad1f5dc5c18d..9e130963854fe7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/StringType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/StringType.java @@ -41,11 +41,6 @@ public Type toCatalogDataType() { return Type.STRING; } - @Override - public boolean acceptsType(DataType other) { - return other instanceof StringType || other instanceof VarcharType; - } - @Override public String simpleString() { return "string"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java index 89e044847db058..0bf0cf4f3dfd77 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VarcharType.java @@ -54,11 +54,6 @@ public Type toCatalogDataType() { return catalogDataType; } - @Override - public boolean acceptsType(DataType other) { - return other instanceof VarcharType || other instanceof StringType; - } - @Override public String simpleString() { return "varchar"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java index 6743d11c3ce5a7..34dacb40348567 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java @@ -339,8 +339,7 @@ public static Expression castIfNotSameType(Expression input, DataType targetType if (input.isNullLiteral()) { return new NullLiteral(targetType); } else if (input.getDataType().equals(targetType) || isSubqueryAndDataTypeIsBitmap(input) - || (isVarCharOrStringType(input.getDataType()) - && isVarCharOrStringType(targetType))) { + || (input.getDataType().isStringLikeType()) && targetType.isStringLikeType()) { return input; } else { checkCanCastTo(input.getDataType(), targetType); @@ -352,10 +351,6 @@ private static boolean isSubqueryAndDataTypeIsBitmap(Expression input) { return input instanceof SubqueryExpr && input.getDataType().isBitmapType(); } - private static boolean isVarCharOrStringType(DataType dataType) { - return dataType instanceof VarcharType || dataType instanceof StringType; - } - private static boolean canCastTo(DataType input, DataType target) { return Type.canCastTo(input.toCatalogDataType(), target.toCatalogDataType()); } @@ -857,7 +852,7 @@ public static Expression processInPredicate(InPredicate inPredicate) { return optionalCommonType .map(commonType -> { List newChildren = inPredicate.children().stream() - .map(e -> TypeCoercionUtils.castIfNotMatchType(e, commonType)) + .map(e -> TypeCoercionUtils.castIfNotSameType(e, commonType)) .collect(Collectors.toList()); return inPredicate.withChildren(newChildren); }) @@ -886,7 +881,7 @@ public static Expression processCaseWhen(CaseWhen caseWhen) { List newChildren = caseWhen.getWhenClauses().stream() .map(wc -> { - Expression valueExpr = TypeCoercionUtils.castIfNotMatchType( + Expression valueExpr = TypeCoercionUtils.castIfNotSameType( wc.getResult(), commonType); // we must cast every child to the common type, and then // FoldConstantRuleOnFe can eliminate some branches and direct @@ -899,7 +894,7 @@ public static Expression processCaseWhen(CaseWhen caseWhen) { .collect(Collectors.toList()); caseWhen.getDefaultValue() .map(dv -> { - Expression defaultExpr = TypeCoercionUtils.castIfNotMatchType(dv, commonType); + Expression defaultExpr = TypeCoercionUtils.castIfNotSameType(dv, commonType); if (!defaultExpr.getDataType().equals(commonType)) { defaultExpr = new Cast(defaultExpr, commonType); } diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/datasets/ssb/SSBJoinReorderTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/datasets/ssb/SSBJoinReorderTest.java index 49c3636a4f6f28..ca0c49d6d7f8b2 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/datasets/ssb/SSBJoinReorderTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/datasets/ssb/SSBJoinReorderTest.java @@ -39,7 +39,7 @@ public void q4_1() { ImmutableList.of( "(c_region = 'AMERICA')", "(s_region = 'AMERICA')", - "p_mfgr IN ('MFGR#2', 'MFGR#1')" + "p_mfgr IN ('MFGR#1', 'MFGR#2')" ) ); } @@ -58,7 +58,7 @@ public void q4_2() { "d_year IN (1997, 1998)", "(c_region = 'AMERICA')", "(s_region = 'AMERICA')", - "p_mfgr IN ('MFGR#2', 'MFGR#1')" + "p_mfgr IN ('MFGR#1', 'MFGR#2')" ) ); } diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyInPredicateTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyInPredicateTest.java index 01502bac522cfa..87c57889b2f6fc 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyInPredicateTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/expression/SimplifyInPredicateTest.java @@ -39,7 +39,11 @@ public void test() { )); Map mem = Maps.newHashMap(); Expression rewrittenExpression = PARSER.parseExpression("cast(CA as DATETIME) in ('1992-01-31 00:00:00', '1992-02-01 00:00:00')"); + // after parse and type coercion: CAST(CAST(CA AS DATETIMEV2(0)) AS DATETIMEV2(6)) IN ('1992-01-31 00:00:00.000000', '1992-02-01 00:00:00.000000') rewrittenExpression = typeCoercion(replaceUnboundSlot(rewrittenExpression, mem)); + // after first rewrite: CAST(CA AS DATETIMEV2(0)) IN ('1992-01-31 00:00:00', '1992-02-01 00:00:00') + rewrittenExpression = executor.rewrite(rewrittenExpression, context); + // after second rewrite: CA IN ('1992-01-31', '1992-02-01') rewrittenExpression = executor.rewrite(rewrittenExpression, context); Expression expectedExpression = PARSER.parseExpression("CA in (cast('1992-01-31' as date), cast('1992-02-01' as date))"); expectedExpression = replaceUnboundSlot(expectedExpression, mem); @@ -47,7 +51,6 @@ public void test() { FoldConstantRule.INSTANCE )); expectedExpression = executor.rewrite(expectedExpression, context); - Assertions.assertEquals(expectedExpression.toSql(), rewrittenExpression.toSql()); + Assertions.assertEquals(expectedExpression, rewrittenExpression); } - } diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java index c4b4d4d989998c..c0dfe19d046e33 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/types/DataTypeTest.java @@ -453,8 +453,8 @@ public void testCharAccept() { int scale = Math.min(precision, Math.abs(new Random().nextInt() % DecimalV2Type.MAX_SCALE)); Assertions.assertFalse(dataType.acceptsType(DecimalV2Type.createDecimalV2Type(precision, scale))); Assertions.assertTrue(dataType.acceptsType(new CharType(new Random().nextInt()))); - Assertions.assertFalse(dataType.acceptsType(new VarcharType(new Random().nextInt()))); - Assertions.assertFalse(dataType.acceptsType(StringType.INSTANCE)); + Assertions.assertTrue(dataType.acceptsType(new VarcharType(new Random().nextInt()))); + Assertions.assertTrue(dataType.acceptsType(StringType.INSTANCE)); Assertions.assertFalse(dataType.acceptsType(DateType.INSTANCE)); Assertions.assertFalse(dataType.acceptsType(DateTimeType.INSTANCE)); } @@ -474,7 +474,7 @@ public void testVarcharAccept() { int precision = Math.abs(new Random().nextInt() % (DecimalV2Type.MAX_PRECISION - 1)) + 1; int scale = Math.min(precision, Math.abs(new Random().nextInt() % DecimalV2Type.MAX_SCALE)); Assertions.assertFalse(dataType.acceptsType(DecimalV2Type.createDecimalV2Type(precision, scale))); - Assertions.assertFalse(dataType.acceptsType(new CharType(new Random().nextInt()))); + Assertions.assertTrue(dataType.acceptsType(new CharType(new Random().nextInt()))); Assertions.assertTrue(dataType.acceptsType(new VarcharType(new Random().nextInt()))); Assertions.assertTrue(dataType.acceptsType(StringType.INSTANCE)); Assertions.assertFalse(dataType.acceptsType(DateType.INSTANCE)); @@ -496,7 +496,7 @@ public void testStringAccept() { int precision = Math.abs(new Random().nextInt() % (DecimalV2Type.MAX_PRECISION - 1)) + 1; int scale = Math.min(precision, Math.abs(new Random().nextInt() % DecimalV2Type.MAX_SCALE)); Assertions.assertFalse(dataType.acceptsType(DecimalV2Type.createDecimalV2Type(precision, scale))); - Assertions.assertFalse(dataType.acceptsType(new CharType(new Random().nextInt()))); + Assertions.assertTrue(dataType.acceptsType(new CharType(new Random().nextInt()))); Assertions.assertTrue(dataType.acceptsType(new VarcharType(new Random().nextInt()))); Assertions.assertTrue(dataType.acceptsType(StringType.INSTANCE)); Assertions.assertFalse(dataType.acceptsType(DateType.INSTANCE)); diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java index fe9d6b5363b2cc..0740403373503b 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/util/TypeCoercionUtilsTest.java @@ -23,9 +23,12 @@ import org.apache.doris.nereids.trees.expressions.Expression; import org.apache.doris.nereids.trees.expressions.Multiply; import org.apache.doris.nereids.trees.expressions.Subtract; +import org.apache.doris.nereids.trees.expressions.literal.CharLiteral; import org.apache.doris.nereids.trees.expressions.literal.DecimalLiteral; import org.apache.doris.nereids.trees.expressions.literal.DecimalV3Literal; import org.apache.doris.nereids.trees.expressions.literal.DoubleLiteral; +import org.apache.doris.nereids.trees.expressions.literal.StringLiteral; +import org.apache.doris.nereids.trees.expressions.literal.VarcharLiteral; import org.apache.doris.nereids.types.ArrayType; import org.apache.doris.nereids.types.BigIntType; import org.apache.doris.nereids.types.BitmapType; @@ -692,9 +695,18 @@ private void testFindCommonPrimitiveTypeForCaseWhen(DataType commonType, DataTyp @Test public void testCastIfNotSameType() { Assertions.assertEquals(new DoubleLiteral(5L), - TypeCoercionUtils.castIfNotMatchType(new DoubleLiteral(5L), DoubleType.INSTANCE)); + TypeCoercionUtils.castIfNotSameType(new DoubleLiteral(5L), DoubleType.INSTANCE)); Assertions.assertEquals(new Cast(new DoubleLiteral(5L), BooleanType.INSTANCE), - TypeCoercionUtils.castIfNotMatchType(new DoubleLiteral(5L), BooleanType.INSTANCE)); + TypeCoercionUtils.castIfNotSameType(new DoubleLiteral(5L), BooleanType.INSTANCE)); + Assertions.assertEquals(new StringLiteral("varchar"), + TypeCoercionUtils.castIfNotSameType(new VarcharLiteral("varchar"), StringType.INSTANCE)); + Assertions.assertEquals(new StringLiteral("char"), + TypeCoercionUtils.castIfNotSameType(new CharLiteral("char", 4), StringType.INSTANCE)); + Assertions.assertEquals(new CharLiteral("char", 4), + TypeCoercionUtils.castIfNotSameType(new CharLiteral("char", 4), VarcharType.createVarcharType(100))); + Assertions.assertEquals(new StringLiteral("string"), + TypeCoercionUtils.castIfNotSameType(new StringLiteral("string"), VarcharType.createVarcharType(100))); + } @Test diff --git a/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.1.out b/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.1.out index 3ddb20d9c58318..b6af716127deb1 100644 --- a/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.1.out +++ b/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.1.out @@ -27,7 +27,7 @@ PhysicalResultSink --------------------------------PhysicalOlapScan[customer] --------------------PhysicalDistribute ----------------------PhysicalProject -------------------------filter(p_mfgr IN ('MFGR#2', 'MFGR#1')) +------------------------filter(p_mfgr IN ('MFGR#1', 'MFGR#2')) --------------------------PhysicalOlapScan[part] ------------------PhysicalDistribute --------------------PhysicalProject diff --git a/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.2.out b/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.2.out index 53be0d703d29ed..8a50b45af6bee3 100644 --- a/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.2.out +++ b/regression-test/data/nereids_ssb_shape_sf100_p0/shape/q4.2.out @@ -32,6 +32,6 @@ PhysicalResultSink ------------------------------PhysicalOlapScan[customer] ------------------PhysicalDistribute --------------------PhysicalProject -----------------------filter(p_mfgr IN ('MFGR#2', 'MFGR#1')) +----------------------filter(p_mfgr IN ('MFGR#1', 'MFGR#2')) ------------------------PhysicalOlapScan[part] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out index 0aa36ae310959b..ff3e90c1248d7e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query1.out @@ -30,7 +30,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------filter((cast(s_state as VARCHAR(*)) = 'SD')) +--------------------------filter((store.s_state = 'SD')) ----------------------------PhysicalOlapScan[store] ------------------hashAgg[GLOBAL] --------------------PhysicalDistribute diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query13.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query13.out index adcacd12f763d6..441b39ce61bbf2 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query13.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query13.out @@ -16,9 +16,9 @@ PhysicalResultSink --------------------PhysicalOlapScan[store] ------------------PhysicalDistribute --------------------PhysicalProject -----------------------hashJoin[INNER_JOIN](customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)((((((cast(cd_marital_status as VARCHAR(*)) = 'D') AND (cast(cd_education_status as VARCHAR(*)) = 'Unknown')) AND ((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00))) AND (household_demographics.hd_dep_count = 3)) OR ((((cast(cd_marital_status as VARCHAR(*)) = 'S') AND (cast(cd_education_status as VARCHAR(*)) = 'College')) AND ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00))) AND (household_demographics.hd_dep_count = 1))) OR ((((cast(cd_marital_status as VARCHAR(*)) = 'M') AND (cast(cd_education_status as VARCHAR(*)) = '4 yr Degree')) AND ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))) AND (household_demographics.hd_dep_count = 1))) +----------------------hashJoin[INNER_JOIN](customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)((((((customer_demographics.cd_marital_status = 'D') AND (customer_demographics.cd_education_status = 'Unknown')) AND ((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00))) AND (household_demographics.hd_dep_count = 3)) OR ((((customer_demographics.cd_marital_status = 'S') AND (customer_demographics.cd_education_status = 'College')) AND ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00))) AND (household_demographics.hd_dep_count = 1))) OR ((((customer_demographics.cd_marital_status = 'M') AND (customer_demographics.cd_education_status = '4 yr Degree')) AND ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00))) AND (household_demographics.hd_dep_count = 1))) ------------------------PhysicalProject ---------------------------filter(((((cast(cd_marital_status as VARCHAR(*)) = 'D') AND (cast(cd_education_status as VARCHAR(*)) = 'Unknown')) OR ((cast(cd_marital_status as VARCHAR(*)) = 'S') AND (cast(cd_education_status as VARCHAR(*)) = 'College'))) OR ((cast(cd_marital_status as VARCHAR(*)) = 'M') AND (cast(cd_education_status as VARCHAR(*)) = '4 yr Degree')))) +--------------------------filter(((((customer_demographics.cd_marital_status = 'D') AND (customer_demographics.cd_education_status = 'Unknown')) OR ((customer_demographics.cd_marital_status = 'S') AND (customer_demographics.cd_education_status = 'College'))) OR ((customer_demographics.cd_marital_status = 'M') AND (customer_demographics.cd_education_status = '4 yr Degree')))) ----------------------------PhysicalOlapScan[customer_demographics] ------------------------PhysicalDistribute --------------------------hashJoin[INNER_JOIN](store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk) diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query16.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query16.out index 7167ef0b0c35c3..1a6709b3b54619 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query16.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query16.out @@ -25,7 +25,7 @@ PhysicalResultSink --------------------------------PhysicalOlapScan[catalog_sales] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------filter((cast(ca_state as VARCHAR(*)) = 'WV')) +----------------------------------filter((customer_address.ca_state = 'WV')) ------------------------------------PhysicalOlapScan[customer_address] ----------------------------PhysicalDistribute ------------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query17.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query17.out index dddca95770a81a..b238c38de00eec 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query17.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query17.out @@ -31,7 +31,7 @@ PhysicalResultSink ----------------------------------------------PhysicalOlapScan[store_sales] --------------------------------------------PhysicalDistribute ----------------------------------------------PhysicalProject -------------------------------------------------filter((cast(d_quarter_name as VARCHAR(*)) = '2001Q1')) +------------------------------------------------filter((d1.d_quarter_name = '2001Q1')) --------------------------------------------------PhysicalOlapScan[date_dim] --------------------------------------PhysicalDistribute ----------------------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query18.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query18.out index 9ab6b66e7073d6..b136f2c263aaf1 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query18.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query18.out @@ -33,7 +33,7 @@ PhysicalResultSink --------------------------------------------------PhysicalOlapScan[catalog_sales] ------------------------------------------------PhysicalDistribute --------------------------------------------------PhysicalProject -----------------------------------------------------filter((cast(cd_gender as VARCHAR(*)) = 'F')(cast(cd_education_status as VARCHAR(*)) = 'Advanced Degree')) +----------------------------------------------------filter((cd1.cd_education_status = 'Advanced Degree')(cd1.cd_gender = 'F')) ------------------------------------------------------PhysicalOlapScan[customer_demographics] --------------------------------------------PhysicalDistribute ----------------------------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query24.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query24.out index a0c2e48384b270..0a0601bc0f68ac 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query24.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query24.out @@ -45,7 +45,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ------------------hashAgg[LOCAL] --------------------PhysicalDistribute ----------------------PhysicalProject -------------------------filter((cast(i_color as VARCHAR(*)) = 'beige')) +------------------------filter((ssales.i_color = 'beige')) --------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) --------------PhysicalDistribute ----------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query26.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query26.out index cdffd94d108e07..04a98730cf6633 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query26.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query26.out @@ -18,7 +18,7 @@ PhysicalResultSink ------------------------------PhysicalOlapScan[catalog_sales] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter((cast(cd_education_status as VARCHAR(*)) = 'Unknown')(cast(cd_gender as VARCHAR(*)) = 'M')(cast(cd_marital_status as VARCHAR(*)) = 'S')) +--------------------------------filter((customer_demographics.cd_gender = 'M')(customer_demographics.cd_marital_status = 'S')(customer_demographics.cd_education_status = 'Unknown')) ----------------------------------PhysicalOlapScan[customer_demographics] --------------------------PhysicalDistribute ----------------------------PhysicalProject @@ -26,7 +26,7 @@ PhysicalResultSink --------------------------------PhysicalOlapScan[date_dim] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------filter(((cast(p_channel_email as VARCHAR(*)) = 'N') OR (cast(p_channel_event as VARCHAR(*)) = 'N'))) +--------------------------filter(((promotion.p_channel_email = 'N') OR (promotion.p_channel_event = 'N'))) ----------------------------PhysicalOlapScan[promotion] ------------------PhysicalDistribute --------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out index 81fad1aff1d21e..00cb9a518855d6 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query27.out @@ -21,7 +21,7 @@ PhysicalResultSink ------------------------------------PhysicalOlapScan[store_sales] ----------------------------------PhysicalDistribute ------------------------------------PhysicalProject ---------------------------------------filter((cast(cd_gender as VARCHAR(*)) = 'F')(cast(cd_education_status as VARCHAR(*)) = 'Secondary')(cast(cd_marital_status as VARCHAR(*)) = 'D')) +--------------------------------------filter((customer_demographics.cd_education_status = 'Secondary')(customer_demographics.cd_marital_status = 'D')(customer_demographics.cd_gender = 'F')) ----------------------------------------PhysicalOlapScan[customer_demographics] --------------------------------PhysicalDistribute ----------------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out index acc9901970b6eb..55de401bc4f490 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query30.out @@ -35,7 +35,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ------------------------PhysicalOlapScan[customer] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------filter((cast(ca_state as VARCHAR(*)) = 'IN')) +--------------------------filter((customer_address.ca_state = 'IN')) ----------------------------PhysicalOlapScan[customer_address] --------------PhysicalDistribute ----------------hashAgg[GLOBAL] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query34.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query34.out index 47791447659dd7..504194d074f9f8 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query34.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query34.out @@ -25,7 +25,7 @@ PhysicalResultSink ------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter(((cast(hd_buy_potential as VARCHAR(*)) = '1001-5000') OR (cast(hd_buy_potential as VARCHAR(*)) = '0-500'))(household_demographics.hd_vehicle_count > 0)(if((hd_vehicle_count > 0), (cast(hd_dep_count as DOUBLE) / cast(hd_vehicle_count as DOUBLE)), NULL) > 1.2)) +--------------------------------filter(hd_buy_potential IN ('1001-5000', '0-500')(household_demographics.hd_vehicle_count > 0)(if((hd_vehicle_count > 0), (cast(hd_dep_count as DOUBLE) / cast(hd_vehicle_count as DOUBLE)), NULL) > 1.2)) ----------------------------------PhysicalOlapScan[household_demographics] --------------------------PhysicalDistribute ----------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out index 640b5577432697..a784f31be987c6 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query4.out @@ -84,7 +84,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) --------------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------filter((t_c_secyear.sale_type = 'c')(t_c_secyear.dyear = 2000)) +--------------------------filter((t_c_secyear.dyear = 2000)(t_c_secyear.sale_type = 'c')) ----------------------------PhysicalCteConsumer ( cteId=CTEId#0 ) ------------------PhysicalDistribute --------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query41.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query41.out index 964e2d8aec9604..d60ffc848136fb 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query41.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query41.out @@ -19,6 +19,6 @@ PhysicalResultSink --------------------------PhysicalDistribute ----------------------------hashAgg[LOCAL] ------------------------------PhysicalProject ---------------------------------filter((((((((((((cast(i_category as VARCHAR(*)) = 'Women') AND ((cast(i_color as VARCHAR(*)) = 'gainsboro') OR (cast(i_color as VARCHAR(*)) = 'aquamarine'))) AND ((cast(i_units as VARCHAR(*)) = 'Ounce') OR (cast(i_units as VARCHAR(*)) = 'Dozen'))) AND ((cast(i_size as VARCHAR(*)) = 'medium') OR (cast(i_size as VARCHAR(*)) = 'economy'))) OR ((((cast(i_category as VARCHAR(*)) = 'Women') AND ((cast(i_color as VARCHAR(*)) = 'chiffon') OR (cast(i_color as VARCHAR(*)) = 'violet'))) AND ((cast(i_units as VARCHAR(*)) = 'Ton') OR (cast(i_units as VARCHAR(*)) = 'Pound'))) AND ((cast(i_size as VARCHAR(*)) = 'extra large') OR (cast(i_size as VARCHAR(*)) = 'small')))) OR ((((cast(i_category as VARCHAR(*)) = 'Women') AND ((cast(i_color as VARCHAR(*)) = 'blanched') OR (cast(i_color as VARCHAR(*)) = 'tomato'))) AND ((cast(i_units as VARCHAR(*)) = 'Tbl') OR (cast(i_units as VARCHAR(*)) = 'Case'))) AND ((cast(i_size as VARCHAR(*)) = 'medium') OR (cast(i_size as VARCHAR(*)) = 'economy')))) OR ((((cast(i_category as VARCHAR(*)) = 'Women') AND ((cast(i_color as VARCHAR(*)) = 'almond') OR (cast(i_color as VARCHAR(*)) = 'lime'))) AND ((cast(i_units as VARCHAR(*)) = 'Box') OR (cast(i_units as VARCHAR(*)) = 'Dram'))) AND ((cast(i_size as VARCHAR(*)) = 'extra large') OR (cast(i_size as VARCHAR(*)) = 'small')))) OR ((((cast(i_category as VARCHAR(*)) = 'Men') AND ((cast(i_color as VARCHAR(*)) = 'chartreuse') OR (cast(i_color as VARCHAR(*)) = 'blue'))) AND ((cast(i_units as VARCHAR(*)) = 'Each') OR (cast(i_units as VARCHAR(*)) = 'Oz'))) AND ((cast(i_size as VARCHAR(*)) = 'N/A') OR (cast(i_size as VARCHAR(*)) = 'large')))) OR ((((cast(i_category as VARCHAR(*)) = 'Men') AND ((cast(i_color as VARCHAR(*)) = 'tan') OR (cast(i_color as VARCHAR(*)) = 'dodger'))) AND ((cast(i_units as VARCHAR(*)) = 'Bunch') OR (cast(i_units as VARCHAR(*)) = 'Tsp'))) AND ((cast(i_size as VARCHAR(*)) = 'medium') OR (cast(i_size as VARCHAR(*)) = 'economy')))) OR ((((cast(i_category as VARCHAR(*)) = 'Men') AND ((cast(i_color as VARCHAR(*)) = 'peru') OR (cast(i_color as VARCHAR(*)) = 'saddle'))) AND ((cast(i_units as VARCHAR(*)) = 'Pallet') OR (cast(i_units as VARCHAR(*)) = 'Gram'))) AND ((cast(i_size as VARCHAR(*)) = 'N/A') OR (cast(i_size as VARCHAR(*)) = 'large')))) OR ((((cast(i_category as VARCHAR(*)) = 'Men') AND ((cast(i_color as VARCHAR(*)) = 'indian') OR (cast(i_color as VARCHAR(*)) = 'spring'))) AND ((cast(i_units as VARCHAR(*)) = 'Unknown') OR (cast(i_units as VARCHAR(*)) = 'Carton'))) AND ((cast(i_size as VARCHAR(*)) = 'medium') OR (cast(i_size as VARCHAR(*)) = 'economy'))))) +--------------------------------filter((((((((((((item.i_category = 'Women') AND i_color IN ('aquamarine', 'gainsboro')) AND i_units IN ('Dozen', 'Ounce')) AND i_size IN ('economy', 'medium')) OR ((((item.i_category = 'Women') AND i_color IN ('violet', 'chiffon')) AND i_units IN ('Pound', 'Ton')) AND i_size IN ('small', 'extra large'))) OR ((((item.i_category = 'Women') AND i_color IN ('tomato', 'blanched')) AND i_units IN ('Case', 'Tbl')) AND i_size IN ('economy', 'medium'))) OR ((((item.i_category = 'Women') AND i_color IN ('lime', 'almond')) AND i_units IN ('Dram', 'Box')) AND i_size IN ('small', 'extra large'))) OR ((((item.i_category = 'Men') AND i_color IN ('chartreuse', 'blue')) AND i_units IN ('Each', 'Oz')) AND i_size IN ('large', 'N/A'))) OR ((((item.i_category = 'Men') AND i_color IN ('tan', 'dodger')) AND i_units IN ('Tsp', 'Bunch')) AND i_size IN ('economy', 'medium'))) OR ((((item.i_category = 'Men') AND i_color IN ('peru', 'saddle')) AND i_units IN ('Pallet', 'Gram')) AND i_size IN ('large', 'N/A'))) OR ((((item.i_category = 'Men') AND i_color IN ('spring', 'indian')) AND i_units IN ('Unknown', 'Carton')) AND i_size IN ('economy', 'medium')))) ----------------------------------PhysicalOlapScan[item] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query48.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query48.out index cc6e4167aed22d..9d1b3575094e64 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query48.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query48.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------hashJoin[INNER_JOIN](store_sales.ss_sold_date_sk = date_dim.d_date_sk) ------------------PhysicalDistribute --------------------PhysicalProject -----------------------hashJoin[INNER_JOIN](customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)(((((cast(cd_marital_status as VARCHAR(*)) = 'U') AND (cast(cd_education_status as VARCHAR(*)) = 'Primary')) AND ((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00))) OR (((cast(cd_marital_status as VARCHAR(*)) = 'W') AND (cast(cd_education_status as VARCHAR(*)) = 'College')) AND ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00)))) OR (((cast(cd_marital_status as VARCHAR(*)) = 'D') AND (cast(cd_education_status as VARCHAR(*)) = '2 yr Degree')) AND ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00)))) +----------------------hashJoin[INNER_JOIN](customer_demographics.cd_demo_sk = store_sales.ss_cdemo_sk)(((((customer_demographics.cd_marital_status = 'U') AND (customer_demographics.cd_education_status = 'Primary')) AND ((store_sales.ss_sales_price >= 100.00) AND (store_sales.ss_sales_price <= 150.00))) OR (((customer_demographics.cd_marital_status = 'W') AND (customer_demographics.cd_education_status = 'College')) AND ((store_sales.ss_sales_price >= 50.00) AND (store_sales.ss_sales_price <= 100.00)))) OR (((customer_demographics.cd_marital_status = 'D') AND (customer_demographics.cd_education_status = '2 yr Degree')) AND ((store_sales.ss_sales_price >= 150.00) AND (store_sales.ss_sales_price <= 200.00)))) ------------------------PhysicalDistribute --------------------------hashJoin[INNER_JOIN](store_sales.ss_addr_sk = customer_address.ca_address_sk)(((ca_state IN ('MD', 'MN', 'IA') AND ((store_sales.ss_net_profit >= 0.00) AND (store_sales.ss_net_profit <= 2000.00))) OR (ca_state IN ('VA', 'IL', 'TX') AND ((store_sales.ss_net_profit >= 150.00) AND (store_sales.ss_net_profit <= 3000.00)))) OR (ca_state IN ('MI', 'WI', 'IN') AND ((store_sales.ss_net_profit >= 50.00) AND (store_sales.ss_net_profit <= 25000.00)))) ----------------------------PhysicalProject @@ -23,7 +23,7 @@ PhysicalResultSink ----------------------------------PhysicalOlapScan[customer_address] ------------------------PhysicalDistribute --------------------------PhysicalProject -----------------------------filter(((((cast(cd_marital_status as VARCHAR(*)) = 'U') AND (cast(cd_education_status as VARCHAR(*)) = 'Primary')) OR ((cast(cd_marital_status as VARCHAR(*)) = 'W') AND (cast(cd_education_status as VARCHAR(*)) = 'College'))) OR ((cast(cd_marital_status as VARCHAR(*)) = 'D') AND (cast(cd_education_status as VARCHAR(*)) = '2 yr Degree')))) +----------------------------filter(((((customer_demographics.cd_marital_status = 'U') AND (customer_demographics.cd_education_status = 'Primary')) OR ((customer_demographics.cd_marital_status = 'W') AND (customer_demographics.cd_education_status = 'College'))) OR ((customer_demographics.cd_marital_status = 'D') AND (customer_demographics.cd_education_status = '2 yr Degree')))) ------------------------------PhysicalOlapScan[customer_demographics] ------------------PhysicalDistribute --------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out index 2d9cb0d75d34c6..f12974631c6289 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query54.out @@ -52,7 +52,7 @@ PhysicalResultSink --------------------------------------------------------------------------------PhysicalOlapScan[web_sales] --------------------------------------------------------------------------PhysicalDistribute ----------------------------------------------------------------------------PhysicalProject -------------------------------------------------------------------------------filter((cast(i_class as VARCHAR(*)) = 'maternity')(cast(i_category as VARCHAR(*)) = 'Women')) +------------------------------------------------------------------------------filter((item.i_class = 'maternity')(item.i_category = 'Women')) --------------------------------------------------------------------------------PhysicalOlapScan[item] ----------------------------------------------------------------------PhysicalDistribute ------------------------------------------------------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query61.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query61.out index 69f00c102e4291..e557ed58f537e7 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query61.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query61.out @@ -11,7 +11,7 @@ PhysicalResultSink ----------------PhysicalProject ------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) --------------------PhysicalProject -----------------------filter((cast(i_category as VARCHAR(*)) = 'Jewelry')) +----------------------filter((item.i_category = 'Jewelry')) ------------------------PhysicalOlapScan[item] --------------------PhysicalDistribute ----------------------PhysicalProject @@ -40,7 +40,7 @@ PhysicalResultSink ----------------------------------------------------PhysicalOlapScan[store] ------------------------------------------PhysicalDistribute --------------------------------------------PhysicalProject -----------------------------------------------filter((((cast(p_channel_dmail as VARCHAR(*)) = 'Y') OR (cast(p_channel_email as VARCHAR(*)) = 'Y')) OR (cast(p_channel_tv as VARCHAR(*)) = 'Y'))) +----------------------------------------------filter((((promotion.p_channel_dmail = 'Y') OR (promotion.p_channel_email = 'Y')) OR (promotion.p_channel_tv = 'Y'))) ------------------------------------------------PhysicalOlapScan[promotion] --------------------------------------PhysicalDistribute ----------------------------------------PhysicalProject @@ -53,7 +53,7 @@ PhysicalResultSink ------------------PhysicalProject --------------------hashJoin[INNER_JOIN](store_sales.ss_item_sk = item.i_item_sk) ----------------------PhysicalProject -------------------------filter((cast(i_category as VARCHAR(*)) = 'Jewelry')) +------------------------filter((item.i_category = 'Jewelry')) --------------------------PhysicalOlapScan[item] ----------------------PhysicalDistribute ------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query7.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query7.out index 574836334751d6..279d0178403a46 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query7.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query7.out @@ -18,7 +18,7 @@ PhysicalResultSink ------------------------------PhysicalOlapScan[store_sales] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter((cast(cd_marital_status as VARCHAR(*)) = 'W')(cast(cd_education_status as VARCHAR(*)) = 'College')(cast(cd_gender as VARCHAR(*)) = 'F')) +--------------------------------filter((customer_demographics.cd_gender = 'F')(customer_demographics.cd_marital_status = 'W')(customer_demographics.cd_education_status = 'College')) ----------------------------------PhysicalOlapScan[customer_demographics] --------------------------PhysicalDistribute ----------------------------PhysicalProject @@ -26,7 +26,7 @@ PhysicalResultSink --------------------------------PhysicalOlapScan[date_dim] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------filter(((cast(p_channel_email as VARCHAR(*)) = 'N') OR (cast(p_channel_event as VARCHAR(*)) = 'N'))) +--------------------------filter(((promotion.p_channel_email = 'N') OR (promotion.p_channel_event = 'N'))) ----------------------------PhysicalOlapScan[promotion] ------------------PhysicalDistribute --------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out index 512604bb57e66e..4c1c5b51b79778 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query71.out @@ -47,6 +47,6 @@ PhysicalResultSink ------------------------------PhysicalOlapScan[item] ------------------PhysicalDistribute --------------------PhysicalProject -----------------------filter(((cast(t_meal_time as VARCHAR(*)) = 'breakfast') OR (cast(t_meal_time as VARCHAR(*)) = 'dinner'))) +----------------------filter(t_meal_time IN ('breakfast', 'dinner')) ------------------------PhysicalOlapScan[time_dim] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query72.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query72.out index 08b478c499f5d0..04dc3a44d6815e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query72.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query72.out @@ -37,7 +37,7 @@ PhysicalResultSink ------------------------------------------------------------PhysicalOlapScan[catalog_sales] ----------------------------------------------------------PhysicalDistribute ------------------------------------------------------------PhysicalProject ---------------------------------------------------------------filter((cast(hd_buy_potential as VARCHAR(*)) = '501-1000')) +--------------------------------------------------------------filter((household_demographics.hd_buy_potential = '501-1000')) ----------------------------------------------------------------PhysicalOlapScan[household_demographics] --------------------------------------------------------PhysicalDistribute ----------------------------------------------------------PhysicalProject @@ -45,7 +45,7 @@ PhysicalResultSink --------------------------------------------------------------PhysicalOlapScan[date_dim] ----------------------------------------------------PhysicalDistribute ------------------------------------------------------PhysicalProject ---------------------------------------------------------filter((cast(cd_marital_status as VARCHAR(*)) = 'W')) +--------------------------------------------------------filter((customer_demographics.cd_marital_status = 'W')) ----------------------------------------------------------PhysicalOlapScan[customer_demographics] ------------------------------------------------PhysicalDistribute --------------------------------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query73.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query73.out index 534e5f4477519a..0b350fd5018728 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query73.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query73.out @@ -25,7 +25,7 @@ PhysicalResultSink ------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter(((cast(hd_buy_potential as VARCHAR(*)) = '501-1000') OR (cast(hd_buy_potential as VARCHAR(*)) = 'Unknown'))(household_demographics.hd_vehicle_count > 0)(if((hd_vehicle_count > 0), (cast(hd_dep_count as DOUBLE) / cast(hd_vehicle_count as DOUBLE)), NULL) > 1)) +--------------------------------filter(hd_buy_potential IN ('501-1000', 'Unknown')(household_demographics.hd_vehicle_count > 0)(if((hd_vehicle_count > 0), (cast(hd_dep_count as DOUBLE) / cast(hd_vehicle_count as DOUBLE)), NULL) > 1)) ----------------------------------PhysicalOlapScan[household_demographics] --------------------------PhysicalDistribute ----------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out index 50de18777c8ebd..96fe757f6e91a4 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query75.out @@ -19,7 +19,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ----------------------------PhysicalOlapScan[catalog_sales] --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) +------------------------------filter((item.i_category = 'Home')) --------------------------------PhysicalOlapScan[item] ------------------------PhysicalDistribute --------------------------PhysicalProject @@ -37,7 +37,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ----------------------------PhysicalOlapScan[store_sales] --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) +------------------------------filter((item.i_category = 'Home')) --------------------------------PhysicalOlapScan[item] ------------------------PhysicalDistribute --------------------------PhysicalProject @@ -55,7 +55,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ----------------------------PhysicalOlapScan[web_sales] --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------filter((cast(i_category as VARCHAR(*)) = 'Home')) +------------------------------filter((item.i_category = 'Home')) --------------------------------PhysicalOlapScan[item] ------------------------PhysicalDistribute --------------------------PhysicalProject diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out index 2c6d8aff03ad51..8b1e9d5c7baa1b 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query8.out @@ -40,6 +40,6 @@ PhysicalResultSink ------------------------------------------PhysicalOlapScan[customer_address] ----------------------------------------PhysicalDistribute ------------------------------------------PhysicalProject ---------------------------------------------filter((cast(c_preferred_cust_flag as VARCHAR(*)) = 'Y')) +--------------------------------------------filter((customer.c_preferred_cust_flag = 'Y')) ----------------------------------------------PhysicalOlapScan[customer] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out index f639427dcbb229..9c9f5b4ffe9bd0 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query80.out @@ -29,7 +29,7 @@ PhysicalResultSink ----------------------------------------filter((item.i_current_price > 50.00)) ------------------------------------------PhysicalOlapScan[item] ------------------------------------PhysicalDistribute ---------------------------------------filter((cast(p_channel_tv as VARCHAR(*)) = 'N')) +--------------------------------------filter((promotion.p_channel_tv = 'N')) ----------------------------------------PhysicalOlapScan[promotion] ----------------------------------PhysicalDistribute ------------------------------------PhysicalProject @@ -53,7 +53,7 @@ PhysicalResultSink ----------------------------------------filter((item.i_current_price > 50.00)) ------------------------------------------PhysicalOlapScan[item] ------------------------------------PhysicalDistribute ---------------------------------------filter((cast(p_channel_tv as VARCHAR(*)) = 'N')) +--------------------------------------filter((promotion.p_channel_tv = 'N')) ----------------------------------------PhysicalOlapScan[promotion] ----------------------------------PhysicalDistribute ------------------------------------PhysicalProject @@ -76,7 +76,7 @@ PhysicalResultSink ----------------------------------------------filter((date_dim.d_date >= 1998-08-28)(date_dim.d_date <= 1998-09-27)) ------------------------------------------------PhysicalOlapScan[date_dim] ------------------------------------------PhysicalDistribute ---------------------------------------------filter((cast(p_channel_tv as VARCHAR(*)) = 'N')) +--------------------------------------------filter((promotion.p_channel_tv = 'N')) ----------------------------------------------PhysicalOlapScan[promotion] --------------------------------------PhysicalDistribute ----------------------------------------filter((item.i_current_price > 50.00)) diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out index bfcec6ce4127f4..121a01f32e8a88 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query81.out @@ -35,7 +35,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ------------------------PhysicalOlapScan[customer] ----------------------PhysicalDistribute ------------------------PhysicalProject ---------------------------filter((cast(ca_state as VARCHAR(*)) = 'CA')) +--------------------------filter((customer_address.ca_state = 'CA')) ----------------------------PhysicalOlapScan[customer_address] --------------PhysicalDistribute ----------------hashAgg[GLOBAL] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query85.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query85.out index f51819a36728bd..24ab560b06c3f2 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query85.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query85.out @@ -24,9 +24,9 @@ PhysicalResultSink ----------------------------------PhysicalOlapScan[customer_demographics] --------------------------------PhysicalDistribute ----------------------------------PhysicalProject -------------------------------------hashJoin[INNER_JOIN](cd1.cd_demo_sk = web_returns.wr_refunded_cdemo_sk)(((((cast(cd_marital_status as VARCHAR(*)) = 'M') AND (cast(cd_education_status as VARCHAR(*)) = '4 yr Degree')) AND ((web_sales.ws_sales_price >= 100.00) AND (web_sales.ws_sales_price <= 150.00))) OR (((cast(cd_marital_status as VARCHAR(*)) = 'S') AND (cast(cd_education_status as VARCHAR(*)) = 'Secondary')) AND ((web_sales.ws_sales_price >= 50.00) AND (web_sales.ws_sales_price <= 100.00)))) OR (((cast(cd_marital_status as VARCHAR(*)) = 'W') AND (cast(cd_education_status as VARCHAR(*)) = 'Advanced Degree')) AND ((web_sales.ws_sales_price >= 150.00) AND (web_sales.ws_sales_price <= 200.00)))) +------------------------------------hashJoin[INNER_JOIN](cd1.cd_demo_sk = web_returns.wr_refunded_cdemo_sk)(((((cd1.cd_marital_status = 'M') AND (cd1.cd_education_status = '4 yr Degree')) AND ((web_sales.ws_sales_price >= 100.00) AND (web_sales.ws_sales_price <= 150.00))) OR (((cd1.cd_marital_status = 'S') AND (cd1.cd_education_status = 'Secondary')) AND ((web_sales.ws_sales_price >= 50.00) AND (web_sales.ws_sales_price <= 100.00)))) OR (((cd1.cd_marital_status = 'W') AND (cd1.cd_education_status = 'Advanced Degree')) AND ((web_sales.ws_sales_price >= 150.00) AND (web_sales.ws_sales_price <= 200.00)))) --------------------------------------PhysicalProject -----------------------------------------filter(((((cast(cd_marital_status as VARCHAR(*)) = 'M') AND (cast(cd_education_status as VARCHAR(*)) = '4 yr Degree')) OR ((cast(cd_marital_status as VARCHAR(*)) = 'S') AND (cast(cd_education_status as VARCHAR(*)) = 'Secondary'))) OR ((cast(cd_marital_status as VARCHAR(*)) = 'W') AND (cast(cd_education_status as VARCHAR(*)) = 'Advanced Degree')))) +----------------------------------------filter(((((cd1.cd_marital_status = 'M') AND (cd1.cd_education_status = '4 yr Degree')) OR ((cd1.cd_marital_status = 'S') AND (cd1.cd_education_status = 'Secondary'))) OR ((cd1.cd_marital_status = 'W') AND (cd1.cd_education_status = 'Advanced Degree')))) ------------------------------------------PhysicalOlapScan[customer_demographics] --------------------------------------PhysicalDistribute ----------------------------------------hashJoin[INNER_JOIN](customer_address.ca_address_sk = web_returns.wr_refunded_addr_sk)(((ca_state IN ('FL', 'TX', 'DE') AND ((web_sales.ws_net_profit >= 100.00) AND (web_sales.ws_net_profit <= 200.00))) OR (ca_state IN ('IN', 'ND', 'ID') AND ((web_sales.ws_net_profit >= 150.00) AND (web_sales.ws_net_profit <= 300.00)))) OR (ca_state IN ('MT', 'IL', 'OH') AND ((web_sales.ws_net_profit >= 50.00) AND (web_sales.ws_net_profit <= 250.00)))) diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out index 1e3674e05365b9..ecb3ba35ace5c0 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query91.out @@ -18,7 +18,7 @@ PhysicalResultSink ------------------------hashJoin[INNER_JOIN](customer_demographics.cd_demo_sk = customer.c_current_cdemo_sk) --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------filter((((cast(cd_marital_status as VARCHAR(*)) = 'M') AND (cast(cd_education_status as VARCHAR(*)) = 'Unknown')) OR ((cast(cd_marital_status as VARCHAR(*)) = 'W') AND (cast(cd_education_status as VARCHAR(*)) = 'Advanced Degree')))) +------------------------------filter((((customer_demographics.cd_marital_status = 'M') AND (customer_demographics.cd_education_status = 'Unknown')) OR ((customer_demographics.cd_marital_status = 'W') AND (customer_demographics.cd_education_status = 'Advanced Degree')))) --------------------------------PhysicalOlapScan[customer_demographics] --------------------------PhysicalDistribute ----------------------------hashJoin[INNER_JOIN](household_demographics.hd_demo_sk = customer.c_current_hdemo_sk) diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query93.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query93.out index 0ead46c8d739e0..cc6eba640d6693 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query93.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query93.out @@ -16,6 +16,6 @@ PhysicalResultSink ----------------------PhysicalOlapScan[store_returns] --------------------PhysicalDistribute ----------------------PhysicalProject -------------------------filter((cast(r_reason_desc as VARCHAR(*)) = 'duplicate purchase')) +------------------------filter((reason.r_reason_desc = 'duplicate purchase')) --------------------------PhysicalOlapScan[reason] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out index 970cc6eb7c4e54..5fb17f0be15da4 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query94.out @@ -25,7 +25,7 @@ PhysicalResultSink --------------------------------PhysicalOlapScan[web_sales] ------------------------------PhysicalDistribute --------------------------------PhysicalProject -----------------------------------filter((cast(ca_state as VARCHAR(*)) = 'OK')) +----------------------------------filter((customer_address.ca_state = 'OK')) ------------------------------------PhysicalOlapScan[customer_address] ----------------------------PhysicalDistribute ------------------------------PhysicalProject @@ -33,6 +33,6 @@ PhysicalResultSink ----------------------------------PhysicalOlapScan[date_dim] --------------------------PhysicalDistribute ----------------------------PhysicalProject -------------------------------filter((cast(web_company_name as VARCHAR(*)) = 'pri')) +------------------------------filter((web_site.web_company_name = 'pri')) --------------------------------PhysicalOlapScan[web_site] diff --git a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query95.out b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query95.out index f4b0cac33931bd..9d14722937730e 100644 --- a/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query95.out +++ b/regression-test/data/nereids_tpcds_shape_sf100_p0/shape/query95.out @@ -40,7 +40,7 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ----------------------------------PhysicalOlapScan[web_sales] --------------------------------PhysicalDistribute ----------------------------------PhysicalProject -------------------------------------filter((cast(ca_state as VARCHAR(*)) = 'NC')) +------------------------------------filter((customer_address.ca_state = 'NC')) --------------------------------------PhysicalOlapScan[customer_address] ------------------------------PhysicalDistribute --------------------------------PhysicalProject @@ -48,6 +48,6 @@ PhysicalCteAnchor ( cteId=CTEId#0 ) ------------------------------------PhysicalOlapScan[date_dim] ----------------------------PhysicalDistribute ------------------------------PhysicalProject ---------------------------------filter((cast(web_company_name as VARCHAR(*)) = 'pri')) +--------------------------------filter((web_site.web_company_name = 'pri')) ----------------------------------PhysicalOlapScan[web_site] diff --git a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q19.out b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q19.out index 44f7c223f11375..a5bc461b44c791 100644 --- a/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q19.out +++ b/regression-test/data/nereids_tpch_shape_sf1000_p0/shape/q19.out @@ -11,6 +11,6 @@ PhysicalResultSink ----------------PhysicalOlapScan[lineitem] ------------PhysicalDistribute --------------PhysicalProject -----------------filter((((((part.p_brand = 'Brand#12') AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')) AND (part.p_size <= 5)) OR (((part.p_brand = 'Brand#23') AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')) AND (part.p_size <= 10))) OR (((part.p_brand = 'Brand#34') AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')) AND (part.p_size <= 15)))(part.p_size >= 1)) +----------------filter((part.p_size >= 1)(((((part.p_brand = 'Brand#12') AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')) AND (part.p_size <= 5)) OR (((part.p_brand = 'Brand#23') AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')) AND (part.p_size <= 10))) OR (((part.p_brand = 'Brand#34') AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')) AND (part.p_size <= 15)))) ------------------PhysicalOlapScan[part] diff --git a/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q19.out b/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q19.out index 44f7c223f11375..a5bc461b44c791 100644 --- a/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q19.out +++ b/regression-test/data/nereids_tpch_shape_sf500_p0/shape/q19.out @@ -11,6 +11,6 @@ PhysicalResultSink ----------------PhysicalOlapScan[lineitem] ------------PhysicalDistribute --------------PhysicalProject -----------------filter((((((part.p_brand = 'Brand#12') AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')) AND (part.p_size <= 5)) OR (((part.p_brand = 'Brand#23') AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')) AND (part.p_size <= 10))) OR (((part.p_brand = 'Brand#34') AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')) AND (part.p_size <= 15)))(part.p_size >= 1)) +----------------filter((part.p_size >= 1)(((((part.p_brand = 'Brand#12') AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')) AND (part.p_size <= 5)) OR (((part.p_brand = 'Brand#23') AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')) AND (part.p_size <= 10))) OR (((part.p_brand = 'Brand#34') AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')) AND (part.p_size <= 15)))) ------------------PhysicalOlapScan[part] diff --git a/regression-test/suites/nereids_p0/join/bucket_shuffle_join.groovy b/regression-test/suites/nereids_p0/join/bucket_shuffle_join.groovy index f4bac3d2b63785..6d8f4f60294877 100644 --- a/regression-test/suites/nereids_p0/join/bucket_shuffle_join.groovy +++ b/regression-test/suites/nereids_p0/join/bucket_shuffle_join.groovy @@ -72,7 +72,7 @@ suite("bucket-shuffle-join") { explain { sql("select * from shuffle_join_t1 t1 left join shuffle_join_t2 t2 on t1.a = t2.c;") contains "BUCKET_SHUFFLE" - contains "BUCKET_SHFFULE_HASH_PARTITIONED: expr_cast(c as VARCHAR(*))" + contains "BUCKET_SHFFULE_HASH_PARTITIONED: c" } }