Skip to content

Instantly share code, notes, and snippets.

@masayuki038
Created June 7, 2019 12:55
Show Gist options
  • Save masayuki038/284358d29804b3f6cc618de5d4857c13 to your computer and use it in GitHub Desktop.
Save masayuki038/284358d29804b3f6cc618de5d4857c13 to your computer and use it in GitHub Desktop.
/* 1 */ org.apache.calcite.DataContext root;
/* 2 */
/* 3 */ public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root0) {
/* 4 */ root = root0;
/* 5 */ final org.apache.calcite.linq4j.Enumerable _inputEnumerable = ((org.apache.calcite.adapter.csv.CsvTranslatableTable) root.getRootSchema().getSubSchema("SALES").getTable("EMPS")).project(root, new int[] {
/* 6 */ 0,
/* 7 */ 1,
/* 8 */ 3});
/* 9 */ return new org.apache.calcite.linq4j.AbstractEnumerable(){
/* 10 */ public org.apache.calcite.linq4j.Enumerator enumerator() {
/* 11 */ return new org.apache.calcite.linq4j.Enumerator(){
/* 12 */ public final org.apache.calcite.linq4j.Enumerator inputEnumerator = _inputEnumerable.enumerator();
/* 13 */ public void reset() {
/* 14 */ inputEnumerator.reset();
/* 15 */ }
/* 16 */
/* 17 */ public boolean moveNext() {
/* 18 */ while (inputEnumerator.moveNext()) {
/* 19 */ final Object[] current = (Object[]) inputEnumerator.current();
/* 20 */ final String inp1_ = current[1] == null ? (String) null : current[1].toString();
/* 21 */ if (inp1_ != null && org.apache.calcite.runtime.SqlFunctions.eq(inp1_, "John")) {
/* 22 */ return true;
/* 23 */ }
/* 24 */ }
/* 25 */ return false;
/* 26 */ }
/* 27 */
/* 28 */ public void close() {
/* 29 */ inputEnumerator.close();
/* 30 */ }
/* 31 */
/* 32 */ public Object current() {
/* 33 */ final Object[] current = (Object[]) inputEnumerator.current();
/* 34 */ return new Object[] {
/* 35 */ current[0],
/* 36 */ current[2],
/* 37 */ current[1]};
/* 38 */ }
/* 39 */
/* 40 */ };
/* 41 */ }
/* 42 */
/* 43 */ };
/* 44 */ }
/* 45 */
/* 46 */
/* 47 */ public Class getElementType() {
/* 48 */ return java.lang.Object[].class;
/* 49 */ }
/* 50 */
/* 51 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment