Compute unique column name among the other columns
@param base Returned name if there is no duplicate
@param columns Other existing columns
@return Unique column name
177979
public static String getUniqueColumnName(String base, List<Column> columns) {
        String cursor = base;
        int cpt = 2;
        boolean findDuplicate= true;
        while(findDuplicate) {
            findDuplicate = false;
            for (Column column : columns) {
                if (column.getName().equalsIgnoreCase(cursor)) {
                    findDuplicate = true;
                    break;
                }
            }
            if(findDuplicate) {
                cursor = base + Integer.toString(cpt);
            }
        }
        return cursor;
    }
936310
@Override
    public void writeColumns(HTableInterface htable, Object rowKey, Map<String, Object> columns, String columnFamilyName)
            throws IOException
    {

        Put p = new Put(HBaseUtils.getBytes(rowKey));

        boolean isPresent = false;
        for (String columnName : columns.keySet())
        {
            p.add(columnFamilyName.getBytes(), Bytes.toBytes(columnName), HBaseUtils.getBytes(columns.get(columnName)));
            isPresent = true;
        }

        if (isPresent)
        {
            htable.put(p);
        }
    }
257369
def column(self, name):
        
        columns = self.columns()
        if name in columns:
            return columns.index(name)
        else:
            check = projex.text.underscore(name)
            for i, column in enumerate(columns):
                if projex.text.underscore(column) == check:
                    return i
        return -1
474358
public static Set<Writable> getUniqueSequence(String columnName, Schema schema,
                                                   SequenceRecordReader sequenceData) {
        int colIdx = schema.getIndexOfColumn(columnName);
        Set<Writable> unique = new HashSet<>();
        while(sequenceData.hasNext()){
            List<List<Writable>> next = sequenceData.sequenceRecord();
            for(List<Writable> step : next){
                unique.add(step.get(colIdx));
            }
        }
        return unique;
    }
207014
@Pure
	public String getBasename(String defaultName) {
		if (Strings.isEmpty(this.basename)) {
			return defaultName;
		}
		return this.basename;
	}
1224574
def generate_unique_name(self, basename):
        """"""
        counts = self.__counts
        try:
            count = counts[basename]
            counts[basename] += 1
        except KeyError:
            count = 0
            counts[basename] = 1
            
        prefix = self.Naming_prefix

        if count == 0:
            name = prefix + basename
        else:
            name = prefix + basename + "_" + str(count)
            
        if prefix != "" or count != 0:
            try:
                count = counts[name]
                return self.generate_unique_name(name)
            except KeyError:
                # wasn't already used so return it
                counts[name] = 1
        return name
651783
public FieldType getFieldTypeByColumnName(String columnName) {
		if (fieldNameMap == null) {
			// build our alias map if we need it
			Map<String, FieldType> map = new HashMap<String, FieldType>();
			for (FieldType fieldType : fieldTypes) {
				map.put(databaseType.downCaseString(fieldType.getColumnName(), true), fieldType);
			}
			fieldNameMap = map;
		}
		FieldType fieldType = fieldNameMap.get(databaseType.downCaseString(columnName, true));
		// if column name is found, return it
		if (fieldType != null) {
			return fieldType;
		}
		// look to see if someone is using the field-name instead of column-name
		for (FieldType fieldType2 : fieldTypes) {
			if (fieldType2.getFieldName().equals(columnName)) {
				throw new IllegalArgumentException("You should use columnName '" + fieldType2.getColumnName()
						+ "' for table " + tableName + " instead of fieldName '" + fieldType2.getFieldName() + "'");
			}
		}
		throw new IllegalArgumentException("Unknown column name '" + columnName + "' in table " + tableName);
	}
465537
public Object getColumnValue(String columnName) {
		for ( int j = 0; j < columnNames.length; j++ ) {
			if ( columnNames[j].equals( columnName ) ) {
				return columnValues[j];
			}
		}
		return null;
	}
1281087
@Override
    public TextColumn unique() {
        List<String> strings = new ArrayList<>(asSet());
        return TextColumn.create(name() + " Unique values", strings);
    }
287939
public HSlicePredicate<N> setColumnNames(Collection<N> columnNames) {
    this.columnNames = columnNames;
    predicateType = PredicateType.ColumnNames;
    return this;
  }
1253285
public List<Column<?>> columns(int... columnIndices) {
        List<Column<?>> cols = new ArrayList<>(columnIndices.length);
        for (int i : columnIndices) {
            cols.add(column(i));
        }
        return cols;
    }
562752
void addColumn(String columnName)
    {
        data.add(new ArrayList<String>());
        columnNames.add(columnName);
    }
809895
@Basic
    @Column(name = "NAME", unique = true, nullable = false, length=255)
	public String getName() 
	{
		return name;
	}
494586
String getUniqueName(CharSequence base) {
    String name = base.toString();
    for (int differentiator = 1; isInvalidName(name); differentiator++) {
      name = base.toString() + separator + differentiator;
    }
    return name;
  }
263113
public boolean hasColumns(Collection<String> columns) {
        return columns != null && this.columns.equals(new TreeSet<String>(columns));
    }
1188976
public int columnIndex(String columnName) {
        for (int i = 0; i < columnCount(); i++) {
            if (columnNames().get(i).equalsIgnoreCase(columnName)) {
                return i;
            }
        }
        throw new IllegalArgumentException(String.format("Column %s is not present in table %s", columnName, name
                ()));
    }
1101042
function _columns() {
    var distinct = false;
    if (this.onlyUnions()) {
      return '';
    }
    var columns = this.grouped.columns || [];
    var i = -1,
        sql = [];
    if (columns) {
      while (++i < columns.length) {
        var stmt = columns[i];
        if (stmt.distinct) {
          distinct = true;
        }
        if (stmt.type === 'aggregate') {
          sql.push(this.aggregate(stmt));
        } else if (stmt.value && stmt.value.length > 0) {
          sql.push(this.formatter.columnize(stmt.value));
        }
      }
    }
    if (sql.length === 0) {
      sql = ['*'];
    }
    return 'select ' + (distinct ? 'distinct ' : '') + sql.join(', ') + (this.tableName ? ' from ' + this.tableName : '');
  }