MCPcopy Create free account
hub / github.com/apache/calcite / unparse

Method unparse

core/src/main/java/org/apache/calcite/sql/SqlHint.java:162–180  ·  view source on GitHub ↗
(SqlWriter writer, int leftPrec, int rightPrec)

Source from the content-addressed store, hash-verified

160 }
161
162 @Override public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
163 name.unparse(writer, leftPrec, rightPrec);
164 if (!this.options.isEmpty()) {
165 SqlWriter.Frame frame =
166 writer.startList(SqlWriter.FrameTypeEnum.FUN_CALL, "(", ")");
167 for (int i = 0; i < options.size(); i++) {
168 SqlNode option = options.get(i);
169 SqlNode nextOption = i < options.size() - 1 ? options.get(i + 1) : null;
170 writer.sep(",", false);
171 option.unparse(writer, leftPrec, rightPrec);
172 if (optionFormat == HintOptionFormat.KV_LIST && nextOption != null) {
173 writer.keyword("=");
174 nextOption.unparse(writer, leftPrec, rightPrec);
175 i += 1;
176 }
177 }
178 writer.endList(frame);
179 }
180 }
181
182 /** Enumeration that represents hint option format. */
183 public enum HintOptionFormat implements Symbolizable {

Callers 12

unparseSqlSetOptionMethod · 0.45
unparseFetchUsingAnsiMethod · 0.45
unparseLimitMethod · 0.45
unparseOffsetMethod · 0.45
unparseFunctionSyntaxMethod · 0.45
unparseBinarySyntaxMethod · 0.45
populateMethod · 0.45
testArgumentBoundsMethod · 0.45
populateMethod · 0.45

Calls 8

unparseMethod · 0.95
startListMethod · 0.65
sizeMethod · 0.65
getMethod · 0.65
sepMethod · 0.65
keywordMethod · 0.65
endListMethod · 0.65
isEmptyMethod · 0.45

Tested by 2

testArgumentBoundsMethod · 0.36
populateMethod · 0.36