MCPcopy Create free account
hub / github.com/crate/crate / FetchMarker

Class FetchMarker

server/src/main/java/io/crate/expression/symbol/FetchMarker.java:41–113  ·  view source on GitHub ↗

A FetchMarker wraps a `_fetchid` and behaves mostly transparent (as if it were the _fetchId), but it carries all the `fetchRefs` that can and will be fetched via the _fetchId.

Source from the content-addressed store, hash-verified

39 * but it carries all the `fetchRefs` that can and will be fetched via the _fetchId.
40 */
41public final class FetchMarker implements Symbol {
42
43 private final RelationName relationName;
44 private final List<Reference> fetchRefs;
45 private final Reference fetchId;
46
47 public FetchMarker(RelationName relationName, List<Reference> fetchRefs) {
48 this(relationName, fetchRefs, SysColumns.forTable(relationName, SysColumns.FETCHID));
49 }
50
51 public FetchMarker(RelationName relationName, List<Reference> fetchRefs, Reference fetchId) {
52 this.relationName = relationName;
53 this.fetchRefs = fetchRefs;
54 this.fetchId = fetchId;
55 }
56
57 public List<Reference> fetchRefs() {
58 return fetchRefs;
59 }
60
61 public RelationName relationName() {
62 return relationName;
63 }
64
65 public Reference fetchId() {
66 return fetchId;
67 }
68
69 @Override
70 public boolean any(Predicate<? super Symbol> predicate) {
71 return predicate.test(this) || fetchId.any(predicate);
72 }
73
74 @Override
75 public SymbolType symbolType() {
76 return SymbolType.REFERENCE;
77 }
78
79 @Override
80 public <C, R> R accept(SymbolVisitor<C, R> visitor, C context) {
81 return visitor.visitFetchMarker(this, context);
82 }
83
84 @Override
85 public DataType<?> valueType() {
86 return fetchId.valueType();
87 }
88
89 @Override
90 public String toString() {
91 return toString(Style.UNQUALIFIED);
92 }
93
94 @Override
95 public String toString(Style style) {
96 if (relationName.schema() == null) {
97 return relationName.sqlFqn() + "." + fetchId.toString(style);
98 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected