@Override public List<DataRecord> visit(StagingBlockKey stagingBlockKey) { FieldMetadata blockField = new SimpleTypeFieldMetadata( explicitProjection, false, false, false, "blockKey", //$NON-NLS-1$ new SimpleTypeMetadata(XMLConstants.W3C_XML_SCHEMA_NS_URI, Types.STRING), Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList(), StringUtils.EMPTY); lastField = blockField; recordProjection.put( blockField, new ValueBuilder() { @Override public Object getValue(DataRecord record) { return record .getRecordMetadata() .getRecordProperties() .get(StagingStorage.METADATA_STAGING_BLOCK_KEY); } }); return records; }
@Override public List<DataRecord> visit(Alias alias) { alias.getTypedExpression().accept(this); FieldMetadata aliasField = new SimpleTypeFieldMetadata( explicitProjection, false, lastField.isMany(), lastField.isMandatory(), alias.getAliasName(), lastField.getType(), Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList(), StringUtils.EMPTY); ValueBuilder previousValueBuilder = recordProjection.remove(lastField); if (previousValueBuilder == null) { AggregateValueBuilder previous = aggregateProjection.remove(lastField); aggregateProjection.put(aliasField, previous); } else { recordProjection.put(aliasField, previousValueBuilder); } return records; }
@Override public void prepare(MetadataRepository repository, boolean dropExistingData) { // Nothing to do prepare(repository, Collections.<Expression>emptySet(), false, true); }
@Override public Set<String> getFullTextSuggestion( String keyword, FullTextSuggestion mode, int suggestionSize) { return Collections.emptySet(); }
@Override public void update(DataRecord record) { update(Collections.singletonList(record)); }