@Override protected R visitDereferenceExpression(final DereferenceExpression node, final C context) { process(node.getBase(), context); return null; }
@Override protected R visitDereferenceExpression(final DereferenceExpression node, final C context) { process(node.getBase(), context); return null; }
@Override protected Node visitDereferenceExpression(final DereferenceExpression node, final Node parent) { node.setParent(parent); process(node.getBase(), node); return null; }
private Expression createFetchFunctionNodeIfNeeded( final DereferenceExpression dereferenceExpression, final Object context ) { if (dereferenceExpression.getBase() instanceof QualifiedNameReference) { return getNewDereferenceExpression(dereferenceExpression, context); } return getNewFunctionCall(dereferenceExpression, context); }
@Override protected String visitDereferenceExpression( final DereferenceExpression node, final Boolean unmangleNames) { final String baseString = process(node.getBase(), unmangleNames); if (node.getBase() instanceof QualifiedNameReference) { return baseString + KsqlConstants.DOT + formatIdentifier(node.getFieldName()); } return baseString + KsqlConstants.STRUCT_FIELD_REF + formatIdentifier(node.getFieldName()); }
protected Node visitDereferenceExpression( final DereferenceExpression node, final Object context ) { // use an if/else block here (instead of isPresent.map(...).orElse(...)) so only one object // gets instantiated (issue #1784) if (node.getLocation().isPresent()) { return new DereferenceExpression(node.getLocation().get(), (Expression) process(node.getBase(), context), node.getFieldName() ); } else { return new DereferenceExpression((Expression) process(node.getBase(), context), node.getFieldName() ); } }
private DereferenceExpression getNewDereferenceExpression( final DereferenceExpression dereferenceExpression, final Object context ) { return new DereferenceExpression( dereferenceExpression.getLocation(), (Expression) process(dereferenceExpression.getBase(), context), dereferenceExpression.getFieldName()); } }
private FunctionCall getNewFunctionCall( final DereferenceExpression dereferenceExpression, final Object context ) { final Expression createFunctionResult = (Expression) process(dereferenceExpression.getBase(), context); final String fieldName = dereferenceExpression.getFieldName(); return new FunctionCall( QualifiedName.of("FETCH_FIELD_FROM_STRUCT"), ImmutableList.of(createFunctionResult, new StringLiteral(fieldName))); }