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

Function ExecTypeFromTLInternal

src/backend/executor/execTuples.c:1972–2005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1970}
1971
1972static TupleDesc
1973ExecTypeFromTLInternal(List *targetList, bool skipjunk)
1974{
1975 TupleDesc typeInfo;
1976 ListCell *l;
1977 int len;
1978 int cur_resno = 1;
1979
1980 if (skipjunk)
1981 len = ExecCleanTargetListLength(targetList);
1982 else
1983 len = ExecTargetListLength(targetList);
1984 typeInfo = CreateTemplateTupleDesc(len);
1985
1986 foreach(l, targetList)
1987 {
1988 TargetEntry *tle = lfirst(l);
1989
1990 if (skipjunk && tle->resjunk)
1991 continue;
1992 TupleDescInitEntry(typeInfo,
1993 cur_resno,
1994 tle->resname,
1995 exprType((Node *) tle->expr),
1996 exprTypmod((Node *) tle->expr),
1997 0);
1998 TupleDescInitEntryCollation(typeInfo,
1999 cur_resno,
2000 exprCollation((Node *) tle->expr));
2001 cur_resno++;
2002 }
2003
2004 return typeInfo;
2005}
2006
2007/*
2008 * ExecTypeFromExprList - build a tuple descriptor from a list of Exprs

Callers 2

ExecTypeFromTLFunction · 0.85
ExecCleanTypeFromTLFunction · 0.85

Calls 9

ExecTargetListLengthFunction · 0.85
CreateTemplateTupleDescFunction · 0.85
TupleDescInitEntryFunction · 0.85
exprTypeFunction · 0.85
exprTypmodFunction · 0.85
exprCollationFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected