format/src/main/java/com/github/sadikovi/riff/FileWriter.java
/**
   * Create new array of column filters for a stripe.
   * Returns null if column filters are disabled.
   * @param td type description
   * @param enabled true if column filters are enabled
   * @param stripeRows expected number of rows in stripe
   * @return array of column filters or null if filters are disabled
   */
Create new array of column filters for a stripe.
Returns null if column filters are disabled.
@param td type description
@param enabled true if column filters are enabled
@param stripeRows expected number of rows in stripe
@return array of column filters or null if filters are disabled
Create new array of column filters for a stripe . Returns null if column filters are disabled . @param td type description @param enabled true if column filters are enabled @param stripeRows expected number of rows in stripe @return array of column filters or null if filters are disabled
private static ColumnFilter[] createColumnFilters(
      TypeDescription td, boolean enabled, int stripeRows) {
    if (!enabled || td.indexFields().length == 0) return null;
    ColumnFilter[] filters = new ColumnFilter[td.fields().length];
    for (int i = 0; i < td.fields().length; i++) {
      if (td.fields()[i].isIndexed()) {
        filters[i] = ColumnFilter.sqlTypeToColumnFilter(td.fields()[i].dataType(), stripeRows);
      } else {
        filters[i] = ColumnFilter.noopFilter();
      }
    }
    return filters;
  }
private static ColumnFilter [ ] createColumnFilters ( TypeDescription td , boolean enabled , int stripeRows ) { if ( ! enabled || td . indexFields ( ) . length == 0 ) return null ; ColumnFilter [ ] filters = new ColumnFilter [ td . fields ( ) . length ] ; for ( int i = 0 ; i < td . fields ( ) . length ; i ++ ) { if ( td . fields ( ) [ i ] . isIndexed ( ) ) { filters [ i ] = ColumnFilter . sqlTypeToColumnFilter ( td . fields ( ) [ i ] . dataType ( ) , stripeRows ) ; } else { filters [ i ] = ColumnFilter . noopFilter ( ) ; } } return filters ; }
Create new array of column filters for a stripe.
Create new array of column filters for a stripe .
// column filters are created only if enabled and type description contains any indexed fields