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

The following examples show how to use org.apache.calcite.plan.RelOptTable#getColumnStrategies() . 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 File: RelOptTableImpl.java    From Bats with 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 File: RelOptTableImpl.java    From calcite with 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;
}