Creates a projection list that renames existing columns to new names.

<p><b>NOTE:</b> Resulting expression are still unresolved.

@param inputFields names of current columns
@param newAliases new aliases for current columns
@return projection expressions
438314
public static List<Expression> renameColumns(List<String> inputFields, List<Expression> newAliases) {
		LinkedHashMap<String, Expression> finalFields = new LinkedHashMap<>();

		inputFields.forEach(field -> finalFields.put(field, new UnresolvedReferenceExpression(field)));
		newAliases.forEach(expr -> {
			String name = expr.accept(renameColumnExtractor);
			finalFields.put(name, expr);
		});

		return new ArrayList<>(finalFields.values());
	}
402529
private Map<NodeId, NodeId> resolveAliases(Iterable<Alias> aliases) {
        Map<NodeId, NodeId> resolved = Maps.newHashMap();
        Map<NodeId, Set<NodeId>> inverse = Maps.newHashMap();

        for (Alias alias : aliases) {
            NodeId from = alias.getFromId();
            NodeId to = alias.getToId();
            if (resolved.containsKey(to)) {
                to = resolved.get(to);
            }
            resolved.put(from, to);
            if (inverse.get(to) == null) {
                inverse.put(to, Sets.<NodeId> newHashSet());
            }
            inverse.get(to).add(from);

            Set<NodeId> prev = inverse.get(from);
            if (prev != null) {
                for (NodeId id : prev) {
                    resolved.remove(id);
                    inverse.get(from).remove(id);
                    resolved.put(id, to);
                    inverse.get(to).add(id);
                }
            }
        }

        return resolved;
    }
1047524
protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) {
		String nameAsPropertyName = tryGetAsPropertyName(name.toString());
		if (nameAsPropertyName != null) {
			if (featureCall == null || featureCall instanceof XAssignment) {
				String aliasedSetter = "set" + nameAsPropertyName;
				acceptor.accept(aliasedSetter, 2);
			}
			if (!(featureCall instanceof XAssignment)) {
				if (featureCall == null || !getFeatureCall().isExplicitOperationCallOrBuilderSyntax()) {
					String aliasedGetter = "get" + nameAsPropertyName;
					acceptor.accept(aliasedGetter, 2);
					String aliasedBooleanGetter = "is" + nameAsPropertyName;
					acceptor.accept(aliasedBooleanGetter, 2);
				}
			}
		}
	}
1070823
public CachedResultSet rename(String... names) {
        for (int i = 0; i < names.length; ++i) {
            this.columns[i] = names[i];
        }
        return this;
    }
164736
public java.util.List<AliasListEntry> getAliases() {
        if (aliases == null) {
            aliases = new com.ibm.cloud.objectstorage.internal.SdkInternalList<AliasListEntry>();
        }
        return aliases;
    }
879302
public function aliasFields($fields, $defaultAlias = null)
    {
        $aliased = [];
        foreach ($fields as $alias => $field) {
            if (is_numeric($alias) && is_string($field)) {
                $aliased += $this->aliasField($field, $defaultAlias);
                continue;
            }
            $aliased[$alias] = $field;
        }

        return $aliased;
    }
848123
public static Builder newBuilder(String name, LegacySQLTypeName type, Field... subFields) {
    return new Builder().setName(name).setType(type, subFields);
  }
187598
public void setMappings(List<String> mappings) {
        if (mappings.size() > 0) {
            @SuppressWarnings("unchecked") Pair<String, String>[] renames = (Pair<String, String>[])Array.newInstance(Pair.class, mappings.size());
            for (int i = 0; i < _renames.length; ++i) {
                String[] names = mappings.get(i).split("[ ,]+");
                renames[i] = new Pair<String, String>(names[0], names[1]);
            }
            _renames = renames;
        }
    }
635724
private function renameSetFields(Query $query, $columnNames, $originalSource, $newSource) {
        $renamedFields = [];
        foreach ($query->getFields() as $field => $value) {
            $newName = $this->getFieldNewName($field, $columnNames, $originalSource, $newSource);
            if($newName != null) {
                $renamedFields[$newName] = $value;
            }
        }
        $query->fields($renamedFields);
    }
