Java Code Examples for org.apache.calcite.plan.RelOptTable#getColumnStrategies()

The following examples show how to use org.apache.calcite.plan.RelOptTable#getColumnStrategies() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Bats   File: RelOptTableImpl.java    License: Apache License 2.0 5 votes vote down vote up
/** Converts the ordinal of a field into the ordinal of a stored field.
 * That is, it subtracts the number of virtual fields that come before it. */
public static int realOrdinal(final RelOptTable table, int i) {
    List<ColumnStrategy> strategies = table.getColumnStrategies();
    int n = 0;
    for (int j = 0; j < i; j++) {
        switch (strategies.get(j)) {
        case VIRTUAL:
            ++n;
        }
    }
    return i - n;
}
 
Example 2
Source Project: calcite   File: RelOptTableImpl.java    License: Apache License 2.0 5 votes vote down vote up
/** Converts the ordinal of a field into the ordinal of a stored field.
 * That is, it subtracts the number of virtual fields that come before it. */
public static int realOrdinal(final RelOptTable table, int i) {
  List<ColumnStrategy> strategies = table.getColumnStrategies();
  int n = 0;
  for (int j = 0; j < i; j++) {
    switch (strategies.get(j)) {
    case VIRTUAL:
      ++n;
    }
  }
  return i - n;
}