instance-level configuration
 ----------------------------
 provides access to the list of columns specifically meant for the Search to use
181362
def columns
      # we want to delay initializing to the @core.columns set for as long as possible. Too soon and .search_sql will not be available to .searchable?
      unless defined? @columns
        self.columns = @core.columns.collect { |c| c.name if @core.columns._inheritable.include?(c.name) && c.searchable? && c.association.nil? && c.text? }.compact
      end
      @columns
    end
31629
public static void setInputColumns(Configuration conf, String columns)
    {
        if (columns == null || columns.isEmpty())
            return;
        
        conf.set(INPUT_CQL_COLUMNS_CONFIG, columns);
    }
1353859
@Override
    public List<DColumn> getColumns(String storeName, String rowKey, String startColumn, String endColumn, int count) {
        String tableName = storeToCQLName(storeName);
        ResultSet rs = null;
        if (startColumn == null) {
            if (endColumn == null) {
                rs = executeQuery(Query.SELECT_1_ROW_ALL_COLUMNS, tableName, rowKey, new Integer(count));
            } else {
                rs = executeQuery(Query.SELECT_1_ROW_LOWER_COLUMNS, tableName, rowKey, endColumn, new Integer(count));
            }
        } else if (endColumn == null) {
            rs = executeQuery(Query.SELECT_1_ROW_UPPER_COLUMNS, tableName, rowKey, startColumn, new Integer(count));
        } else {
            rs = executeQuery(Query.SELECT_1_ROW_COLUMN_RANGE, tableName, rowKey, startColumn, endColumn, new Integer(count));
        }
        List<Row> list = rs.all();
        List<DColumn> result = new ArrayList<>(list.size());
        boolean isValueBinary = columnValueIsBinary(storeName);
        for(Row r: list) {
            DColumn cqlCol = null;
            if (isValueBinary) {
                cqlCol = new DColumn(r.getString("column1"), r.getBytes("value"));
            } else {
                cqlCol = new DColumn(r.getString("column1"), r.getString("value"));
            }
            
            result.add(cqlCol);
        }
        return result;
    }
985011
private int search(List<Node<ColumnName>> partial, SolutionAcceptor<ColumnName> output) {
    int results = 0;
    if (head.right == head) {
      List<List<ColumnName>> result = new ArrayList<List<ColumnName>>(partial.size());
      for(Node<ColumnName> row: partial) {
        result.add(getRowName(row));
      }
      output.solution(result);
      results += 1;
    } else {
      ColumnHeader<ColumnName> col = findBestColumn();
      if (col.size > 0) {
        coverColumn(col);
        Node<ColumnName> row = col.down;
        while (row != col) {
          partial.add(row);
          Node<ColumnName> node = row.right;
          while (node != row) {
            coverColumn(node.head);
            node = node.right;
          }
          results += search(partial, output);
          partial.remove(partial.size() - 1);
          node = row.left;
          while (node != row) {
            uncoverColumn(node.head);
            node = node.left;
          }
          row = row.down;
        }
        uncoverColumn(col);
      }
    }
    return results;
  }
474521
def lists(self, column, key=None):
        
        columns = self._get_list_select(column, key)

        if key is not None:
            results = {}
            for result in self.get(columns):
                results[result[key]] = result[column]
        else:
            results = Collection(list(map(lambda x: x[column], self.get(columns))))

        return results
250762
def get_index_and_columns_order(cls, columns_in_file_expected, columns_dict, file_path):
        
        use_columns_with_index = []
        column_names_in_db = []

        column_names_from_file = cls.get_column_names_from_file(file_path)
        if not set(columns_in_file_expected).issubset(column_names_from_file):
            log.exception(
                '%s columns are not a subset of columns %s in file %s',
                columns_in_file_expected,
                column_names_from_file,
                file_path
            )
        else:
            for index, column in enumerate(column_names_from_file):
                if column in columns_dict:
                    use_columns_with_index.append(index)
                    column_names_in_db.append(columns_dict[column])
        return use_columns_with_index, column_names_in_db
