presto-main/src/main/java/io/prestosql/spi/expression/ConnectorExpressionTranslator.java/SqlToConnectorExpressionTranslator/visitDereferenceExpression
class SqlToConnectorExpressionTranslator:        @Override
        protected Optional<ConnectorExpression> visitDereferenceExpression(DereferenceExpression node, Void context)
        {
            Optional<ConnectorExpression> translatedBase = process(node.getBase());
            if (!translatedBase.isPresent()) {
                return Optional.empty();
            }

            RowType rowType = (RowType) typeOf(node.getBase());
            String fieldName = node.getField().getValue();
            List<RowType.Field> fields = rowType.getFields();
            int index = -1;
            for (int i = 0; i < fields.size(); i++) {
                RowType.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;
                }
            }

            checkState(index >= 0, "could not find field name: %s", node.getField());

            return Optional.of(new FieldDereference(typeOf(node), translatedBase.get(), index));
        }