@Override protected R visitDereferenceExpression(DereferenceExpression node, C context) { process(node.getBase(), context); return null; }
@Override protected Void visitDereferenceExpression(DereferenceExpression node, ImmutableSet.Builder<Expression> builder) { if (columnReferences.contains(NodeRef.<Expression>of(node))) { builder.add(node); } else { process(node.getBase(), builder); } return null; }
@Override protected Void visitDereferenceExpression(DereferenceExpression node, ImmutableSet.Builder<QualifiedName> builder) { if (columnReferences.contains(NodeRef.<Expression>of(node))) { builder.add(DereferenceExpression.getQualifiedName(node)); } else { process(node.getBase(), builder); } return null; }
@Override protected Boolean visitDereferenceExpression(DereferenceExpression node, Void context) { if (columnReferences.containsKey(NodeRef.<Expression>of(node))) { return isGroupingKey(node); } // Allow SELECT col1.f1 FROM table1 GROUP BY col1 return process(node.getBase(), context); }
@Override protected Void visitDereferenceExpression(DereferenceExpression node, Void context) { if (columnReferences.contains(NodeRef.<Expression>of(node))) { throw new SemanticException(EXPRESSION_NOT_CONSTANT, expression, "Constant expression cannot contain column references"); } process(node.getBase(), context); return null; }
@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)); }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Void context) { String baseString = process(node.getBase(), context); return baseString + "." + formatIdentifier(node.getField().getValue(), escape); }
@Override protected R visitDereferenceExpression(DereferenceExpression node, C context) { process(node.getBase(), context); return null; }
@Override protected R visitDereferenceExpression(DereferenceExpression node, C context) { process(node.getBase(), context); return null; }
public static String visitDereferenceExpression(DereferenceExpression node){ if(node.getBase() instanceof Identifier) { return ((Identifier)node.getBase()).getName()/*.getValue()*/+"."+node.getFieldName()/*.getValue()*/; }else return visitDereferenceExpression((DereferenceExpression)node.getBase())+"."+node.getFieldName()/*.getValue()*/; }
@Override protected Void visitDereferenceExpression(DereferenceExpression node, ImmutableSet.Builder<QualifiedName> builder) { if (columnReferences.contains(node)) { builder.add(DereferenceExpression.getQualifiedName(node)); } else { process(node.getBase(), builder); } return null; }
@Override protected Void visitDereferenceExpression(DereferenceExpression node, Void context) { if (columnReferences.contains(node)) { throw new SemanticException(EXPRESSION_NOT_CONSTANT, expression, "Constant expression cannot contain column references"); } process(node.getBase(), context); return null; }
@Override protected Boolean visitDereferenceExpression(DereferenceExpression node, Void context) { if (columnReferences.contains(node)) { return isField(DereferenceExpression.getQualifiedName(node)); } // Allow SELECT col1.f1 FROM table1 GROUP BY col1 return process(node.getBase(), context); }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Void context) { String baseString = process(node.getBase(), context); return baseString + "." + process(node.getField()); }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Boolean unmangleNames) { String baseString = process(node.getBase(), unmangleNames); return baseString + "." + formatIdentifier(node.getFieldName()); }
@Override protected String visitDereferenceExpression(DereferenceExpression node, Boolean unmangleNames) { String baseString = process(node.getBase(), unmangleNames); return baseString + "." + formatIdentifier(node.getFieldName()); }
@Override public Expression rewriteDereferenceExpression(DereferenceExpression node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { if (analysis.getColumnReferences().contains(node)) { return rewriteExpression(node, context, treeRewriter); } // Rewrite all row field reference to function call. QualifiedName mangledName = QualifiedName.of(mangleFieldReference(node.getFieldName())); FunctionCall functionCall = new FunctionCall(mangledName, ImmutableList.of(node.getBase())); Expression rewrittenExpression = rewriteFunctionCall(functionCall, context, treeRewriter); // cast expression if coercion is registered Type coercion = analysis.getCoercion(node); if (coercion != null) { rewrittenExpression = new Cast(rewrittenExpression, coercion.getTypeSignature().toString()); } return rewrittenExpression; } }, parsedExpression);