|
59 | 59 | import net.sf.jsqlparser.expression.operators.arithmetic.Multiplication;
|
60 | 60 | import net.sf.jsqlparser.expression.operators.arithmetic.Subtraction;
|
61 | 61 | import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
|
62 |
| -import net.sf.jsqlparser.parser.Node; |
63 | 62 | import net.sf.jsqlparser.schema.Column;
|
64 | 63 | import net.sf.jsqlparser.statement.select.LateralView;
|
65 | 64 |
|
@@ -264,19 +263,18 @@ public Object computeForValue(Expression expression, Object[] inputFields) {
|
264 | 263 | if (expression instanceof Column) {
|
265 | 264 | Column columnExp = (Column) expression;
|
266 | 265 | String columnName = columnExp.getColumnName();
|
267 |
| - Node node = columnExp.getASTNode().jjtGetParent(); |
268 |
| - if (("true".equalsIgnoreCase(columnExp.getColumnName()) |
269 |
| - || "false".equalsIgnoreCase(columnExp.getColumnName())) |
270 |
| - && ("CaseWhenExpression".equalsIgnoreCase(node.toString()))) { |
271 |
| - return Boolean.parseBoolean(columnExp.getColumnName()); |
272 |
| - } |
273 | 266 | int index = inputRowType.indexOf(columnName, false);
|
274 | 267 | if (index == -1
|
275 | 268 | && columnName.startsWith(ZetaSQLEngine.ESCAPE_IDENTIFIER)
|
276 | 269 | && columnName.endsWith(ZetaSQLEngine.ESCAPE_IDENTIFIER)) {
|
277 | 270 | columnName = columnName.substring(1, columnName.length() - 1);
|
278 | 271 | index = inputRowType.indexOf(columnName, false);
|
279 | 272 | }
|
| 273 | + if (index == -1 |
| 274 | + && ("true".equalsIgnoreCase(columnName) |
| 275 | + || "false".equalsIgnoreCase(columnName))) { |
| 276 | + return Boolean.parseBoolean(columnName); |
| 277 | + } |
280 | 278 |
|
281 | 279 | if (index != -1) {
|
282 | 280 | return inputFields[index];
|
|
0 commit comments