1170730
def index(self, column):  # pylint: disable=C6409
        
        for i, key in enumerate(self._keys):
            if key == column:
                return i
        raise ValueError('Column "%s" not found.' % column)
780528
public static void configureCacheStore(MappedParametrizedObjectEntry parameterEntry,
                                          String dataSourceParamName, String dataColumnParamName, String idColumnParamName, String timeColumnParamName, String dialectParamName)
      throws RepositoryException
   {
      String dataSourceName = parameterEntry.getParameterValue(dataSourceParamName, null);

      String dialect = parameterEntry.getParameterValue(dialectParamName, DBConstants.DB_DIALECT_AUTO).toUpperCase();

      // if data source is defined, then inject correct data-types.
      // Also it cans be not defined and nothing should be injected
      // (i.e. no cache loader is used (possibly pattern is changed, to used another cache loader))
      DataSource dataSource;
      try
      {
         dataSource = (DataSource)new InitialContext().lookup(dataSourceName);
      }
      catch (NamingException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }

      String blobType;
      String charType;
      String timeStampType;
      try
      {
         blobType = JDBCUtils.getAppropriateBlobType(dataSource);
         if (dialect.startsWith(DBConstants.DB_DIALECT_MYSQL) && dialect.endsWith("-UTF8"))
         {
            charType = "VARCHAR(255)";
         }
         else
         {
            charType = JDBCUtils.getAppropriateCharType(dataSource);
         }
         timeStampType = JDBCUtils.getAppropriateTimestamp(dataSource);
      }
      catch (SQLException e)
      {
         throw new RepositoryException(e.getMessage(), e);
      }

      // set parameters if not defined
      // if parameter is missing in configuration, then
      // getParameterValue(INFINISPAN_JDBC_CL_DATA_COLUMN, INFINISPAN_JDBC_CL_AUTO)
      // will return INFINISPAN_JDBC_CL_AUTO. If parameter is present in configuration and
      //equals to "auto", then it should be replaced
      // with correct value for given database
      if (parameterEntry.getParameterValue(dataColumnParamName, "auto").equalsIgnoreCase("auto"))
      {
         parameterEntry.putParameterValue(dataColumnParamName, blobType);
      }

      if (parameterEntry.getParameterValue(idColumnParamName, "auto").equalsIgnoreCase("auto"))
      {
         parameterEntry.putParameterValue(idColumnParamName, charType);
      }

      if (parameterEntry.getParameterValue(timeColumnParamName, "auto").equalsIgnoreCase("auto"))
      {
         parameterEntry.putParameterValue(timeColumnParamName, timeStampType);
      }
   }
1020213
function buildValueColumns(
  item,
  loadedDimensions,
  columnCombinations,
  dataSets
) {
  var thisColumnOptions = clone(item._columnOptions);
  thisColumnOptions.tableStructure = item._tableStructure;
  var columns = [];
  var hasNoConcepts = item._concepts.length === 0;
  var regionDimension = getDimensionById(
    loadedDimensions,
    item.regionDimensionId
  );
  var regionDimensionIndex = getDimensionIndexById(
    loadedDimensions,
    item.regionDimensionId
  );
  var timePeriodDimension = getDimensionById(
    loadedDimensions,
    item.timePeriodDimensionId
  );
  var timePeriodDimensionIndex = getDimensionIndexById(
    loadedDimensions,
    item.timePeriodDimensionId
  );

  var regionCount = defined(regionDimension)
    ? regionDimension.values.length
    : 1;
  var timePeriodCount = defined(timePeriodDimension)
    ? timePeriodDimension.values.length
    : 1;

  for (
    var combinationIndex = 0;
    combinationIndex < columnCombinations.ids.length;
    combinationIndex++
  ) {
    var ids = columnCombinations.ids[combinationIndex];
    var dimensionIndices = mapDimensionValueIdsToKeyValues(
      item,
      loadedDimensions,
      ids
    );
    // The name is just the joined names of all the columns involved, or 'value' if no columns still have names.
    var combinationName =
      columnCombinations.names[combinationIndex]
        .filter(function(name) {
          return !!name;
        })
        .join(" ") || "Value";
    var combinationId = ids.join(" ") || "Value";
    var values = [];
    for (
      var timePeriodIndex = 0;
      timePeriodIndex < timePeriodCount;
      timePeriodIndex++
    ) {
      for (var regionIndex = 0; regionIndex < regionCount; regionIndex++) {
        if (defined(regionDimensionIndex)) {
          dimensionIndices[regionDimensionIndex] =
            regionDimension.values[regionIndex].id;
        }
        if (defined(timePeriodDimensionIndex)) {
          dimensionIndices[timePeriodDimensionIndex] =
            timePeriodDimension.values[timePeriodIndex].id;
        }
        values.push(
          getObsValue(item, loadedDimensions, dimensionIndices, dataSets)
        );
      }
    }
    thisColumnOptions.id = combinationId; // So we can refer to the dimension in a template by a sequence of ids or names.
    var column = new TableColumn(combinationName, values, thisColumnOptions);
    if (hasNoConcepts) {
      // If there are no concepts displayed to the user, there is only one value column, and we won't add a "total" column.
      // So make this column active.
      column.isActive = true;
    }
    columns.push(column);
  }
  return columns;
}
685090
public <T> T queryColumns(K key, List<N> columns,
      ColumnFamilyRowMapper<K, N, T> mapper) {
    HSlicePredicate<N> predicate = new HSlicePredicate<N>(topSerializer);
    predicate.setColumnNames(columns);        
    return doExecuteSlice(key, predicate, mapper);
  }
1162662
def lists(self, column, key=None):
        
        results = self._query.lists(column, key)

        if self._model.has_get_mutator(column):
            if isinstance(results, dict):
                for key, value in results.items():
                    fill = {column: value}

                    results[key] = self._model.new_from_builder(fill).column
            else:
                for i, value in enumerate(results):
                    fill = {column: value}

                    results[i] = self._model.new_from_builder(fill).column

        return results
453066
@Override
    protected SuperColumn getSuperColumnForRow(ConsistencyLevel consistencyLevel, String columnFamilyName,
            String rowKey, byte[] superColumnName, String persistenceUnit)
    {
        ColumnPath cp = new ColumnPath(columnFamilyName);
        cp.setSuper_column(superColumnName);
        ColumnOrSuperColumn cosc = null;
        Connection conn = thriftClient.getConnection();

        try
        {
            cosc = conn.getClient().get(ByteBuffer.wrap(rowKey.getBytes()), cp, consistencyLevel);
        }
        catch (InvalidRequestException e)
        {
            log.error("Unable to search from inverted index, Caused by: .", e);
            throw new IndexingException(e);
        }
        catch (NotFoundException e)
        {
            log.warn("Not found any record in inverted index table.");
        }
        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);
        }
        SuperColumn thriftSuperColumn = ThriftDataResultHelper.transformThriftResult(cosc,
                ColumnFamilyType.SUPER_COLUMN, null);
        return thriftSuperColumn;
    }
