MCPcopy Create free account
hub / github.com/apache/cloudberry / exprType

Function exprType

src/backend/nodes/nodeFuncs.c:42–280  ·  view source on GitHub ↗

* exprType - * returns the Oid of the type of the expression's result. */

Source from the content-addressed store, hash-verified

40 * returns the Oid of the type of the expression's result.
41 */
42Oid
43exprType(const Node *expr)
44{
45 Oid type;
46
47 if (!expr)
48 return InvalidOid;
49
50 switch (nodeTag(expr))
51 {
52 case T_Var:
53 type = ((const Var *) expr)->vartype;
54 break;
55 case T_Const:
56 type = ((const Const *) expr)->consttype;
57 break;
58 case T_Param:
59 type = ((const Param *) expr)->paramtype;
60 break;
61 case T_Aggref:
62 type = ((const Aggref *) expr)->aggtype;
63 break;
64 case T_GroupingFunc:
65 type = INT4OID;
66 break;
67 case T_GroupId:
68 type = INT4OID;
69 break;
70 case T_GroupingSetId:
71 type = INT4OID;
72 break;
73 case T_WindowFunc:
74 type = ((const WindowFunc *) expr)->wintype;
75 break;
76 case T_SubscriptingRef:
77 type = ((const SubscriptingRef *) expr)->refrestype;
78 break;
79 case T_FuncExpr:
80 type = ((const FuncExpr *) expr)->funcresulttype;
81 break;
82 case T_NamedArgExpr:
83 type = exprType((Node *) ((const NamedArgExpr *) expr)->arg);
84 break;
85 case T_OpExpr:
86 type = ((const OpExpr *) expr)->opresulttype;
87 break;
88 case T_DistinctExpr:
89 type = ((const DistinctExpr *) expr)->opresulttype;
90 break;
91 case T_NullIfExpr:
92 type = ((const NullIfExpr *) expr)->opresulttype;
93 break;
94 case T_ScalarArrayOpExpr:
95 type = BOOLOID;
96 break;
97 case T_BoolExpr:
98 type = BOOLOID;
99 break;

Callers 15

foreign_expr_walkerFunction · 0.85
deparseNullTestFunction · 0.85
appendAggOrderByFunction · 0.85
appendOrderByClauseFunction · 0.85
prepare_query_paramsFunction · 0.85
exec_save_simple_exprFunction · 0.85
process_matched_tleFunction · 0.85
build_column_defaultFunction · 0.85
checkRuleResultListFunction · 0.85
examine_attributeFunction · 0.85
examine_expressionFunction · 0.85

Calls 4

get_promoted_array_typeFunction · 0.85
format_type_beFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by 2

project_describeFunction · 0.68