in calcite-adapter/src/main/java/software/amazon/documentdb/jdbc/calcite/adapter/DocumentDbJoin.java [354:371]
static ImmutableList<DocumentDbSchemaColumn> getFilterColumns(
final DocumentDbSchemaTable table) {
// We don't need to check for
// 1. primary keys,
// 2. foreign keys (from another table)
// 3. columns that are "virtual" (i.e. arrays, structures)
final List<DocumentDbSchemaColumn> columns = table.getColumnMap().values().stream()
.filter(c -> !c.isPrimaryKey()
&& c.getForeignKeyTableName() == null
&& !(c instanceof DocumentDbMetadataColumn &&
((DocumentDbMetadataColumn)c).isGenerated())
&& !(c.getSqlType() == null ||
c.getSqlType() == JdbcType.ARRAY ||
c.getSqlType() == JdbcType.JAVA_OBJECT ||
c.getSqlType() == JdbcType.NULL))
.collect(Collectors.toList());
return ImmutableList.copyOf(columns);
}