MCPcopy Create free account
hub / github.com/apache/calcite / isCountStar

Method isCountStar

core/src/main/java/org/apache/calcite/sql/SqlCall.java:230–244  ·  view source on GitHub ↗

Returns whether it is the function COUNT( ). @return true if function call to COUNT( )

()

Source from the content-addressed store, hash-verified

228 * @return true if function call to COUNT(*)
229 */
230 public boolean isCountStar() {
231 SqlOperator sqlOperator = getOperator();
232 if (sqlOperator.getName().equals("COUNT")
233 && operandCount() == 1) {
234 final SqlNode parm = operand(0);
235 if (parm instanceof SqlIdentifier) {
236 SqlIdentifier id = (SqlIdentifier) parm;
237 if (id.isStar() && id.names.size() == 1) {
238 return true;
239 }
240 }
241 }
242
243 return false;
244 }
245
246 @Pure
247 public @Nullable SqlLiteral getFunctionQuantifier() {

Callers 3

deriveTypeMethod · 0.80
deriveTypeMethod · 0.80

Calls 7

getOperatorMethod · 0.95
getNameMethod · 0.95
operandCountMethod · 0.95
operandMethod · 0.95
isStarMethod · 0.95
equalsMethod · 0.65
sizeMethod · 0.65

Tested by 1

deriveTypeMethod · 0.64