public void findAliases(List<SqlMoniker> result) { for (Pair<String, SqlValidatorNamespace> pair : children) { result.add(new SqlMonikerImpl(pair.left, SqlMonikerType.TABLE)); } parent.findAliases(result); }
public void findAliases(List<SqlMoniker> result) { for (Pair<String, SqlValidatorNamespace> pair : children) { result.add(new SqlMonikerImpl(pair.left, SqlMonikerType.Table)); } parent.findAliases(result); }
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { final OptiqSchema schema = getSchema(names); if (schema == null) { return ImmutableList.of(); } final List<SqlMoniker> result = new ArrayList<SqlMoniker>(); final Map<String, OptiqSchema> schemaMap = schema.getSubSchemaMap(); for (String subSchema : schemaMap.keySet()) { result.add( new SqlMonikerImpl(schema.path(subSchema), SqlMonikerType.SCHEMA)); } for (String table : schema.getTableNames()) { result.add( new SqlMonikerImpl(schema.path(table), SqlMonikerType.TABLE)); } final NavigableSet<String> functions = schema.getFunctionNames(); for (String function : functions) { // views are here as well result.add( new SqlMonikerImpl(schema.path(function), SqlMonikerType.FUNCTION)); } return result; }
protected void addColumnNames( SqlValidatorNamespace ns, List<SqlMoniker> colNames) { final RelDataType rowType; try { rowType = ns.getRowType(); } catch (Error e) { // namespace is not good - bail out. return; } for (RelDataTypeField field : rowType.getFieldList()) { colNames.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.COLUMN)); } }
&& tokenName.endsWith("\"")) { hintList.add( new SqlMonikerImpl( tokenName.substring(1, tokenName.length() - 1), SqlMonikerType.KEYWORD));
new SqlMonikerImpl( tokenName.substring(1, tokenName.length() - 1), SqlMonikerType.Keyword));
protected void addColumnNames( SqlValidatorNamespace ns, List<SqlMoniker> colNames) { final RelDataType rowType; try { rowType = ns.getRowType(); } catch (Error e) { // namespace is not good - bail out. return; } for (RelDataTypeField field : rowType.getFieldList()) { colNames.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.Column)); } }
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { List<SqlMoniker> result; switch (names.size()) { case 0: // looking for schema names result = new ArrayList<SqlMoniker>(); for (MockSchema schema : schemas.values()) { result.add( new SqlMonikerImpl(schema.name, SqlMonikerType.SCHEMA)); } return result; case 1: // looking for table names in the given schema MockSchema schema = schemas.get(names.get(0)); if (schema == null) { return Collections.emptyList(); } result = new ArrayList<SqlMoniker>(); for (String tableName : schema.tableNames) { result.add( new SqlMonikerImpl( tableName, SqlMonikerType.TABLE)); } return result; default: return Collections.emptyList(); } }
public List<SqlMoniker> getAllSchemaObjectNames(List<String> names) { List<SqlMoniker> result; switch (names.size()) { case 0: // looking for schema names result = new ArrayList<SqlMoniker>(); for (MockSchema schema : schemas.values()) { result.add( new SqlMonikerImpl(schema.name, SqlMonikerType.Schema)); } return result; case 1: // looking for table names in the given schema MockSchema schema = schemas.get(names.get(0)); if (schema == null) { return Collections.emptyList(); } result = new ArrayList<SqlMoniker>(); for (String tableName : schema.tableNames) { result.add( new SqlMonikerImpl( tableName, SqlMonikerType.Table)); } return result; default: return Collections.emptyList(); } }
if (call != null) { result.add( new SqlMonikerImpl( op.getName(), SqlMonikerType.FUNCTION)); sig = sig.replaceAll("'", ""); result.add( new SqlMonikerImpl( sig, SqlMonikerType.FUNCTION)); new SqlMonikerImpl( op.getName(), SqlMonikerType.FUNCTION));
if (call != null) { result.add( new SqlMonikerImpl( op.getName(), SqlMonikerType.Function)); sig = sig.replaceAll("'", ""); result.add( new SqlMonikerImpl( sig, SqlMonikerType.Function)); new SqlMonikerImpl( op.getName(), SqlMonikerType.Function));
for (RelDataTypeField field : rowType.getFieldList()) { hintList.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.Column)); for (RelDataTypeField field : rowType.getFieldList()) { hintList.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.Column));
for (RelDataTypeField field : rowType.getFieldList()) { hintList.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.COLUMN)); for (RelDataTypeField field : rowType.getFieldList()) { hintList.add( new SqlMonikerImpl( field.getName(), SqlMonikerType.COLUMN));