Return a Hector SlicePredicate based on the provided column slice

@param <C>
@param columns
@param colSer
@return
434729
public static <C> SlicePredicate getPredicate(ColumnSlice<C> columns, Serializer<C> colSer) {
        // Get all the columns
        if (columns == null) {
            SlicePredicate predicate = new SlicePredicate();
            predicate.setSlice_range(new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new byte[0]), false,
                    Integer.MAX_VALUE));
            return predicate;
        }
        // Get a specific list of columns
        if (columns.getColumns() != null) {
            SlicePredicate predicate = new SlicePredicate();
            predicate.setColumn_namesIsSet(true);
            predicate.column_names = colSer.toBytesList(columns.getColumns());
            return predicate;
        }
        else {
            SlicePredicate predicate = new SlicePredicate();
            predicate.setSlice_range(new SliceRange((columns.getStartColumn() == null) ? ByteBuffer.wrap(new byte[0])
                    : ByteBuffer.wrap(colSer.toBytes(columns.getStartColumn())),
                    (columns.getEndColumn() == null) ? ByteBuffer.wrap(new byte[0]) : ByteBuffer.wrap(colSer
                            .toBytes(columns.getEndColumn())), columns.getReversed(), columns.getLimit()));
            return predicate;
        }
    }
900122
def _slice(self, slicer):
        

        # only allow 1 dimensional slicing, but can
        # in a 2-d case be passd (slice(None),....)
        if isinstance(slicer, tuple) and len(slicer) == 2:
            if not com.is_null_slice(slicer[0]):
                raise AssertionError("invalid slicing for a 1-ndim "
                                     "categorical")
            slicer = slicer[1]

        codes = self._codes[slicer]
        return self._constructor(values=codes, dtype=self.dtype, fastpath=True)
1110385
public Query select(final Expression... selectColumns) {
        if (selectColumns == null) {
            return this;
        }

        return select(Arrays.asList(selectColumns));
    }
348738
public static void pruneDenseTableColumnsV2(List<RawColumn> columns) {
    ListIterator<RawColumn> iterator = columns.listIterator();
    while (iterator.hasNext()) {
      RawColumn column = iterator.next();
      if (column.kind.equals(KIND_COMPACT_VALUE) && column.name.asInternal().isEmpty()) {
        iterator.remove();
      }
    }
  }
598033
public static String join(final Collection<?> col, final String separator) {
        return join(col, separator, ELEMENT_CONVERTER);
    }
156946
protected static String cut(String delimiter, int column, String lineText) {
		if (lineText == null || lineText.isEmpty()) {
			return null;
		}
		final String[] columns = lineText.split(Pattern.quote(delimiter));
		if (columns != null && column >= 0 && column < columns.length) {
			return columns[column].trim();
		}
		return null;
	}
69278
ColumnOrSuperColumn getColumn(ByteBuffer key, ColumnPath colPath) {
        m_logger.debug("Fetching {}.{}", new Object[]{Utils.toString(key), toString(colPath)});
        ColumnOrSuperColumn column = null;
        boolean bSuccess = false;
        for (int attempts = 1; !bSuccess; attempts++) {
            try {
                // Attempt to retrieve a slice list.
                Date startDate = new Date();
                column = m_client.get(key, colPath, ConsistencyLevel.ONE);
                timing("get", startDate);
                if (attempts > 1) {
                    m_logger.info("get() succeeded on attempt #{}", attempts);
                }
                bSuccess = true;
            } catch (NotFoundException ex) {
                return null;
            } catch (InvalidRequestException ex) {
                // No point in retrying this one.
                String errMsg = "get() failed for table: " + colPath.getColumn_family();
                m_bFailed = true;
                m_logger.error(errMsg, ex);
                throw new RuntimeException(errMsg, ex);
            } catch (Exception ex) {
                // Abort if all retries exceeded.
                if (attempts >= m_max_read_attempts) {
                    String errMsg = "All retries exceeded; abandoning get() for table: " +
                                    colPath.getColumn_family();
                    m_bFailed = true;
                    m_logger.error(errMsg, ex);
                    throw new RuntimeException(errMsg, ex);
                }
                
                // Report retry as a warning.
                m_logger.warn("get() attempt #{} failed: {}", attempts, ex);
                try {
                    Thread.sleep(attempts * m_retry_wait_millis);
                } catch (InterruptedException e1) {
                    // ignore
                }
                reconnect(ex);
            }
        }
        return column;
    }
732361
def from_slice(cls, coord):
        """"""
        if coord.step is not None:
            raise NotImplementedError('no slice step support')
        elif coord.start is not None and coord.stop is not None:
            return DoubleSlice.from_slice(coord)
        elif coord.start is not None:
            xcol, xrow, col, row = cls._parse(coord.start)
            if xcol is not None:
                return StartCell(cls._cint(xcol), cls._rint(xrow))
            elif col is not None:
                return StartCol(cls._cint(col))
            return StartRow(cls._rint(row))
        elif coord.stop is not None:
            xcol, xrow, col, row = cls._parse(coord.stop)
            if xcol is not None:
                return StopCell(cls._cint(xcol) + 1, cls._rint(xrow) + 1)
            elif col is not None:
                return StopCol(cls._cint(col) + 1)
            return StopRow(cls._rint(row) + 1)
        return cls()
142096
public static <T> C.List<T> toList(Collection<? extends T> col) {
        if (col.size() == 0) {
            return Nil.list();
        }
        if (col instanceof C.List) {
            C.List<T> list = $.cast(col);
            if (list.is(C.Feature.IMMUTABLE)) {
                return list;
            }
        }
        return new ListBuilder<T>(col).toList();
    }
