This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit d2f3cf97a299591d644b85d3781ff830edff65ab
Author: Chris Hajas <[email protected]>
AuthorDate: Thu Aug 10 15:37:39 2023 -0700

    Remove ExmiPlStmt2DXLConversion error label in Orca
    
    This doesn't make sense, as we don't translate the plan statement to
    DXL. This was being used for query objects, so change these to Query2DXL
    labels instead
---
 .../gpopt/translate/CTranslatorDXLToScalar.cpp       |  4 ++--
 .../gpopt/translate/CTranslatorScalarToDXL.cpp       | 10 +++++-----
 src/backend/gpopt/translate/CTranslatorUtils.cpp     |  2 +-
 src/backend/gporca/libgpos/src/_api.cpp              |  2 --
 .../libnaucrates/include/naucrates/exception.h       |  1 -
 src/backend/gporca/libnaucrates/src/exception.cpp    | 20 ++++++--------------
 6 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp 
b/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp
index 0160180127..13f626c561 100644
--- a/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp
+++ b/src/backend/gpopt/translate/CTranslatorDXLToScalar.cpp
@@ -456,7 +456,7 @@ CTranslatorDXLToScalar::TranslateDXLScalarArrayCompToScalar(
 
                default:
                        GPOS_RAISE(
-                               gpdxl::ExmaDXL, gpdxl::ExmiPlStmt2DXLConversion,
+                               gpdxl::ExmaDXL, gpdxl::ExmiDXL2PlStmtConversion,
                                GPOS_WSZ_LIT(
                                        "Scalar Array Comparison: Specified 
operator type is invalid"));
        }
@@ -588,7 +588,7 @@ CTranslatorDXLToScalar::TranslateDXLScalarAggrefToScalar(
                        break;
                default:
                        GPOS_RAISE(
-                               gpdxl::ExmaDXL, gpdxl::ExmiPlStmt2DXLConversion,
+                               gpdxl::ExmaDXL, gpdxl::ExmiDXL2PlStmtConversion,
                                GPOS_WSZ_LIT("AGGREF: Specified AggStage value 
is invalid"));
        }
 
diff --git a/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp 
b/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp
index b8b7b245d3..c934cab4e1 100644
--- a/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp
+++ b/src/backend/gpopt/translate/CTranslatorScalarToDXL.cpp
@@ -769,14 +769,14 @@ CTranslatorScalarToDXL::TranslateBoolExprToDXL(
        if ((NOT_EXPR != bool_expr->boolop) && (2 > count))
        {
                GPOS_RAISE(
-                       gpdxl::ExmaDXL, gpdxl::ExmiPlStmt2DXLConversion,
+                       gpdxl::ExmaDXL, gpdxl::ExmiQuery2DXLUnsupportedFeature,
                        GPOS_WSZ_LIT(
                                "Boolean Expression (OR / AND): Incorrect 
Number of Children "));
        }
        else if ((NOT_EXPR == bool_expr->boolop) && (1 != count))
        {
                GPOS_RAISE(
-                       gpdxl::ExmaDXL, gpdxl::ExmiPlStmt2DXLConversion,
+                       gpdxl::ExmaDXL, gpdxl::ExmiQuery2DXLUnsupportedFeature,
                        GPOS_WSZ_LIT(
                                "Boolean Expression (NOT): Incorrect Number of 
Children "));
        }
@@ -988,8 +988,8 @@ CTranslatorScalarToDXL::TranslateCaseExprToDXL(
 
        if (nullptr == case_expr->args)
        {
-               GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiPlStmt2DXLConversion,
-                                  GPOS_WSZ_LIT("Do not support SIMPLE CASE 
STATEMENT"));
+               GPOS_RAISE(gpdxl::ExmaDXL, 
gpdxl::ExmiQuery2DXLUnsupportedFeature,
+                                  GPOS_WSZ_LIT("Case statement with no 
arguments"));
                return nullptr;
        }
 
@@ -1590,7 +1590,7 @@ CTranslatorScalarToDXL::TranslateWindowFrameToDXL(
        }
        else
        {
-               GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiPlStmt2DXLConversion,
+               GPOS_RAISE(gpdxl::ExmaDXL, 
gpdxl::ExmiQuery2DXLUnsupportedFeature,
                                   GPOS_WSZ_LIT("Unrecognized window frame 
option"));
        }
 
diff --git a/src/backend/gpopt/translate/CTranslatorUtils.cpp 
b/src/backend/gpopt/translate/CTranslatorUtils.cpp
index 52c1b172e6..c0782d0787 100644
--- a/src/backend/gpopt/translate/CTranslatorUtils.cpp
+++ b/src/backend/gpopt/translate/CTranslatorUtils.cpp
@@ -816,7 +816,7 @@ CTranslatorUtils::OidCmpOperator(Expr *expr)
                        return LInitialOID(((RowCompareExpr *) expr)->opnos);
 
                default:
-                       GPOS_RAISE(gpdxl::ExmaDXL, 
gpdxl::ExmiPlStmt2DXLConversion,
+                       GPOS_RAISE(gpdxl::ExmaDXL, 
gpdxl::ExmiDXL2PlStmtConversion,
                                           GPOS_WSZ_LIT("Unsupported 
comparison"));
                        return InvalidOid;
        }
diff --git a/src/backend/gporca/libgpos/src/_api.cpp 
b/src/backend/gporca/libgpos/src/_api.cpp
index 05512f3af9..77bd1b0128 100644
--- a/src/backend/gporca/libgpos/src/_api.cpp
+++ b/src/backend/gporca/libgpos/src/_api.cpp
@@ -52,8 +52,6 @@ const ULONG expected_dxl_fallback[] = {
        gpdxl::ExmiMDObjUnsupported,  // unsupported metadata object
        gpdxl::
                ExmiQuery2DXLUnsupportedFeature,  // unsupported feature during 
algebrization
-       gpdxl::
-               ExmiPlStmt2DXLConversion,  // unsupported feature during plan 
freezing
        gpdxl::
                ExmiDXL2PlStmtConversion,  // unsupported feature during 
planned statement translation
        gpdxl::ExmiDXL2ExprAttributeNotFound,
diff --git a/src/backend/gporca/libnaucrates/include/naucrates/exception.h 
b/src/backend/gporca/libnaucrates/include/naucrates/exception.h
index d889ef6bba..2dbd4e783f 100644
--- a/src/backend/gporca/libnaucrates/include/naucrates/exception.h
+++ b/src/backend/gporca/libnaucrates/include/naucrates/exception.h
@@ -41,7 +41,6 @@ enum ExMinor
        ExmiDXLValidationError,
        ExmiDXLXercesParseError,
        ExmiDXLIncorrectNumberOfChildren,
-       ExmiPlStmt2DXLConversion,
        ExmiDXL2PlStmtConversion,
        ExmiQuery2DXLAttributeNotFound,
        ExmiQuery2DXLUnsupportedFeature,
diff --git a/src/backend/gporca/libnaucrates/src/exception.cpp 
b/src/backend/gporca/libnaucrates/src/exception.cpp
index 3cb68ef0b0..0360ac7990 100644
--- a/src/backend/gporca/libnaucrates/src/exception.cpp
+++ b/src/backend/gporca/libnaucrates/src/exception.cpp
@@ -94,19 +94,11 @@ gpdxl::EresExceptionInit(CMemoryPool *mp)
                        0,      //
                        GPOS_WSZ_WSZLEN("Incorrect Number of children")),
 
-               CMessage(
-                       CException(gpdxl::ExmaDXL, 
gpdxl::ExmiPlStmt2DXLConversion),
-                       CException::ExsevError,
-                       GPOS_WSZ_WSZLEN("GPDB Expression type: %ls not 
supported in DXL"),
-                       1,      //
-                       GPOS_WSZ_WSZLEN("GPDB Expression type not supported in 
DXL")),
-
-               CMessage(
-                       CException(gpdxl::ExmaDXL, 
gpdxl::ExmiDXL2PlStmtConversion),
-                       CException::ExsevError,
-                       GPOS_WSZ_WSZLEN("DXL-to-PlStmt Translation: %ls not 
supported"),
-                       1,      //
-                       GPOS_WSZ_WSZLEN("DXL-to-PlStmt Translation not 
supported")),
+               CMessage(CException(gpdxl::ExmaDXL, 
gpdxl::ExmiDXL2PlStmtConversion),
+                                CException::ExsevNotice,
+                                GPOS_WSZ_WSZLEN("Feature not supported: %ls"),
+                                1,      //
+                                GPOS_WSZ_WSZLEN("Feature not supported")),
 
                CMessage(
                        CException(gpdxl::ExmaDXL, 
gpdxl::ExmiQuery2DXLAttributeNotFound),
@@ -164,7 +156,7 @@ gpdxl::EresExceptionInit(CMemoryPool *mp)
                        CException::ExsevError,
                        GPOS_WSZ_WSZLEN("Feature not supported: %ls"),
                        1,      // feature name
-                       GPOS_WSZ_WSZLEN("Feature not supported: %ls")),
+                       GPOS_WSZ_WSZLEN("Feature not supported")),
 
                CMessage(
                        CException(gpdxl::ExmaConstExprEval,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to