@Override protected String visitDereferenceExpression(DereferenceExpression node, Void context) { String baseString = process(node.getBase(), context); return baseString + "." + process(node.getField()); }
@Override protected RowExpression visitDereferenceExpression(DereferenceExpression node, Void context) { RowType rowType = (RowType) getType(node.getBase()); String fieldName = node.getField().getValue(); List<Field> fields = rowType.getFields(); int index = -1; for (int i = 0; i < fields.size(); i++) { Field field = fields.get(i); if (field.getName().isPresent() && field.getName().get().equalsIgnoreCase(fieldName)) { checkArgument(index < 0, "Ambiguous field %s in type %s", field, rowType.getDisplayName()); index = i; } } if (legacyRowFieldOrdinalAccess && index < 0) { OptionalInt rowIndex = parseAnonymousRowFieldOrdinalAccess(fieldName, fields); if (rowIndex.isPresent()) { index = rowIndex.getAsInt(); } } checkState(index >= 0, "could not find field name: %s", node.getField()); Type returnType = getType(node); return call(dereferenceSignature(returnType, rowType), returnType, process(node.getBase(), context), constant(index, INTEGER)); }
return new DereferenceExpression(toExpression(base, type), node.getField()); Block row = (Block) base; Type returnType = type(node); String fieldName = node.getField().getValue(); List<Field> fields = rowType.getFields(); int index = -1; checkState(index >= 0, "could not find field name: %s", node.getField()); if (row.isNull(index)) { return null;
String fieldName = node.getField().getValue();
@Override protected String visitDereferenceExpression(DereferenceExpression node, Void context) { String baseString = process(node.getBase(), context); return baseString + "." + formatIdentifier(node.getField().getValue(), escape); }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Void context) { String baseString = process(node.getBase(), context); return baseString + "." + process(node.getField()); }