536576
protected int[] colsBitsetToIDs(long[] cols) {
    int[] colIDs = new int[BitsUtil.cardinality(cols)];
    int colsIndex = 0;
    for(int cpos = 0, clpos = 0; clpos < cols.length; ++clpos) {
      long clong = cols[clpos];
      if(clong == 0L) {
        cpos += Long.SIZE;
        continue;
      }
      for(int j = 0; j < Long.SIZE; ++j, ++cpos, clong >>>= 1) {
        if((clong & 1L) == 1L) {
          colIDs[colsIndex] = cpos;
          ++colsIndex;
        }
      }
    }
    return colIDs;
  }
1085372
public function filterAndConvertToArray($columns)
    {
        $this->columns = [];
        $columns = explode(',', $columns);

        foreach ($columns as $column) {
            try {
                list($col, $val) = explode(':', $column, self::EXPLODE_MAX_LIMIT);
            } catch (\Exception $e) {
                throw new \Exception('Unable to explode columns based on ":" separator');
            }

            $val = $this->checkForKeyword(trim($val));
            $this->columns[trim($col)] = $val;
        }

        return $this;
    }
201849
public String[] buildColumnsAs(String[] columns, String[] values) {

		Map<String, String> columnsMap = new HashMap<>();
		for (int i = 0; i < columns.length; i++) {
			String column = columns[i];
			String value = values[i];
			columnsMap.put(column, value);
		}

		return buildColumnsAs(columnsMap);
	}
484409
@Override
	public SqlEntityQuery<E> desc(final String col, final Nulls nulls) {
		this.sortOrders.add(new SortOrder(col, Order.DESCENDING, nulls));
		return this;
	}
837770
@Override
    protected void searchSuperColumnsInRange(String columnFamilyName, ConsistencyLevel consistencyLevel,
            String persistenceUnit, String rowKey, byte[] searchSuperColumnName, List<SuperColumn> thriftSuperColumns,
            byte[] start, byte[] finish)
    {
        SlicePredicate colPredicate = new SlicePredicate();
        SliceRange sliceRange = new SliceRange();
        sliceRange.setStart(start);
        sliceRange.setFinish(finish);
        colPredicate.setSlice_range(sliceRange);
        Connection conn = thriftClient.getConnection();

        List<ColumnOrSuperColumn> coscList = null;
        try
        {
            coscList = conn.getClient().get_slice(ByteBuffer.wrap(rowKey.getBytes()),
                    new ColumnParent(columnFamilyName), colPredicate, consistencyLevel);
        }
        catch (InvalidRequestException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (UnavailableException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (TimedOutException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (TException e)
        {
            log.error("Unable to search from inverted index, Caused by: ", e);
            throw new IndexingException(e);
        }
        finally
        {
            thriftClient.releaseConnection(conn);
        }
        List<SuperColumn> allThriftSuperColumns = ThriftDataResultHelper.transformThriftResult(coscList,
                ColumnFamilyType.SUPER_COLUMN, null);

        for (SuperColumn superColumn : allThriftSuperColumns)
        {
            if (superColumn == null)
                continue;

            if (superColumn.getName() == searchSuperColumnName)
            {
                thriftSuperColumns.add(superColumn);
            }
        }
    }
928964
public static List<Column> getColumnList(List<ColumnOrSuperColumn> columns) {
    ArrayList<Column> list = new ArrayList<Column>(columns.size());
    for (ColumnOrSuperColumn col : columns) {
      list.add(col.getColumn());
    }
    return list;
  }
1272789
@SuppressWarnings({"rawtypes", "unchecked"})
    public static String join(final Collection<?> col, final String separator, final ElementConverter elementConverter) {

        if(col == null) {
            return "";
        }

        final int size = col.size();
        if(size == 0) {
            return "";
        }

        StringBuilder sb = new StringBuilder();
        for(Iterator<?> itr = col.iterator(); itr.hasNext();) {
            final Object element = itr.next();
            String text = elementConverter.convertToString(element);
            sb.append(text);

            if(separator != null && itr.hasNext()) {
                sb.append(separator);
            }
        }

        return sb.toString();

    }
1114763
private void splitOn(String... columnNames) {

        List<Column<?>> columns = getSourceTable().columns(columnNames);
        int byteSize = getByteSize(columns);

        byte[] currentKey = null;
        String currentStringKey = null;
        TableSlice view;

        Selection selection = new BitmapBackedSelection();

        for (int row = 0; row < getSourceTable().rowCount(); row++) {

            ByteBuffer byteBuffer = ByteBuffer.allocate(byteSize);
            String newStringKey = "";

            for (int col = 0; col < columnNames.length; col++) {
                if (col > 0) {
                    newStringKey = newStringKey + SPLIT_STRING;
                }

                Column<?> c = getSourceTable().column(columnNames[col]);
                String groupKey = getSourceTable().getUnformatted(row, getSourceTable().columnIndex(c));
                newStringKey = newStringKey + groupKey;
                byteBuffer.put(c.asBytes(row));
            }
            byte[] newKey = byteBuffer.array();
            if (row == 0) {
                currentKey = newKey;
                currentStringKey = newStringKey;
            }
            if (!Arrays.equals(newKey, currentKey)) {
                currentKey = newKey;
                view = new TableSlice(getSourceTable(), selection);
                view.setName(currentStringKey);
                currentStringKey = newStringKey;
                addSlice(view);
                selection = new BitmapBackedSelection();
                selection.add(row);
            } else {
                selection.add(row);
            }
        }
        if (!selection.isEmpty()) {
            view = new TableSlice(getSourceTable(), selection);
            view.setName(currentStringKey);
            addSlice(view);
        }
    }