--------------------------------------------------------------------------- @function: CMappingVarColId::GetGPDBAttOptColMapping @doc: Given a gpdb attribute, return the mapping info to opt col ---------------------------------------------------------------------------
| 57 | // |
| 58 | //--------------------------------------------------------------------------- |
| 59 | const CGPDBAttOptCol * |
| 60 | CMappingVarColId::GetGPDBAttOptColMapping( |
| 61 | ULONG current_query_level, const Var *var, |
| 62 | EPlStmtPhysicalOpType plstmt_physical_op_type) const |
| 63 | { |
| 64 | GPOS_ASSERT(nullptr != var); |
| 65 | GPOS_ASSERT(current_query_level >= var->varlevelsup); |
| 66 | |
| 67 | // absolute query level of var |
| 68 | ULONG abs_query_level = current_query_level - var->varlevelsup; |
| 69 | |
| 70 | // extract varno |
| 71 | ULONG var_no = var->varno; |
| 72 | if (EpspotWindow == plstmt_physical_op_type || |
| 73 | EpspotAgg == plstmt_physical_op_type || |
| 74 | EpspotMaterialize == plstmt_physical_op_type) |
| 75 | { |
| 76 | // Agg and Materialize need to employ OUTER, since they have other |
| 77 | // values in GPDB world |
| 78 | var_no = OUTER_VAR; |
| 79 | } |
| 80 | |
| 81 | CGPDBAttInfo *gpdb_att_info = |
| 82 | GPOS_NEW(m_mp) CGPDBAttInfo(abs_query_level, var_no, var->varattno); |
| 83 | CGPDBAttOptCol *gpdb_att_opt_col_info = |
| 84 | m_gpdb_att_opt_col_mapping->Find(gpdb_att_info); |
| 85 | |
| 86 | if (nullptr == gpdb_att_opt_col_info) |
| 87 | { |
| 88 | // TODO: Sept 09 2013, remove temporary fix (revert exception to assert) to avoid crash during algebrization |
| 89 | GPOS_RAISE(gpdxl::ExmaDXL, gpdxl::ExmiQuery2DXLError, |
| 90 | GPOS_WSZ_LIT("No variable")); |
| 91 | } |
| 92 | |
| 93 | gpdb_att_info->Release(); |
| 94 | return gpdb_att_opt_col_info; |
| 95 | } |
| 96 | |
| 97 | //--------------------------------------------------------------------------- |
| 98 | // @function: |
nothing calls this directly
no test coverage detected