895501
final function FieldNames(array $aliases = array())
    {
        $fieldNames = array_keys($this->FieldMappers());
        $result = array();
        foreach ($fieldNames as $fieldName)
        {
            if (array_key_exists($fieldName, $aliases))
                $result[$aliases[$fieldName]] = $fieldName;
            else
                $result[] = $fieldName;
        }
        return $result;
    }
1360020
private void processFieldNameAliases(Map<Integer, FieldType> map, byte[] data)
   {
      if (data != null)
      {
         int offset = 0;
         int index = 0;
         CustomFieldContainer fields = m_file.getCustomFields();
         while (offset < data.length)
         {
            String alias = MPPUtility.getUnicodeString(data, offset);
            if (!alias.isEmpty())
            {
               FieldType field = map.get(Integer.valueOf(index));
               if (field != null)
               {
                  fields.getCustomField(field).setAlias(alias);
               }
            }
            offset += (alias.length() + 1) * 2;
            index++;
         }
      }
   }
1302581
protected FormLayout createAliasComponent(String alias, boolean red) {

        FormLayout layout = new FormLayout();
        TextField field = new TextField(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_0));
        field.setWidth("100%");
        field.setValue(alias);
        field.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_HELP_0));
        CheckBox redirect = new CheckBox(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_REDIRECT_0), red);
        redirect.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_SITE_ALIAS_REDIRECT_HELP_0));
        layout.addComponent(field);
        layout.addComponent(redirect);
        return layout;
    }
989249
public TableAlias addTable(String table, String aliasPrefix) {

        String alias = makeAlias(aliasPrefix);
        m_tables.add(table + " " + alias);
        return new TableAlias(alias);

    }
619693
public Aliases add(String alias,String reference){
		if (aliases.get(alias) == null){
			aliases.put(alias,reference);
		} else {
			throw new IllegalArgumentException("Alias '" + alias + "' already exists");
		}

		return this;
	}
812938
public String translate(final Values values) {
        final ArrayList<Values.Row> rows = new ArrayList<>(values.getRows());
        final String[] aliases = values.getAliases();

        // If aliases does not exist, throw an exception.
        // Otherwise, apply them to the columns.
        if (aliases == null || aliases.length == 0) {
            throw new DatabaseEngineRuntimeException("Values requires aliases to avoid ambiguous columns names.");
        } else {
            rows.forEach(row -> {
                final List<Expression> expressions = row.getExpressions();
                for (int i = 0; i < expressions.size() && i < aliases.length; i++) {
                    // DISCLAIMER : May have side-effects because will change the state of the row's expressions.
                    expressions.get(i).alias(aliases[i]);
                }
            });
        }

        // Put each row on a select for union operator to work.
        final List<Expression> rowsWithSelect = rows.stream()
                .map(SqlBuilder::select)
                .collect(Collectors.toList());

        // By default, use UNION ALL to express VALUES.
        // This way, only engines that support VALUES will implement it.
        // Since the amount of values can be quite large, a linear UNION can cause Stack Overflow.
        // To avoid it, we model this UNION as a binary tree.
        final Union union = rowsToUnion(rowsWithSelect);

        if (values.isEnclosed()) {
            union.enclose();
        }

        return translate(union);
    }
740963
protected void appendColumn(TableAlias anAlias, FieldDescriptor field, StringBuffer buf)
    {
        buf.append(anAlias.alias);
        buf.append(".");
        buf.append(field.getColumnName());
    }
932700
public void setAlias(UserAlias userAlias)
	{
		m_alias = userAlias.getName();

		// propagate to SelectionCriteria,not to Criteria
		for (int i = 0; i < m_criteria.size(); i++)
		{
			if (!(m_criteria.elementAt(i) instanceof Criteria))
			{
				((SelectionCriteria) m_criteria.elementAt(i)).setAlias(userAlias);
			}
		}
	}