225539
public function filtering()
    {
        $this->query->where(
                function ($query) {
            $globalKeyword = $this->setupKeyword($this->request->keyword());
            $queryBuilder  = $this->getQueryBuilder($query);
            if ($this->request->hasHeader('search-protection')) {
                $this->request->setSearchableColumnIndex($this->columns, $this->columnDef['filter']);
            }

            foreach ($this->request->searchableColumnIndex() as $index) {
                $columnName = $this->getColumnName($index);
                if ($this->isBlacklisted($columnName)) {
                    continue;
                }

                // check if custom column filtering is applied
                if (isset($this->columnDef['filter'][$columnName])) {
                    $columnDef         = $this->columnDef['filter'][$columnName];
                    // check if global search should be applied for the specific column
                    $applyGlobalSearch = count($columnDef['parameters']) == 0 || end($columnDef['parameters']) !== false;
                    if (!$applyGlobalSearch) {
                        continue;
                    }

                    if ($columnDef['method'] instanceof Closure) {
                        $whereQuery = $queryBuilder->newQuery();
                        call_user_func_array($columnDef['method'], [$whereQuery, $this->request->keyword()]);
                        $queryBuilder->addNestedWhereQuery($whereQuery, 'or');
                    } else {
                        $this->compileColumnQuery(
                                $queryBuilder, Helper::getOrMethod($columnDef['method']), $columnDef['parameters'], $columnName, $this->request->keyword()
                        );
                    }
                } else {
                    if (count(explode('.', $columnName)) > 1) {
                        $eagerLoads     = $this->getEagerLoads();
                        $parts          = explode('.', $columnName);
                        $relationColumn = array_pop($parts);
                        $relation       = implode('.', $parts);
                        if (in_array($relation, $eagerLoads)) {
                            $this->compileRelationSearch(
                                    $queryBuilder, $relation, $relationColumn, $globalKeyword
                            );
                        } else {
                            $this->compileGlobalSearch($queryBuilder, $columnName, $globalKeyword);
                        }
                    } else {
                        $this->compileGlobalSearch($queryBuilder, $columnName, $globalKeyword);
                    }
                }

                $this->isFilterApplied = true;
            }
        }
        );
    }
985674
protected function individualColumnFilters()
    {
        $columnSearch = [];
        if (isset($this->individualColumnFiltering)) {
            $this->sRangeSeparator = isset($this->sRangeSeparator) ? $this->sRangeSeparator : '~';
            for ($i = 0, $ien = count($this->columns); $i<$ien; $i++) {
                if (self::isSearchable($this->columns[$i]) && !empty($this->request['columns'][$i]['search']['value'])) {
                    $search_value = trim($this->request['columns'][$i]['search']['value']);
                    $key = $this->toSQLColumn($this->columns[$i], 2, true);
                    $where_condition = $this->generateSQLColumnFilter($key, $search_value);
                    if (!$this->setHaving($where_condition, $this->columns[$i])) {
                        $columnSearch[] = $where_condition;
                    }
                }
            }
        }

        return implode(' AND ', $columnSearch);
    }
1324615
def get_column_listing(self, table):
        
        sql = self._grammar.compile_column_exists()
        database = self._connection.get_database_name()
        table = self._connection.get_table_prefix() + table

        results = []
        for result in self._connection.select(sql, [database, table]):
            new_result = {}
            for key, value in result.items():
                new_result[key.lower()] = value

            results.append(new_result)

        return self._connection.get_post_processor().process_column_listing(results)
744097
public function searchableColumnIndex()
    {
        $searchable = [];
        for ($i = 0, $c = count($this->request->input('columns')); $i < $c; $i++) {
            if ($this->isColumnSearchable($i, false)) {
                $searchable[] = $i;
            }
        }

        return $searchable;
    }
127312
@Override
    protected void populateColumnSchema(ArrayList<VoltTable.ColumnInfo> columns) {
        super.populateColumnSchema(columns);
        columns.add(new VoltTable.ColumnInfo("PARTITION_ID", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("PROCEDURE", VoltType.STRING));
        columns.add(new VoltTable.ColumnInfo("STATEMENT", VoltType.STRING));
        columns.add(new VoltTable.ColumnInfo("INVOCATIONS", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("TIMED_INVOCATIONS", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("MIN_EXECUTION_TIME", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("MAX_EXECUTION_TIME", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("AVG_EXECUTION_TIME", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("MIN_RESULT_SIZE", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("MAX_RESULT_SIZE", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("AVG_RESULT_SIZE", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("MIN_PARAMETER_SET_SIZE", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("MAX_PARAMETER_SET_SIZE", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("AVG_PARAMETER_SET_SIZE", VoltType.INTEGER));
        columns.add(new VoltTable.ColumnInfo("ABORTS", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("FAILURES", VoltType.BIGINT));
        columns.add(new VoltTable.ColumnInfo("TRANSACTIONAL", VoltType.TINYINT));
    }