Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.37.0
Description
Currently, SqlToRelConverter contains a few places where sqlNode is concatenated to some prefix and passed as plain string rather that message supplier as parameter to requireNonNull method. These are, namely, lines 1019, 4031, and 5344 at commit 29c413a3:
SqlNode elseOperand =
requireNonNull(caseNode.getElseOperand(),
"getElseOperand for " + caseNode);
protected RelOptTable getTargetTable(SqlNode call) { final SqlValidatorNamespace targetNs = getNamespace(call); SqlValidatorNamespace namespace; if (targetNs.isWrapperFor(SqlValidatorImpl.DmlNamespace.class)) { namespace = targetNs.unwrap(SqlValidatorImpl.DmlNamespace.class); } else { namespace = targetNs.resolve(); } RelOptTable table = SqlValidatorUtil.getRelOptTable(namespace, catalogReader, null, null); return requireNonNull(table, "no table found for " + call); }
return Pair.of(c, (e, fieldName) -> { final int j = requireNonNull(fieldMap.get(fieldName), "field " + fieldName); return rexBuilder.makeFieldAccess(e, j); });
We can shave a few microseconds by simply replacing plain string with message supplier.
Attachments
Issue Links
- links to